Files
codeql/csharp/ql/test/library-tests/dataflow/signanalysis/SignAnalysis.ql
2020-11-11 09:46:18 +01:00

23 lines
522 B
Plaintext

import csharp
import semmle.code.csharp.dataflow.SignAnalysis
string getASignString(ControlFlow::Nodes::ExprNode 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 ControlFlow::Nodes::ExprNode e
where e.getExpr().fromSource()
select e, strictconcat(string s | s = getASignString(e) | s, " ")