aws-samples / churn-prediction-with-text-and-interpretability
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 34 units with 181 lines of code in units (24.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (48 lines of code)
    • 1 small units (15 lines of code)
    • 31 very small units (118 lines of code)
0% | 0% | 26% | 8% | 65%
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% | 26% | 8% | 65%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts0% | 0% | 26% | 8% | 65%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def prep_ablation()
in scripts/interpret.py
27 1 1
def train_xgb()
in scripts/interpret.py
21 3 0
def get_keywords()
in scripts/interpret.py
15 6 1
def forward()
in scripts/train.py
10 1 3
def map_to_orig_tok()
in scripts/interpret.py
8 3 2
def load_feature_names()
in scripts/preprocess.py
7 1 1
def __init__()
in scripts/train.py
6 1 3
def transform()
in scripts/preprocess.py
6 2 2
def train()
in scripts/train.py
5 1 0
def extract_features()
in scripts/preprocess.py
5 1 0
def save_feature_names()
in scripts/preprocess.py
5 1 0
def split_data()
in scripts/preprocess.py
4 1 0
def get_chats()
in scripts/interpret.py
4 1 0
def relevant_keywords_helper()
in scripts/interpret.py
4 1 0
def perform_ablation()
in scripts/interpret.py
4 1 0
def obtain_context()
in scripts/interpret.py
4 1 0
def test()
in scripts/train.py
3 1 0
def predict()
in scripts/train.py
3 1 0
def plot_pr_curve()
in scripts/train.py
3 1 0
def plot_roc_curve()
in scripts/train.py
3 1 0