mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
JS: use 'Util::describeExpression' in js/trivial-conditional
This commit is contained in:
@@ -138,10 +138,7 @@ where isConditional(cond, op.asExpr()) and
|
||||
// otherwise we just report that `op` always evaluates to `cv`
|
||||
else (
|
||||
sel = op.asExpr().stripParens() and
|
||||
if sel instanceof VarAccess then
|
||||
msg = "Variable '" + sel.(VarAccess).getVariable().getName() + "' always evaluates to " + cv + " here."
|
||||
else
|
||||
msg = "This expression always evaluates to " + cv + "."
|
||||
msg = "This " + describeExpression(sel) + " always evaluates to " + cv + "."
|
||||
)
|
||||
|
||||
select sel, msg
|
||||
|
||||
Reference in New Issue
Block a user