apple / ml-knowledge-conflicts
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 63 units with 543 lines of code in units (54.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (155 lines of code)
    • 10 small units (139 lines of code)
    • 47 very small units (249 lines of code)
0% | 0% | 28% | 25% | 45%
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% | 28% | 25% | 45%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 46% | 17% | 36%
src/classes0% | 0% | 0% | 39% | 60%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def extract_entity_information()
in src/extract_wikidata_info.py
36 7 3
def main()
in src/extract_wikidata_info.py
26 1 0
def sub_fn()
in src/substitution_fns.py
24 7 1
def sub_fn()
in src/substitution_fns.py
24 3 1
def sub_fn()
in src/substitution_fns.py
24 3 2
def sub_fn()
in src/substitution_fns.py
21 2 2
def read_original_dataset()
in src/classes/qadataset.py
17 3 2
def generate_substitutions()
in src/generate_substitutions.py
17 4 1
def json_dump()
in src/classes/qaexample.py
16 4 2
def _select_answer_type()
in src/classes/answer.py
15 8 1
def run_ner_linking()
in src/utils.py
15 5 2
def create_new_example()
in src/substitution_fns.py
13 1 0
def __init__()
in src/classes/answer.py
12 1 0
def normalize_text()
in src/utils.py
12 3 1
def load()
in src/classes/qadataset.py
11 2 2
def json_load()
in src/classes/qaexample.py
11 2 2
def label_entities()
in src/classes/qadataset.py
10 8 3
def _report_dataset_stats()
in src/classes/qadataset.py
10 3 1
def new()
in src/classes/qadataset.py
9 2 3
def save()
in src/classes/qadataset.py
9 2 1