Files
codeql/java/ql/test/library-tests/dataflow/sign-analysis/SignAnalysis.ql
2020-10-02 09:12:13 +02:00

23 lines
483 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
where e.getEnclosingCallable().fromSource()
select e, strictconcat(string s | s = getASignString(e) | s, " ")