use of net.sourceforge.pmd.lang.dfa.pathfinder.DAAPathFinder in project pmd by pmd.
the class UselessAssignment method visit.
public Object visit(ASTMethodDeclaration node, Object data) {
this.rc = (RuleContext) data;
/*
* IDataFlowNode n1 = node.getDataFlowNode(); List f = n1.getFlow(); for
* (Iterator i = f.iterator(); i.hasNext();) { DataFlowNode dfan =
* (DataFlowNode)i.next(); System.out.println(dfan); List va =
* dfan.getVariableAccess(); for (Iterator j = va.iterator();
* j.hasNext();) { VariableAccess o = (VariableAccess)j.next();
* System.out.println(o); } }
*/
DAAPathFinder a = new DAAPathFinder(node.getDataFlowNode().getFlow().get(0), this);
a.run();
return data;
}
use of net.sourceforge.pmd.lang.dfa.pathfinder.DAAPathFinder in project pmd by pmd.
the class DataflowAnomalyAnalysisRule method visit.
public Object visit(ASTMethodDeclaration methodDeclaration, Object data) {
rc = (RuleContext) data;
daaRuleViolations = new ArrayList<>();
final DataFlowNode node = methodDeclaration.getDataFlowNode().getFlow().get(0);
final DAAPathFinder pathFinder = new DAAPathFinder(node, this, getProperty(MAX_PATH_DESCRIPTOR));
pathFinder.run();
super.visit(methodDeclaration, data);
return data;
}
use of net.sourceforge.pmd.lang.dfa.pathfinder.DAAPathFinder in project pmd by pmd.
the class DAAPathFinderTest method testTwoUpdateDefs.
@Test
public void testTwoUpdateDefs() {
ASTMethodDeclarator meth = getOrderedNodes(ASTMethodDeclarator.class, TWO_UPDATE_DEFS).get(0);
DAAPathFinder a = new DAAPathFinder(meth.getDataFlowNode().getFlow().get(0), this);
// a.run();
}
Aggregations