use of org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Altstep in project titan.EclipsePlug-ins by eclipse.
the class AMLinesOfCode method measure.
@Override
public Number measure(final MetricData data, final Def_Altstep altstep) {
final Counter count = new Counter(0);
altstep.accept(new CounterVisitor(count) {
@Override
public int visit(final IVisitableNode node) {
if (node instanceof Def_Altstep) {
return V_CONTINUE;
}
if (node instanceof StatementBlock) {
count.set(((LargeLocation) ((StatementBlock) node).getLocation()).getEndLine());
}
return V_SKIP;
}
});
return count.val() - altstep.getLocation().getLine() + 1;
}
Aggregations