Class CyclomaticComplexity


  • public class CyclomaticComplexity
    extends Property
    An analyzer for cyclomatic complexity
    Author:
    Ben Holland
    • Constructor Detail

      • CyclomaticComplexity

        public CyclomaticComplexity()
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from class: Analyzer
        Returns a name of the analyzer
        Overrides:
        getName in class Analyzer
        Returns:
      • getDescription

        public java.lang.String getDescription()
        Description copied from class: Analyzer
        Returns a short description of the analyzer
        Specified by:
        getDescription in class Analyzer
        Returns:
      • getAssumptions

        public java.lang.String[] getAssumptions()
        Description copied from class: Analyzer
        Returns an array of assumptions made when writing the analyzer
        Overrides:
        getAssumptions in class Analyzer
        Returns:
      • getResults

        public java.util.List<Analyzer.Result> getResults​(com.ensoftcorp.atlas.core.query.Q context)
        Description copied from class: Analyzer
        Return analyzer's labeled results Results are for results within a given context
        Specified by:
        getResults in class Analyzer
        Returns:
      • cyclomaticComplexity

        public static int cyclomaticComplexity​(com.ensoftcorp.atlas.core.db.graph.Node function,
                                               boolean includeExceptionControlFlows)
        Computes the cyclomatic complexity of a function as defined by https://en.wikipedia.org/wiki/Cyclomatic_complexity
        Parameters:
        function -
        includeExceptionControlFlows - If true exception control flow graph edges will be included in the result
        Returns: