Skip to content

Commit

Permalink
add the bugs pre sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan authored and Ryan committed Dec 19, 2015
1 parent 47aff4f commit 9ea55d5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void endFunction(Context context, BugList bugs) {
if (!used) {
final String name = variable.getKey();
final Integer lineNo = variableLineNo.get(name);
bugs.add(new BugInfo.BugInfoBuilder().setLine(lineNo).setMessageCode("UNUSED_LOCAL_VARIABLE")
presortbugs.add(new BugInfo.BugInfoBuilder().setLine(lineNo).setMessageCode("UNUSED_LOCAL_VARIABLE")
.setSeverity(severity).setFilename(context.getFilename())
.setMessage("Local variable " + name + " is not used in function " + context.getFunctionName() + ", consider removing it.")
.build());
Expand Down
1 change: 0 additions & 1 deletion src/test/java/com/cflint/TestUnusedLocalVarChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ public void testMultipleUnusedVarFunctionInScript() throws ParseException, IOExc
cfBugs.process(scriptSrc, "test");
final List<BugInfo> result = cfBugs.getBugs().getBugList().get("UNUSED_LOCAL_VARIABLE");
assertEquals(3, result.size());
Collections.sort(result);
assertEquals("UNUSED_LOCAL_VARIABLE", result.get(0).getMessageCode());
assertEquals(6, result.get(0).getLine());
assertEquals("UNUSED_LOCAL_VARIABLE", result.get(1).getMessageCode());
Expand Down

0 comments on commit 9ea55d5

Please sign in to comment.