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 void
accept(INamedElementAccess.INamedElementAccessVisitor visitor)
Internalint
getCyclomaticComplexityMetric()
Get the cyclomatic complexity number for this routine.int
getExtendedCyclomaticComplexityMetric()
Get the extended cyclomatic complexity number for this routine.int
getMaxNesting()
Get the deepest block nesting within the routine body - often used as a good complexity indicatorjava.lang.Object
getMetricLevel()
Internal use onlyint
getModifiedCyclomaticComplexityMetric()
Get the modified cyclomatic complexity number for this routine.int
getModifiedExtendedCyclomaticComplexityMetric()
Get the modified extended cyclomatic complexity number for this routine.int
getNumberOfParametersMetric()
Return the number of parameters of this routine.int
getNumberOfStatementsMetric()
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.String
getReturnType()
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:ElementAccess
Internal use only- Overrides:
getMetricLevel
in 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:
getNumberOfParametersMetric
in 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:
getNumberOfStatementsMetric
in interfaceIRoutineAccess
- Returns:
- see above
-
getCyclomaticComplexityMetric
public int getCyclomaticComplexityMetric()
Get the cyclomatic complexity number for this routine. (Thomas McCabe)- Specified by:
getCyclomaticComplexityMetric
in 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:
getExtendedCyclomaticComplexityMetric
in interfaceIRoutineAccess
- Returns:
- see above
-
getModifiedExtendedCyclomaticComplexityMetric
public int getModifiedExtendedCyclomaticComplexityMetric()
Get the modified extended cyclomatic complexity number for this routine. (Thomas McCabe)- Specified by:
getModifiedExtendedCyclomaticComplexityMetric
in 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:
getModifiedCyclomaticComplexityMetric
in 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:
getMaxNesting
in interfaceIRoutineAccess
- Returns:
- see above
-
accept
public void accept(INamedElementAccess.INamedElementAccessVisitor visitor)
Internal- Specified by:
accept
in interfaceINamedElementAccess
- Overrides:
accept
in classProgrammingElementAccess
- Parameters:
visitor
- The visitor implementation
-
-