Files
codeql/java/ql/test/library-tests/dataflow/sign-analysis/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
439 B
Plaintext

import java
import semmle.code.java.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, " ")