Files
codeql/csharp/ql/test/library-tests/dataflow/signanalysis/SignAnalysis.ql
Tamas Vajk 8bf4a4209c C#: Sign analysis
Synced between Java and C# through `identical-files.json`.
2020-09-21 16:15:12 +02:00

22 lines
443 B
Plaintext

import csharp
import semmle.code.csharp.dataflow.SignAnalysis
string getASignString(Expr e) {
positive(e) and
not strictlyPositive(e) and
result = "positive"
or
negative(e) and
not strictlyNegative(e) and
result = "negative"
or
strictlyPositive(e) and
result = "strictlyPositive"
or
strictlyNegative(e) and
result = "strictlyNegative"
}
from Expr e
select e, strictconcat(string s | s = getASignString(e) | s, " ")