apple / ml-qrecc
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 30 units with 447 lines of code in units (64.1% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (125 lines of code)
    • 5 medium size units (129 lines of code)
    • 10 small units (139 lines of code)
    • 13 very small units (54 lines of code)
0% | 27% | 28% | 31% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 27% | 28% | 31% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
collection0% | 25% | 43% | 22% | 8%
utils0% | 33% | 0% | 47% | 19%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def download_link()
in collection/download_wayback_passages.py
74 9 1
def main()
in utils/evaluate_retrieval.py
51 5 3
def process_wet_file()
in collection/download_commoncrawl_passages.py
33 9 4
def main()
in collection/download_commoncrawl_passages.py
27 7 2
def get_docs_from_wet_files()
in collection/download_commoncrawl_passages.py
25 5 2
def process_cc_index()
in collection/download_commoncrawl_passages.py
23 7 1
def download_with_retry()
in collection/download_wayback_passages.py
21 7 2
def find_closest_span_match()
in utils/span_heuristic.py
19 6 2
18 5 2
def chunk_doc()
in collection/paragraph_chunker.py
17 5 1
def get_cc_index_paths()
in collection/download_commoncrawl_passages.py
13 3 0
def get_cc_wet_paths()
in collection/download_commoncrawl_passages.py
13 2 0
def chunk_documents()
in collection/paragraph_chunker.py
13 4 3
def process_file()
in collection/paragraph_chunker.py
12 3 3
def normalize_answer()
in utils/evaluate_qa.py
12 3 1
def compute_f1_from_tokens()
in utils/evaluate_qa.py
11 5 2
def compute_f1_for_retrieved_passage()
in utils/evaluate_retrieval.py
11 4 1
def sort_and_sample_filter_list()
in collection/download_commoncrawl_passages.py
10 4 1
def _normalize_tokens()
in utils/span_heuristic.py
9 6 2
def extract_text()
in collection/download_wayback_passages.py
8 3 1