Skip to content

Commit

Permalink
#416 fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaneberly committed Aug 12, 2017
1 parent e5b7926 commit 8dfe18a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/cflint/CFLint.java
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@ private void process(final Element elem, final String space, final Context conte
}
} else if (elem.getName().equalsIgnoreCase("cfqueryparam")) {
scanElement(elem, context);
for(final Entry<String, CFExpression> expression : unpackTagExpressions(elem).entrySet()){
if (expression != null) {
process(expression.getValue(), elem, context);
}
}
} else if (elem.getName().equalsIgnoreCase("cfinclude")) {
scanElement(elem, context);
final String path = elem.getAttributeValue("template");
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/cflint/TestUnusedLocalVarChecker.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.cflint;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -253,7 +254,6 @@ public void testMultipleUnusedVarFunctionInTag() throws ParseException, IOExcept


@Test
@Ignore
public void testUsedVarInQuaryParam() throws ParseException, IOException {
final String tagSrc = "<cfcomponent>\r\n"
+ "<cffunction name=\"changePassword\">\r\n"
Expand All @@ -269,9 +269,9 @@ public void testUsedVarInQuaryParam() throws ParseException, IOException {
+ "</cffunction>\r\n"
+ "</cfcomponent>";

cfBugs.process(tagSrc, "test");
cfBugs.process(tagSrc, "test");
final List<BugInfo> result = cfBugs.getBugs().getBugList().get("UNUSED_LOCAL_VARIABLE");
assertEquals(0, result.size());
assertTrue(result == null);
}

}

0 comments on commit 8dfe18a

Please sign in to comment.