QL code and tests for C#/C++/JavaScript.

This commit is contained in:
Pavel Avgustinov
2018-08-02 17:53:23 +01:00
commit b55526aa58
10684 changed files with 581163 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
/**
* @name Non-case label in switch statement
* @description A non-case label appearing in a switch statement that is textually aligned with a case
* label is confusing to read, or may even indicate a bug.
* @kind problem
* @problem.severity warning
* @id js/label-in-switch
* @tags reliability
* readability
* @precision very-high
*/
import javascript
from LabeledStmt l, Case c
where l = c.getAChildStmt+() and
l.getLocation().getStartColumn() = c.getLocation().getStartColumn()
select l.getChildExpr(0), "Non-case labels in switch statements are confusing."