Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
[[fix]] case statments with no code should not increase complexity js…
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-wade committed Aug 8, 2015
1 parent 3f0f807 commit 8582d11
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/jshint.js
Expand Up @@ -4002,12 +4002,11 @@ var JSHINT = (function() {

advance("case");
this.cases.push(expression(0));
increaseComplexityCount();
g = true;
advance(":");
//if next token is case then we are falling through decrease complexity
if(state.tokens.next.type == "case")
decreaseComplexityCount();
if(state.tokens.next.type != "case")
increaseComplexityCount();
state.funct["(verb)"] = "case";
break;
case "default":
Expand Down

0 comments on commit 8582d11

Please sign in to comment.