use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class FMLinesOfCode method measure.
@Override
public Number measure(final MetricData data, final Def_Function function) {
final Counter count = new Counter(0);
function.accept(new CounterVisitor(count) {
@Override
public int visit(final IVisitableNode node) {
if (node instanceof Def_Function) {
return V_CONTINUE;
} else if (node instanceof StatementBlock) {
count.set(((LargeLocation) ((StatementBlock) node).getLocation()).getEndLine());
}
return V_SKIP;
}
});
return count.val() - function.getLocation().getLine() + 1;
}
use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class FMNesting method measure.
@Override
public Number measure(final MetricData data, final Def_Function function) {
final Counter count = new Counter(0);
function.accept(new DepthVisitor(count));
return count.val();
}
use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class FMReturnPoints method measure.
@Override
public Number measure(final MetricData data, final Def_Function function) {
final Counter count = new Counter(0);
function.accept(new ReturnPointVisitor(count));
return count.val();
}
use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class MMInEnvy method measure.
@Override
public Number measure(final MetricData data, final Module module) {
final Counter innerReferences = new Counter(0);
final InternalFeatureEnvyDetector detector = new InternalFeatureEnvyDetector(module, innerReferences);
module.accept(detector);
return innerReferences.val();
}
use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class AMCyclomaticComplexity method measure.
@Override
public Number measure(final MetricData data, final Def_Altstep altstep) {
final Counter count = new Counter(0);
altstep.accept(new CCVisitor(count));
return count.val();
}
Aggregations