bazelbuild / rules_python
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 193 units with 2,042 lines of code in units (40.3% of code).
    • 1 very complex units (224 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (176 lines of code)
    • 14 simple units (440 lines of code)
    • 174 very simple units (1,202 lines of code)
10% | 0% | 8% | 21% | 58%
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
go19% | 0% | 6% | 22% | 50%
py0% | 0% | 10% | 20% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
gazelle27% | 0% | 9% | 27% | 35%
tools0% | 0% | 24% | 9% | 66%
python/runfiles0% | 0% | 22% | 0% | 77%
python/pip_install0% | 0% | 2% | 27% | 70%
gazelle/manifest0% | 0% | 0% | 32% | 67%
gazelle/modules_mapping0% | 0% | 0% | 37% | 62%
gazelle/pythonconfig0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in gazelle/generate.go
224 68 1
func()
in gazelle/configure.go
77 25 1
def main()
in tools/wheelmaker.py
69 20 0
def Rlocation()
in python/runfiles/runfiles.py
19 11 2
def unzip()
in python/pip_install/extract_wheels/lib/wheel.py
11 11 2
def add_file()
in tools/wheelmaker.py
27 8 3
def main()
in python/pip_install/extract_wheels/__init__.py
58 7 0
def main()
in python/pip_install/parse_requirements_to_bzl/extract_single_wheel/__init__.py
53 7 0
func()
in gazelle/target.go
23 7 1
func main()
in gazelle/manifest/generate/generate.go
57 7 0
def dig_wheel()
in gazelle/modules_mapping/generator.py
17 7 2
def dependencies()
in python/pip_install/extract_wheels/lib/wheel.py
10 6 2
18 6 1
func init()
in gazelle/parser.go
34 6 0
func()
in gazelle/parser.go
30 6 1
func annotationsFromComments()
in gazelle/parser.go
21 6 1
func importSpecFromSrc()
in gazelle/resolve.go
31 6 3
func init()
in gazelle/std_modules.go
36 6 0
func isStdModule()
in gazelle/std_modules.go
25 6 1
def __init__()
in python/pip_install/extract_wheels/lib/annotation.py
24 5 3