-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodacy-csharp-security-hard-coded-password.cs
More file actions
50 lines (36 loc) · 1.16 KB
/
codacy-csharp-security-hard-coded-password.cs
File metadata and controls
50 lines (36 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
namespace SecurityExample
{
class Program
{
static void Main(string[] args)
{
var password = "password"; // Issue: Hardcoded password
var api_key = "api_key"; // Issue: Hardcoded API key
Console.WriteLine("This is a security risk: " + password);
Console.WriteLine("This is a security risk: " + api_key);
}
public static bool? IsRegular(bool freqNoneOrNotPeriodic, bool freqPeriodical, IFrequency frequency)
{
if(frequency != null)
{
return false;
}
if (frequency.Days != 0)
return false;
if (frequency.Years == 1 && frequency.Months == 0)
return null;
}
public static bool? IsRegular2(bool freqNoneOrNotPeriodic, bool freqPeriodical, IFrequency frequency)
{
if(frequency == null)
{
return false;
}
if (frequency.Days != 0)
return false;
if (frequency.Years == 1 && frequency.Months == 0)
return null;
}
}
}