bazelbuild / rules_python
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 193 units with 2,042 lines of code in units (40.3% of code).
    • 2 very long units (329 lines of code)
    • 5 long units (314 lines of code)
    • 13 medium size units (360 lines of code)
    • 30 small units (413 lines of code)
    • 143 very small units (626 lines of code)
16% | 15% | 17% | 20% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go19% | 11% | 24% | 22% | 21%
py11% | 19% | 9% | 17% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
gazelle27% | 9% | 28% | 16% | 17%
tools37% | 24% | 9% | 0% | 28%
python/pip_install0% | 25% | 14% | 14% | 45%
gazelle/manifest0% | 32% | 13% | 44% | 9%
gazelle/pythonconfig0% | 0% | 10% | 36% | 52%
python/runfiles0% | 0% | 0% | 36% | 63%
gazelle/modules_mapping0% | 0% | 0% | 64% | 35%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in gazelle/generate.go
224 68 1
def parse_args()
in tools/wheelmaker.py
105 1 0
func()
in gazelle/configure.go
77 25 1
def main()
in tools/wheelmaker.py
69 20 0
def main()
in python/pip_install/extract_wheels/__init__.py
58 7 0
func main()
in gazelle/manifest/generate/generate.go
57 7 0
def main()
in python/pip_install/parse_requirements_to_bzl/extract_single_wheel/__init__.py
53 7 0
def parse_common_args()
in python/pip_install/extract_wheels/lib/arguments.py
38 1 1
func init()
in gazelle/std_modules.go
36 6 0
func init()
in gazelle/parser.go
34 6 0
func importSpecFromSrc()
in gazelle/resolve.go
31 6 3
func()
in gazelle/parser.go
30 6 1
def add_file()
in tools/wheelmaker.py
27 8 3
func()
in gazelle/resolve.go
25 5 1
func isStdModule()
in gazelle/std_modules.go
25 6 1
def __init__()
in python/pip_install/extract_wheels/lib/annotation.py
24 5 3
func()
in gazelle/target.go
23 7 1
func writeOutput()
in gazelle/manifest/generate/generate.go
23 5 4
func()
in gazelle/pythonconfig/types.go
23 5 1
func annotationsFromComments()
in gazelle/parser.go
21 6 1