mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
10
csharp/ql/src/Complexity/ComplexCondition.cs
Normal file
10
csharp/ql/src/Complexity/ComplexCondition.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
class Complex
|
||||
{
|
||||
static bool foo(bool a, bool b, bool c, bool d, bool e, bool f, bool g)
|
||||
{
|
||||
bool x = a || b || c || d || e || f || g; // OK
|
||||
bool y = a && b || !(b && c) || !(d && e) && !(f && g); // NOT OK
|
||||
bool z = (a && b || (b && c)) && ((d && e) || (f && g)); // NOT OK
|
||||
return x && y && z; // OK
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user