-
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.
- Loading branch information
1 parent
ebe6510
commit 1665aa6
Showing
3 changed files
with
87 additions
and
0 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
17 changes: 17 additions & 0 deletions
17
src/test/resources/com/cflint/tests/UnusedVariable/while_465.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,17 @@ | ||
component{ | ||
function safetext(text) { | ||
var obracket = find("<",theText); | ||
var badTag = ""; | ||
var nextStart = ""; | ||
while(obracket){ | ||
badTag = REFindNoCase(); | ||
if(badTag.pos[1]){ | ||
nextStart = badTag.pos[1] + badTag.len[1]; | ||
} | ||
else{ | ||
nextStart = obracket + 1; | ||
} | ||
} | ||
} | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
src/test/resources/com/cflint/tests/UnusedVariable/while_465.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,65 @@ | ||
{ | ||
"version" : "", | ||
"timestamp" : 1513779574, | ||
"issues" : [ { | ||
"severity" : "INFO", | ||
"id" : "UNUSED_LOCAL_VARIABLE", | ||
"message" : "UNUSED_LOCAL_VARIABLE", | ||
"category" : "CFLINT", | ||
"abbrev" : "UL", | ||
"locations" : [ { | ||
"file" : "src\\test\\resources\\com\\cflint\\tests\\UnusedVariable\\while_465.cfc", | ||
"fileName" : "while_465.cfc", | ||
"function" : "safetext", | ||
"column" : 8, | ||
"line" : 3, | ||
"message" : "Local variable obracket is not used in function safetext, consider removing it.", | ||
"variable" : "obracket", | ||
"expression" : "" | ||
} ] | ||
}, { | ||
"severity" : "INFO", | ||
"id" : "UNUSED_LOCAL_VARIABLE", | ||
"message" : "UNUSED_LOCAL_VARIABLE", | ||
"category" : "CFLINT", | ||
"abbrev" : "UL", | ||
"locations" : [ { | ||
"file" : "src\\test\\resources\\com\\cflint\\tests\\UnusedVariable\\while_465.cfc", | ||
"fileName" : "while_465.cfc", | ||
"function" : "safetext", | ||
"column" : 8, | ||
"line" : 4, | ||
"message" : "Local variable badTag is not used in function safetext, consider removing it.", | ||
"variable" : "badTag", | ||
"expression" : "" | ||
} ] | ||
}, { | ||
"severity" : "INFO", | ||
"id" : "UNUSED_LOCAL_VARIABLE", | ||
"message" : "UNUSED_LOCAL_VARIABLE", | ||
"category" : "CFLINT", | ||
"abbrev" : "UL", | ||
"locations" : [ { | ||
"file" : "src\\test\\resources\\com\\cflint\\tests\\UnusedVariable\\while_465.cfc", | ||
"fileName" : "while_465.cfc", | ||
"function" : "safetext", | ||
"column" : 8, | ||
"line" : 5, | ||
"message" : "Local variable nextStart is not used in function safetext, consider removing it.", | ||
"variable" : "nextStart", | ||
"expression" : "" | ||
} ] | ||
} ], | ||
"counts" : { | ||
"totalFiles" : 0, | ||
"totalLines" : 0, | ||
"countByCode" : [ { | ||
"code" : "UNUSED_LOCAL_VARIABLE", | ||
"count" : 3 | ||
} ], | ||
"countBySeverity" : [ { | ||
"severity" : "INFO", | ||
"count" : 3 | ||
} ] | ||
} | ||
} |