GerritCodeReview / buck
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 2,850 units with 23,628 lines of code in units (69.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (110 lines of code)
    • 19 medium complex units (1,132 lines of code)
    • 110 simple units (3,851 lines of code)
    • 2,720 very simple units (18,535 lines of code)
0% | <1% | 4% | 16% | 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
py0% | 13% | 7% | 1% | 77%
java0% | 0% | 4% | 16% | 78%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/com/facebook/buck/command0% | 11% | 17% | 19% | 51%
src/com/facebook/buck/cli0% | 0% | 8% | 24% | 66%
src/com/facebook/buck/rules0% | 0% | 6% | 10% | 83%
src/com/facebook/buck/parser0% | 0% | 9% | 10% | 79%
src/com/facebook/buck/android0% | 0% | 2% | 16% | 80%
src/com/facebook/buck/java0% | 0% | 4% | 22% | 73%
plugin/src/com/facebook/buck0% | 0% | 6% | 13% | 80%
src/com/facebook/buck/json0% | 0% | 20% | 15% | 63%
src/com/facebook/buck/util0% | 0% | 0% | 9% | 90%
src/com/facebook/buck/shell0% | 0% | 0% | 18% | 81%
src/com/facebook/buck/parcelable0% | 0% | 0% | 25% | 74%
src/com/facebook/buck/junit0% | 0% | 0% | 24% | 75%
src/com/facebook/buck/zip0% | 0% | 0% | 15% | 84%
src/com/facebook/buck/graph0% | 0% | 0% | 28% | 71%
src/com/facebook/buck/event0% | 0% | 0% | 8% | 91%
src/com/facebook/buck/dalvik0% | 0% | 0% | 11% | 88%
src/com/facebook/buck/step0% | 0% | 0% | 2% | 97%
src/com/facebook/buck/model0% | 0% | 0% | 0% | 100%
src/com/facebook/buck/python0% | 0% | 0% | 0% | 100%
src/com/facebook/buck/httpserver0% | 0% | 0% | 0% | 100%
src/com/facebook/buck/timing0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def write_modules()
in src/com/facebook/buck/command/intellij.py
110 43 1
private Module createModuleForProjectConfig()
in src/com/facebook/buck/command/Project.java
108 19 1
private void walkRuleAndAdd()
in src/com/facebook/buck/command/Project.java
67 18 4
List filterDevices()
in src/com/facebook/buck/cli/AdbCommandRunner.java
59 17 3
private ResourceDirectoriesFromAapt addAaptPackageSteps()
in src/com/facebook/buck/android/AndroidBinaryRule.java
116 16 3
private int runTests()
in src/com/facebook/buck/cli/TestCommand.java
110 15 5
public BuildTarget parse()
in src/com/facebook/buck/parser/BuildTargetParser.java
58 15 2
private Object coerceToExpectedType()
in src/com/facebook/buck/rules/ParamInfo.java
39 14 2
def main()
in src/com/facebook/buck/parser/buck.py
27 14 0
static ImmutableSet getPathToSourceFolders()
in src/com/facebook/buck/cli/TestCommand.java
45 13 3
protected int buildWithClasspath()
in src/com/facebook/buck/java/JavacInMemoryStep.java
58 13 2
protected void initComponent()
in plugin/src/com/facebook/buck/plugin/intellij/ui/MessageTreeRenderer.java
62 12 7
public final ListenableFuture build()
in src/com/facebook/buck/rules/AbstractCachingBuildRule.java
97 12 1
private void printJsonForTargetsInternal()
in src/com/facebook/buck/cli/TargetsCommand.java
60 11 2
public boolean apply()
in src/com/facebook/buck/cli/TargetsCommand.java
22 11 1
protected boolean adbCall()
in src/com/facebook/buck/cli/AdbCommandRunner.java
54 11 4
public void set()
in src/com/facebook/buck/rules/ParamInfo.java
36 11 3
static Object toRawTypes()
in src/com/facebook/buck/json/BuildFileToJsonParser.java
36 11 1
private void appendTypeSignature()
in src/com/facebook/buck/java/abi/TypeSummary.java
45 11 2
def glob()
in src/com/facebook/buck/parser/buck.py
33 11 3