fix most ql-for-ql warnings in JS

This commit is contained in:
Erik Krogh Kristensen
2022-02-11 17:57:37 +01:00
parent 360cf0ff17
commit a1c5724be7
29 changed files with 117 additions and 167 deletions

View File

@@ -17,7 +17,7 @@ import javascript
* Holds if the method name on the given container is likely to be a mistake.
*/
predicate isSuspiciousMethodName(string name, ClassOrInterface container) {
name = "function"
name = "function" and exists(container) // suspicious in any container
or
// "constructor" is only suspicious outside a class.
name = "constructor" and not container instanceof ClassDefinition