Class CyclomaticComplexity
- java.lang.Object
-
- com.ensoftcorp.open.commons.analyzers.Analyzer
-
- com.ensoftcorp.open.commons.analyzers.Property
-
- com.ensoftcorp.open.commons.analyzers.CyclomaticComplexity
-
public class CyclomaticComplexity extends Property
An analyzer for cyclomatic complexity- Author:
- Ben Holland
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ensoftcorp.open.commons.analyzers.Analyzer
Analyzer.Result
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
RESULT_PREFIX
-
Constructor Summary
Constructors Constructor Description CyclomaticComplexity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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_complexityjava.lang.String[]
getAssumptions()
Returns an array of assumptions made when writing the analyzerjava.lang.String
getDescription()
Returns a short description of the analyzerjava.lang.String
getName()
Returns a name of the analyzerjava.util.Comparator<Analyzer.Result>
getResultOrder()
Sort results based on complexityjava.util.List<Analyzer.Result>
getResults(com.ensoftcorp.atlas.core.query.Q context)
Return analyzer's labeled results Results are for results within a given context-
Methods inherited from class com.ensoftcorp.open.commons.analyzers.Property
getCategory
-
Methods inherited from class com.ensoftcorp.open.commons.analyzers.Analyzer
equals, getAllResults, getCodemapStageDependencies, getMarkup, getMarkupKey, hashCode
-
-
-
-
Field Detail
-
RESULT_PREFIX
public static final java.lang.String RESULT_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:Analyzer
Returns a name of the analyzer
-
getDescription
public java.lang.String getDescription()
Description copied from class:Analyzer
Returns a short description of the analyzer- Specified by:
getDescription
in classAnalyzer
- 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 classAnalyzer
- 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 classAnalyzer
- 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:
-
getResultOrder
public java.util.Comparator<Analyzer.Result> getResultOrder()
Sort results based on complexity- Overrides:
getResultOrder
in classAnalyzer
- Returns:
-
-