facebookresearch / CausalMotifs
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 11 units with 457 lines of code in units (65.8% of code).
    • 2 very long units (270 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (112 lines of code)
    • 3 small units (47 lines of code)
    • 3 very small units (28 lines of code)
59% | 0% | 24% | 10% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py59% | 0% | 24% | 10% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT59% | 0% | 24% | 10% | 6%
Alternative Visuals
Longest Units
Top 11 longest units
Unit# linesMcCabe index# params
def _split_exposure_hajek_eht()
in causalPartition.py
143 60 13
def _split_exposure_hajek()
in causalPartition.py
127 15 14
40 16 8
def _split_exposure_validate()
in causalPartition.py
36 12 8
def split_exposure_hajek()
in causalPartition.py
36 4 10
def estimate_exposure_hajek()
in causalPartition.py
20 7 6
def _plot_tree()
in causalPartition.py
15 6 4
def _contain_zero()
in causalPartition.py
12 12 6
def __init__()
in causalPartition.py
10 1 5
def _hajek_se()
in causalPartition.py
10 2 4
def plot_tree()
in causalPartition.py
8 2 2