facebookresearch / svinfer
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 84 units with 613 lines of code in units (83.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (95 lines of code)
    • 18 small units (264 lines of code)
    • 63 very small units (254 lines of code)
0% | 0% | 15% | 43% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 15% | 43% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
svinfer/processor0% | 0% | 24% | 19% | 56%
svinfer/linear_model0% | 0% | 8% | 65% | 25%
svinfer/summary_statistics0% | 0% | 0% | 72% | 27%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_result()
in svinfer/processor/matrix.py
46 11 2
def prepare_xy()
in svinfer/processor/commons.py
28 8 4
def simulate_distribution()
in svinfer/linear_model/linear_regression.py
21 6 1
def _get_coefficients()
in svinfer/linear_model/logistic_regression.py
20 2 4
def _score()
in svinfer/linear_model/logistic_regression.py
19 1 5
def fit()
in svinfer/linear_model/linear_regression.py
18 1 2
def _preprocess_data()
in svinfer/summary_statistics/summary_statistics.py
18 2 2
def __init__()
in svinfer/linear_model/linear_regression.py
17 5 7
def estimate_residual_var()
in svinfer/linear_model/linear_regression.py
17 6 1
def fit()
in svinfer/linear_model/logistic_regression.py
16 2 2
def estimate_summary_statistics()
in svinfer/summary_statistics/summary_statistics.py
16 4 2
def simulate_beta_vcov()
in svinfer/linear_model/linear_regression.py
15 2 1
def _preprocess_data()
in svinfer/linear_model/linear_regression.py
13 1 2
def estimate_summary_statistics()
in svinfer/summary_statistics/summary_statistics.py
13 2 2
def __init__()
in svinfer/processor/matrix.py
12 3 3
def __add__()
in svinfer/processor/matrix.py
12 7 2
def __mul__()
in svinfer/processor/matrix.py
12 7 2
def __truediv__()
in svinfer/processor/matrix.py
12 7 2
def __rtruediv__()
in svinfer/processor/matrix.py
12 7 2
def estimate_beta()
in svinfer/linear_model/linear_regression.py
11 4 1