mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
19
csharp/ql/src/Useless code/FutileConditional.cs
Normal file
19
csharp/ql/src/Useless code/FutileConditional.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
class FutileConditional
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if (args.Length > 10) ; // BAD
|
||||
if (args.Length > 8)
|
||||
{
|
||||
// BAD
|
||||
}
|
||||
if (args.Length > 6)
|
||||
{
|
||||
// GOOD: because of else-branch
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Console.WriteLine("hello");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user