aws-samples / aws-neptune-sagemaker-knowledge-graph-bert
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 24 units with 390 lines of code in units (86.3% of code).
    • 1 very long units (118 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (96 lines of code)
    • 5 small units (83 lines of code)
    • 15 very small units (93 lines of code)
30% | 0% | 24% | 21% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py30% | 0% | 24% | 21% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
code67% | 0% | 32% | 0% | 0%
code/source0% | 0% | 18% | 38% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in code/train.py
118 7 1
def convert_single_example()
in code/source/bert_preprocessing.py
40 11 4
def input_handler()
in code/inference.py
35 2 2
def output_handler()
in code/inference.py
21 5 2
def from_iob_to_io()
in code/source/sentence_preprocessing.py
19 7 1
def build_model()
in code/source/custom_layer.py
18 1 5
def convert_examples_to_features()
in code/source/bert_preprocessing.py
16 2 4
def create_sentences_out_of_dataframe()
in code/source/sentence_preprocessing.py
16 8 1
def map_split_preds_to_idx()
in code/source/postprocessing.py
14 4 2
def preds_to_dict_single()
in code/source/postprocessing.py
10 5 2
def y2label_for_report()
in code/source/postprocessing.py
10 3 4
def y2label()
in code/source/postprocessing.py
9 4 3
def split_and_duplicate_index()
in code/source/sentence_preprocessing.py
9 8 2
def create_tokenizer_from_hub_module()
in code/source/bert_preprocessing.py
8 1 1
def __init__()
in code/source/custom_layer.py
8 1 5
def call()
in code/source/custom_layer.py
8 2 2
def convert_text_to_examples()
in code/source/bert_preprocessing.py
7 2 2
def split()
in code/source/sentence_preprocessing.py
6 5 2
def __init__()
in code/source/bert_preprocessing.py
5 1 5
def compute_output_shape()
in code/source/custom_layer.py
5 2 2