Class RoutineAccess
- java.lang.Object
-
- com.hello2morrow.sonargraph.core.api.model.ElementAccess<com.hello2morrow.sonargraph.core.model.programming.ProgrammingElement>
-
- com.hello2morrow.sonargraph.core.api.model.ProgrammingElementAccess
-
- com.hello2morrow.sonargraph.core.api.model.RoutineAccess
-
- All Implemented Interfaces:
IElementAccess,INamedElementAccess,IProgrammingElementAccess,IRoutineAccess
- Direct Known Subclasses:
CppFunctionAccess,GenericFunctionAccess,MethodAccess,PythonFunctionAccess
public class RoutineAccess extends ProgrammingElementAccess implements IRoutineAccess
Access object for routines, i.e. functions (C/C++) and member functions (methods)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.hello2morrow.sonargraph.core.api.model.ElementAccess
ElementAccess.IAccessFactory
-
Nested classes/interfaces inherited from interface com.hello2morrow.sonargraph.api.model.INamedElementAccess
INamedElementAccess.INamedElementAccessVisitor
-
Nested classes/interfaces inherited from interface com.hello2morrow.sonargraph.api.model.IProgrammingElementAccess
IProgrammingElementAccess.IVisitor
-
Nested classes/interfaces inherited from interface com.hello2morrow.sonargraph.api.model.IRoutineAccess
IRoutineAccess.IVisitor
-
-
Constructor Summary
Constructors Constructor Description RoutineAccess(com.hello2morrow.sonargraph.core.model.programming.IRoutine element)Internal use only
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(INamedElementAccess.INamedElementAccessVisitor visitor)InternalintgetCyclomaticComplexityMetric()Get the cyclomatic complexity number for this routine.intgetExtendedCyclomaticComplexityMetric()Get the extended cyclomatic complexity number for this routine.intgetMaxNesting()Get the deepest block nesting within the routine body - often used as a good complexity indicatorjava.lang.ObjectgetMetricLevel()Internal use onlyintgetModifiedCyclomaticComplexityMetric()Get the modified cyclomatic complexity number for this routine.intgetModifiedExtendedCyclomaticComplexityMetric()Get the modified extended cyclomatic complexity number for this routine.intgetNumberOfParametersMetric()Return the number of parameters of this routine.intgetNumberOfStatementsMetric()Return the number of statements in this routine.java.util.List<java.lang.String>getParameterTypes()Return a list of fully qualified parameter types.java.lang.StringgetReturnType()Return the fully qualified name of the return type.-
Methods inherited from class com.hello2morrow.sonargraph.core.api.model.ProgrammingElementAccess
getDirectory, getIncomingDependencies, getIncomingDependencies, getIncomingDependenciesRecursively, getIncomingDependenciesRecursively, getLineNumber, getModule, getModuleNamespace, getOutgoingDependencies, getOutgoingDependencies, getOutgoingDependencies, getOutgoingDependenciesRecursively, getOutgoingDependenciesRecursively, getOutgoingDependenciesRecursively, getReferencedElements, getReferencedElements, getReferencedElements, getReferencedElementsRecursively, getReferencedElementsRecursively, getReferencedElementsRecursively, getReferencingElements, getReferencingElements, getReferencingElementsRecursively, getReferencingElementsRecursively, getRootDirectory, getSourceFile, getSystemNamespace, isDefinedInEnclosingElement
-
Methods inherited from class com.hello2morrow.sonargraph.core.api.model.ElementAccess
equals, getChildren, getElement, getFullyQualifiedName, getIssueCount, getName, getNameWithSignature, getParent, getParent, getShortName, getShortNameWithSignature, hashCode, ignoreIssues, isExcluded, isExternal, setFactory, toString
-
Methods inherited from interface com.hello2morrow.sonargraph.api.model.IElementAccess
getName, getNameWithSignature, getShortName, getShortNameWithSignature, ignoreIssues, isExcluded, isExternal
-
Methods inherited from interface com.hello2morrow.sonargraph.api.model.INamedElementAccess
getChildren, getFullyQualifiedName, getIncomingDependenciesRecursively, getIncomingDependenciesRecursively, getIssueCount, getIssueCount, getOutgoingDependenciesRecursively, getOutgoingDependenciesRecursively, getOutgoingDependenciesRecursively, getParent, getParent, getReferencedElementsRecursively, getReferencedElementsRecursively, getReferencedElementsRecursively, getReferencingElementsRecursively, getReferencingElementsRecursively
-
Methods inherited from interface com.hello2morrow.sonargraph.api.model.IProgrammingElementAccess
getDirectory, getIncomingDependencies, getIncomingDependencies, getLineNumber, getModule, getModuleNamespace, getOutgoingDependencies, getOutgoingDependencies, getOutgoingDependencies, getReferencedElements, getReferencedElements, getReferencedElements, getReferencingElements, getReferencingElements, getRootDirectory, getSourceFile, getSystemNamespace, isDefinedInEnclosingElement
-
-
-
-
Method Detail
-
getMetricLevel
public java.lang.Object getMetricLevel()
Description copied from class:ElementAccessInternal use only- Overrides:
getMetricLevelin classProgrammingElementAccess
-
getReturnType
public java.lang.String getReturnType()
Return the fully qualified name of the return type.- Returns:
- fully qualified return type
-
getParameterTypes
public java.util.List<java.lang.String> getParameterTypes()
Return a list of fully qualified parameter types.- Returns:
- List of fully qualified parameter types.
-
getNumberOfParametersMetric
public int getNumberOfParametersMetric()
Return the number of parameters of this routine.- Specified by:
getNumberOfParametersMetricin interfaceIRoutineAccess- Returns:
- see above
-
getNumberOfStatementsMetric
public int getNumberOfStatementsMetric()
Return the number of statements in this routine. Will return zero for routines without a body.- Specified by:
getNumberOfStatementsMetricin interfaceIRoutineAccess- Returns:
- see above
-
getCyclomaticComplexityMetric
public int getCyclomaticComplexityMetric()
Get the cyclomatic complexity number for this routine. (Thomas McCabe)- Specified by:
getCyclomaticComplexityMetricin interfaceIRoutineAccess- Returns:
- see above
-
getExtendedCyclomaticComplexityMetric
public int getExtendedCyclomaticComplexityMetric()
Get the extended cyclomatic complexity number for this routine. This will also add 1 for each '||' and '&&' operator (Thomas McCabe)- Specified by:
getExtendedCyclomaticComplexityMetricin interfaceIRoutineAccess- Returns:
- see above
-
getModifiedExtendedCyclomaticComplexityMetric
public int getModifiedExtendedCyclomaticComplexityMetric()
Get the modified extended cyclomatic complexity number for this routine. (Thomas McCabe)- Specified by:
getModifiedExtendedCyclomaticComplexityMetricin interfaceIRoutineAccess- Returns:
- see above
- See Also:
getExtendedCyclomaticComplexityMetric(),getModifiedCyclomaticComplexityMetric()
-
getModifiedCyclomaticComplexityMetric
public int getModifiedCyclomaticComplexityMetric()
Get the modified cyclomatic complexity number for this routine. This only adds 1 for switch statements, ignoring the number of 'case' labels (Thomas McCabe)- Specified by:
getModifiedCyclomaticComplexityMetricin interfaceIRoutineAccess- Returns:
- see above
-
getMaxNesting
public int getMaxNesting()
Get the deepest block nesting within the routine body - often used as a good complexity indicator- Specified by:
getMaxNestingin interfaceIRoutineAccess- Returns:
- see above
-
accept
public void accept(INamedElementAccess.INamedElementAccessVisitor visitor)
Internal- Specified by:
acceptin interfaceINamedElementAccess- Overrides:
acceptin classProgrammingElementAccess- Parameters:
visitor- The visitor implementation
-
-