-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<config> | ||
<includes code="PARSE_NOTHING"/> | ||
<includes code="FUNCTION_TOO_COMPLEX"/> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
component { | ||
public void function foo() { | ||
if (something) { | ||
doSomething(); | ||
} else { | ||
doSomethingElse(); | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/test/resources/com/cflint/tests/Complexity/ifelse.expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[ ] |
29 changes: 29 additions & 0 deletions
29
src/test/resources/com/cflint/tests/Complexity/ifelseComplex.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
component { | ||
public void function foo() { | ||
if (something) { | ||
doSomething(); | ||
} else { | ||
if (something) { | ||
if (something) { | ||
if (something) { | ||
if (something) { | ||
if (something) { | ||
if (something) { | ||
if (something) { | ||
if (something) { | ||
if (something) { | ||
if (something) { | ||
doSomethingElse(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/test/resources/com/cflint/tests/Complexity/ifelseComplex.expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ { | ||
"severity" : "WARNING", | ||
"id" : "FUNCTION_TOO_COMPLEX", | ||
"message" : "FUNCTION_TOO_COMPLEX", | ||
"category" : "CFLINT", | ||
"abbrev" : "FT", | ||
"locations" : [ { | ||
"file" : "src/test/resources/com/cflint/tests/Complexity/ifelseComplex.cfc", | ||
"fileName" : "ifelseComplex.cfc", | ||
"function" : "foo", | ||
"column" : "21", | ||
"line" : "15", | ||
"message" : "Function foo is too complex. Consider breaking the function into smaller functions.", | ||
"variable" : "", | ||
"expression" : "if(something ) {/ndoSomethingElse();/n/n }" | ||
} ] | ||
} ] |