JavaScript: Autoformat all QL files.

This commit is contained in:
Max Schaefer
2019-01-07 10:15:45 +00:00
parent aa6b89dc34
commit 31bb39a810
380 changed files with 9957 additions and 13923 deletions

View File

@@ -16,12 +16,15 @@ import javascript
* Gets an iteration variable that loop `for` tests and updates.
*/
Variable getAnIterationVariable(ForStmt for) {
result.getAnAccess().getParentExpr*() = for.getTest() and
exists (UpdateExpr upd | upd.getParentExpr*() = for.getUpdate() | upd.getOperand() = result.getAnAccess())
result.getAnAccess().getParentExpr*() = for.getTest() and
exists(UpdateExpr upd | upd.getParentExpr*() = for.getUpdate() |
upd.getOperand() = result.getAnAccess()
)
}
from ForStmt outer, ForStmt inner
where inner.nestedIn(outer) and
getAnIterationVariable(outer) = getAnIterationVariable(inner)
select inner.getTest(), "This for statement uses the same loop variable as an enclosing $@.",
outer, "for statement"
where
inner.nestedIn(outer) and
getAnIterationVariable(outer) = getAnIterationVariable(inner)
select inner.getTest(), "This for statement uses the same loop variable as an enclosing $@.", outer,
"for statement"