apple / ml-cread
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 169 units with 2,599 lines of code in units (88.8% of code).
    • 0 very long units (0 lines of code)
    • 10 long units (637 lines of code)
    • 28 medium size units (856 lines of code)
    • 43 small units (642 lines of code)
    • 88 very small units (464 lines of code)
0% | 24% | 32% | 24% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 24% | 32% | 24% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
modeling/coval/conll0% | 42% | 28% | 18% | 10%
modeling0% | 27% | 36% | 22% | 14%
modeling/coval/arrau0% | 37% | 19% | 30% | 13%
modeling/utils0% | 11% | 46% | 30% | 11%
modeling/qr_eval/qr/rouge0% | 0% | 34% | 15% | 49%
modeling/coval/eval0% | 0% | 27% | 35% | 36%
modeling/qr_eval/qr/training0% | 0% | 0% | 44% | 55%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def extract_annotated_parse()
in modeling/coval/conll/reader.py
97 36 5
def get_doc_markables()
in modeling/coval/arrau/reader.py
76 23 7
def _create_examples()
in modeling/dataset.py
67 5 1
def train()
in modeling/main.py
65 3 3
def parse_key_file()
in modeling/coval/conll/util.py
60 16 1
def get_coref_infos()
in modeling/coval/conll/reader.py
58 9 7
def get_doc_mentions()
in modeling/coval/conll/reader.py
55 22 5
def get_args()
in modeling/utils/utils.py
55 1 0
def generate()
in modeling/model.py
53 1 5
def forward()
in modeling/model.py
51 11 19
50 2 4
def build_cluster()
in modeling/utils/coref_utils.py
45 7 4
def filter_links()
in modeling/utils/process_data.py
45 11 4
def run_one_epoch()
in modeling/main.py
44 3 6
def collate_fn()
in modeling/dataset.py
43 20 2
def get_coref_infos()
in modeling/coval/arrau/reader.py
39 7 6
def set_annotated_parse_trees()
in modeling/coval/conll/reader.py
39 22 6
def proc_coref_output()
in modeling/model.py
39 4 7
def extract_coref_annotation()
in modeling/coval/conll/reader.py
37 15 1
def remove_nested_coref_mentions()
in modeling/coval/conll/reader.py
34 14 3