Class RoutineAccess

    • Constructor Detail

      • RoutineAccess

        public RoutineAccess​(com.hello2morrow.sonargraph.core.model.programming.IRoutine element)
        Internal use only
    • Method Detail

      • 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 interface IRoutineAccess
        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 interface IRoutineAccess
        Returns:
        see above
      • getCyclomaticComplexityMetric

        public int getCyclomaticComplexityMetric()
        Get the cyclomatic complexity number for this routine. (Thomas McCabe)
        Specified by:
        getCyclomaticComplexityMetric in interface IRoutineAccess
        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 interface IRoutineAccess
        Returns:
        see above
      • 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 interface IRoutineAccess
        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 interface IRoutineAccess
        Returns:
        see above