Search in sources :

Example 21 with DataPoint

use of net.sourceforge.pmd.stat.DataPoint in project pmd by pmd.

the class NPathComplexityRule method visit.

@Override
public Object visit(ASTTriggerUnit node, Object data) {
    LOGGER.entering(CLASS_NAME, "visit(ASTTriggerUnit)");
    int npath = complexityMultipleOf(node, 1, data);
    DataPoint point = new DataPoint();
    point.setNode(node);
    point.setScore(1.0 * npath);
    point.setMessage(getMessage());
    addDataPoint(point);
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("NPath complexity:  " + npath + " for line " + node.getBeginLine() + ", column " + node.getBeginColumn());
    }
    LOGGER.exiting(CLASS_NAME, "visit(ASTTriggerUnit)", npath);
    return Integer.valueOf(npath);
}
Also used : DataPoint(net.sourceforge.pmd.stat.DataPoint) DataPoint(net.sourceforge.pmd.stat.DataPoint)

Aggregations

DataPoint (net.sourceforge.pmd.stat.DataPoint)21 TreeSet (java.util.TreeSet)2 PLSQLNode (net.sourceforge.pmd.lang.plsql.ast.PLSQLNode)2 ApexNode (net.sourceforge.pmd.lang.apex.ast.ApexNode)1 JavaNode (net.sourceforge.pmd.lang.java.ast.JavaNode)1 ASTGlobal (net.sourceforge.pmd.lang.plsql.ast.ASTGlobal)1 OracleObject (net.sourceforge.pmd.lang.plsql.ast.OracleObject)1 Metric (net.sourceforge.pmd.stat.Metric)1