예제 #1
0
  @Override
  public Object visit(ASTMethodDeclaration node, Object data) {
    int npath = complexityMultipleOf(node, 1, data);

    DataPoint point = new DataPoint();
    point.setNode(node);
    point.setScore(1.0 * npath);
    point.setMessage(getMessage());
    addDataPoint(point);

    return Integer.valueOf(npath);
  }
예제 #2
0
  @Override
  public Object visit(ASTProgramUnit node, Object data) {
    LOGGER.entering(CLASS_NAME, "visit(ASTProgramUnit)");
    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(ASTProgramUnit)", npath);
    return Integer.valueOf(npath);
  }