From df0bddcbffe27b586a54f3255bb895475814226f Mon Sep 17 00:00:00 2001 From: paul-wade Date: Fri, 7 Aug 2015 21:21:19 -0500 Subject: [PATCH] [[fix]] case statments with no code should not increase complexity #840 --- src/jshint.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jshint.js b/src/jshint.js index c6ffd962d..472581b9f 100644 --- a/src/jshint.js +++ b/src/jshint.js @@ -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":