mirror of
https://github.com/github/codeql.git
synced 2026-04-22 23:35:14 +02:00
C#: Address review comments.
This commit is contained in:
@@ -50,7 +50,8 @@ class ConstantNullness
|
||||
j = (int?)i ?? 1; // BAD
|
||||
s = ""?.CommaJoinWith(s); // BAD
|
||||
s = s ?? ""; // GOOD
|
||||
s = (i==0 ? s : null) ?? s;
|
||||
s = (i==0 ? s : null) ?? s; // GOOD
|
||||
var k = (i==0 ? s : null)?.Length; // GOOD
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
| ConstantCondition.cs:49:17:49:18 | "" | Expression is never 'null'. |
|
||||
| ConstantCondition.cs:50:13:50:19 | (...) ... | Expression is never 'null'. |
|
||||
| ConstantCondition.cs:51:13:51:14 | "" | Expression is never 'null'. |
|
||||
| ConstantCondition.cs:63:18:63:18 | 2 | Pattern never matches. |
|
||||
| ConstantCondition.cs:65:18:65:18 | 3 | Pattern always matches. |
|
||||
| ConstantCondition.cs:76:18:76:20 | access to type Int32 | Pattern never matches. |
|
||||
| ConstantCondition.cs:64:18:64:18 | 2 | Pattern never matches. |
|
||||
| ConstantCondition.cs:66:18:66:18 | 3 | Pattern always matches. |
|
||||
| ConstantCondition.cs:77:18:77:20 | access to type Int32 | Pattern never matches. |
|
||||
| ConstantConditionBad.cs:5:16:5:20 | ... > ... | Condition always evaluates to 'false'. |
|
||||
| ConstantConditionalExpressionCondition.cs:11:22:11:34 | ... == ... | Condition always evaluates to 'true'. |
|
||||
| ConstantConditionalExpressionCondition.cs:12:21:12:25 | false | Condition always evaluates to 'false'. |
|
||||
|
||||
Reference in New Issue
Block a user