use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class TMNesting method measure.
@Override
public Number measure(final MetricData data, final Def_Testcase testcase) {
final Counter count = new Counter(0);
testcase.accept(new DepthVisitor(count));
return count.val();
}
use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class FMOutEnvy method measure.
@Override
public Number measure(final MetricData data, final Def_Function function) {
final Counter count = new Counter(0);
final Module myModule = function.getMyScope().getModuleScope();
function.accept(new ExternalFeatureEnvyDetector(myModule, count));
return count.val();
}
use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class AMOutEnvy method measure.
@Override
public Number measure(final MetricData data, final Def_Altstep altstep) {
final Counter count = new Counter(0);
final Module myModule = altstep.getMyScope().getModuleScope();
altstep.accept(new ExternalFeatureEnvyDetector(myModule, count));
return count.val();
}
use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class FMCyclomaticComplexity method measure.
@Override
public Number measure(final MetricData data, final Def_Function function) {
final Counter count = new Counter(0);
function.accept(new CCVisitor(count));
return count.val();
}
use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.
the class FMDefaultActivations 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 Activate_Statement) {
count.inc();
} else if (node instanceof Activate_Referenced_Statement) {
count.inc();
} else if (node instanceof ActivateDereferedExpression) {
count.inc();
} else if (node instanceof ActivateExpression) {
count.inc();
}
return V_CONTINUE;
}
});
return count.val();
}
Aggregations