bazelbuild / bazel
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 31,620 units with 305,072 lines of code in units (62.1% of code).
    • 8 very complex units (1,684 lines of code)
    • 63 complex units (10,637 lines of code)
    • 525 medium complex units (35,515 lines of code)
    • 1,462 simple units (47,847 lines of code)
    • 29,562 very simple units (209,389 lines of code)
<1% | 3% | 11% | 15% | 68%
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% | 3% | 11% | 15% | 69%
cc0% | 11% | 19% | 26% | 42%
py0% | 7% | 18% | 18% | 55%
h0% | 0% | 11% | 17% | 71%
inc0% | 0% | 0% | 79% | 20%
m0% | 0% | 0% | 55% | 44%
c0% | 0% | 0% | 47% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/main<1% | 3% | 11% | 15% | 68%
src/tools<1% | 2% | 12% | 17% | 67%
src/java_tools0% | 1% | 5% | 9% | 82%
tools/android0% | 12% | 16% | 10% | 61%
tools/build_defs0% | 18% | 48% | 16% | 16%
tools/osx0% | 0% | 24% | 34% | 40%
tools/cpp0% | 0% | 40% | 18% | 40%
tools/objc0% | 0% | 27% | 6% | 66%
tools/aquery_differ0% | 0% | 27% | 6% | 65%
tools/j2objc0% | 0% | 10% | 54% | 35%
tools/python0% | 0% | 36% | 0% | 63%
tools/ctexplain0% | 0% | 0% | 27% | 72%
src0% | 0% | 0% | 44% | 55%
scripts0% | 0% | 0% | 16% | 83%
tools/java0% | 0% | 0% | 5% | 94%
tools/jdk0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public void visitInsn()
in src/tools/android/java/com/google/devtools/build/android/desugar/BytecodeTypeInference.java
245 108 1
static Object binaryOp()
in src/main/java/net/starlark/java/eval/EvalUtils.java
231 93 4
private String scanWord()
in src/main/java/com/google/devtools/build/lib/query2/engine/Lexer.java
28 73 0
private String scanIdentifier()
in src/main/java/net/starlark/java/syntax/Lexer.java
25 65 0
public CppLinkAction build()
in src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java
400 60 0
private void tokenize()
in src/main/java/net/starlark/java/syntax/Lexer.java
185 60 0
public static void init()
in src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java
359 54 3
public SkyValue compute()
in src/main/java/com/google/devtools/build/lib/skyframe/GlobFunction.java
211 51 2
bool OutputJar::AddJar()
in src/tools/singlejar/output_jar.cc
187 50 1
public BlazeCommandResult exec()
in src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
292 49 2
private void escapedStringLiteral()
in src/main/java/net/starlark/java/syntax/Lexer.java
140 48 2
public void beforeCommand()
in src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java
344 47 1
private BlazeCommandResult execExclusively()
in src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
286 47 10
int CreateJunction()
in src/main/native/windows/file.cc
246 45 3
public static FdoContext getFdoContext()
in src/main/java/com/google/devtools/build/lib/rules/cpp/FdoHelper.java
182 45 5
public LibraryToLink createLibraryLinkerInput()
in src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java
222 44 14
URLConnection connect()
in src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpConnector.java
126 43 2
private static void run()
in src/tools/android/java/com/google/devtools/build/android/r8/CompatDx.java
124 42 1
177 42 5
static void ParseCommandLine()
in src/main/tools/linux-sandbox-options.cc
148 42 1