bazelbuild / intellij
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 7,675 units with 65,587 lines of code in units (62.5% of code).
    • 1 very complex units (75 lines of code)
    • 5 complex units (488 lines of code)
    • 55 medium complex units (3,201 lines of code)
    • 353 simple units (10,491 lines of code)
    • 7,261 very simple units (51,332 lines of code)
<1% | <1% | 4% | 15% | 78%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
java<1% | <1% | 4% | 16% | 78%
py0% | 37% | 0% | 13% | 48%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
base<1% | <1% | 4% | 13% | 80%
build_defs0% | 37% | 0% | 13% | 48%
javascript0% | 4% | 0% | 24% | 70%
aswb0% | 0% | 7% | 23% | 69%
java0% | 0% | 4% | 13% | 81%
cpp0% | 0% | 7% | 12% | 79%
plugin_dev0% | 0% | 17% | 14% | 68%
python0% | 0% | 6% | 24% | 68%
golang0% | 0% | 7% | 23% | 68%
skylark0% | 0% | 2% | 10% | 87%
common0% | 0% | 2% | 0% | 97%
clwb0% | 0% | 0% | 27% | 72%
aspect0% | 0% | 0% | 23% | 76%
scala0% | 0% | 0% | 13% | 86%
kotlin0% | 0% | 0% | 17% | 82%
testing0% | 0% | 0% | 2% | 97%
sdkcompat0% | 0% | 0% | 0% | 100%
dart0% | 0% | 0% | 0% | 100%
ijwb0% | 0% | 0% | 0% | 100%
terminal0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private String scanIdentifier()
in base/src/com/google/idea/blaze/base/lang/buildfile/lexer/BuildLexerBase.java
75 65 0
private void escapedStringLiteral()
in base/src/com/google/idea/blaze/base/lang/buildfile/lexer/BuildLexerBase.java
113 42 2
private void tokenize()
in base/src/com/google/idea/blaze/base/lang/buildfile/lexer/BuildLexerBase.java
131 41 0
def main()
in build_defs/stamp_plugin_xml.py
103 32 0
private void parseCompilerOptions()
in javascript/src/com/google/idea/blaze/typescript/BlazeTypeScriptConfig.java
102 30 1
private String scanInteger()
in base/src/com/google/idea/blaze/base/lang/buildfile/lexer/BuildLexerBase.java
39 28 0
public boolean equals()
in base/src/com/google/idea/blaze/base/ideinfo/TargetIdeInfo.java
31 25 1
private static TargetMapAndInterfaceState updateState()
in base/src/com/google/idea/blaze/base/sync/aspects/BlazeIdeInterfaceAspectsImpl.java
134 24 10
private void calculateJavaSourceDirectories()
in java/src/com/google/idea/blaze/java/sync/source/SourceDirectoryCalculator.java
116 23 7
public static TargetIdeInfo fromProto()
in base/src/com/google/idea/blaze/base/ideinfo/TargetIdeInfo.java
88 22 2
private static Pattern makePatternFromWildcard()
in base/src/com/google/idea/blaze/base/lang/buildfile/globbing/UnixGlob.java
41 21 1
private void reallyGlob()
in base/src/com/google/idea/blaze/base/lang/buildfile/globbing/UnixGlob.java
76 19 8
public static String validate()
in base/src/com/google/idea/blaze/base/model/primitives/TargetName.java
65 18 1
private void addTargetAsSource()
in java/src/com/google/idea/blaze/java/sync/importer/BlazeJavaWorkspaceImporter.java
74 18 3
static void setupResDirectoryChoices()
in aswb/src/com/google/idea/blaze/android/resources/actions/BlazeCreateResourceUtils.java
84 18 4
public final boolean executeTask()
in plugin_dev/src/com/google/idea/blaze/plugin/run/BuildPluginBeforeRunTaskProvider.java
142 17 4
private static String getTestFilterForNamedParameters()
in python/src/com/google/idea/blaze/python/run/producers/PyTestContextProvider.java
44 17 3
private static ExecutableInfo getExecutableToDebug()
in golang/src/com/google/idea/blaze/golang/run/BlazeGoRunConfigurationRunner.java
99 16 1
private void newlineOutsideExpression()
in base/src/com/google/idea/blaze/base/lang/buildfile/lexer/BuildLexerBase.java
54 16 0
private static String checkPatternForError()
in base/src/com/google/idea/blaze/base/lang/buildfile/validation/GlobPatternValidator.java
34 16 1