Search in sources :

Example 6 with Counter

use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.

the class AMInEnvy 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 InternalFeatureEnvyDetector(myModule, count));
    return count.val();
}
Also used : Counter(org.eclipse.titanium.metrics.visitors.Counter) InternalFeatureEnvyDetector(org.eclipse.titanium.metrics.visitors.InternalFeatureEnvyDetector) Module(org.eclipse.titan.designer.AST.Module)

Example 7 with Counter

use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.

the class AMNesting method measure.

@Override
public Number measure(final MetricData data, final Def_Altstep altstep) {
    final Counter count = new Counter(0);
    altstep.accept(new DepthVisitor(count));
    return count.val();
}
Also used : Counter(org.eclipse.titanium.metrics.visitors.Counter) DepthVisitor(org.eclipse.titanium.metrics.visitors.DepthVisitor)

Example 8 with Counter

use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.

the class FMInEnvy 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 InternalFeatureEnvyDetector(myModule, count));
    return count.val();
}
Also used : Counter(org.eclipse.titanium.metrics.visitors.Counter) InternalFeatureEnvyDetector(org.eclipse.titanium.metrics.visitors.InternalFeatureEnvyDetector) Module(org.eclipse.titan.designer.AST.Module)

Example 9 with Counter

use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.

the class TMCyclomaticComplexity method measure.

@Override
public Number measure(final MetricData data, final Def_Testcase testcase) {
    final Counter count = new Counter(0);
    testcase.accept(new CCVisitor(count));
    return count.val();
}
Also used : Counter(org.eclipse.titanium.metrics.visitors.Counter) CCVisitor(org.eclipse.titanium.metrics.visitors.CCVisitor)

Example 10 with Counter

use of org.eclipse.titanium.metrics.visitors.Counter in project titan.EclipsePlug-ins by eclipse.

the class TMInEnvy method measure.

@Override
public Number measure(final MetricData data, final Def_Testcase testcase) {
    final Counter count = new Counter(0);
    final Module myModule = testcase.getMyScope().getModuleScope();
    testcase.accept(new InternalFeatureEnvyDetector(myModule, count));
    return count.val();
}
Also used : Counter(org.eclipse.titanium.metrics.visitors.Counter) InternalFeatureEnvyDetector(org.eclipse.titanium.metrics.visitors.InternalFeatureEnvyDetector) Module(org.eclipse.titan.designer.AST.Module)

Aggregations

Counter (org.eclipse.titanium.metrics.visitors.Counter)20 Module (org.eclipse.titan.designer.AST.Module)6 IVisitableNode (org.eclipse.titan.designer.AST.IVisitableNode)4 CounterVisitor (org.eclipse.titanium.metrics.visitors.CounterVisitor)4 ExternalFeatureEnvyDetector (org.eclipse.titanium.metrics.visitors.ExternalFeatureEnvyDetector)4 InternalFeatureEnvyDetector (org.eclipse.titanium.metrics.visitors.InternalFeatureEnvyDetector)4 StatementBlock (org.eclipse.titan.designer.AST.TTCN3.statements.StatementBlock)3 CCVisitor (org.eclipse.titanium.metrics.visitors.CCVisitor)3 DepthVisitor (org.eclipse.titanium.metrics.visitors.DepthVisitor)3 LargeLocation (org.eclipse.titan.designer.AST.LargeLocation)2 Def_Altstep (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Altstep)1 Def_Function (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Function)1 Def_Testcase (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Testcase)1 Activate_Referenced_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Activate_Referenced_Statement)1 Activate_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Activate_Statement)1 ActivateDereferedExpression (org.eclipse.titan.designer.AST.TTCN3.values.expressions.ActivateDereferedExpression)1 ActivateExpression (org.eclipse.titan.designer.AST.TTCN3.values.expressions.ActivateExpression)1 ReturnPointVisitor (org.eclipse.titanium.metrics.visitors.ReturnPointVisitor)1