Files
codeql/csharp/ql/test/library-tests/dataflow/signanalysis/SignAnalysis.ql
2026-04-10 15:47:12 +02:00

23 lines
523 B
Plaintext

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