Beispiel #1
0
  public void calculate(InputStream is) {
    try {
      CompilationUnit cunit = JavaParser.parse(is);

      classInfo = new ClassInfoVisitor();
      classInfo.visit(cunit, null);

      visitor = new CCVisitor();
      visitor.visit(cunit, null);

    } catch (Throwable t) {
      throw new RuntimeException(t);
    }
  }
Beispiel #2
0
 public int cc(String method) {
   return visitor.getCc(method);
 }
Beispiel #3
0
 public int cc() {
   return visitor.getCc();
 }
Beispiel #4
0
 public double avgCc() {
   double avgCc = visitor.getAvgCc();
   if (Double.isNaN(avgCc)) avgCc = -1.0;
   return avgCc;
 }