facebookresearch / KILT
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 163 units with 2,775 lines of code in units (70.8% of code).
    • 2 very long units (245 lines of code)
    • 11 long units (694 lines of code)
    • 30 medium size units (944 lines of code)
    • 28 small units (405 lines of code)
    • 92 very small units (487 lines of code)
8% | 25% | 34% | 14% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 25% | 34% | 14% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kilt/datasets29% | 33% | 10% | 11% | 14%
kilt0% | 27% | 27% | 21% | 23%
kilt/readers/t50% | 16% | 53% | 14% | 15%
scripts0% | 47% | 25% | 8% | 17%
kilt/retrievers0% | 0% | 65% | 14% | 20%
kilt/readers/fid0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def process_chunk()
in kilt/datasets/natural_questions.py
140 21 4
def process_chunk()
in kilt/datasets/hotpotqa.py
105 18 4
def process_chunk()
in kilt/datasets/fact_verification.py
79 13 4
def process_chunk()
in kilt/datasets/triviaqa.py
76 12 4
def _calculate_metrics()
in kilt/eval_downstream.py
75 8 2
def process_chunk()
in kilt/datasets/entity_linking.py
66 13 4
def get_chunks()
in kilt/datasets/fact_verification.py
64 21 2
def run_generate()
in kilt/readers/t5/evaluate_kilt_task.py
60 6 0
def get_rank()
in kilt/eval_retrieval.py
57 24 5
def main()
in scripts/execute_retrieval.py
57 12 1
def add_model_specific_args()
in kilt/readers/t5/base_transformer.py
56 1 2
def compute()
in kilt/eval_retrieval.py
52 14 4
def run_thread()
in scripts/create_kilt_data_paragraphs.py
52 21 1
def run()
in kilt/retrievers/BLINK_connector.py
47 9 1
def validate_datapoint()
in kilt/kilt_utils.py
45 19 2
def encode_seq()
in kilt/readers/t5/data.py
44 14 9
def __init__()
in kilt/retrievers/DPR_connector.py
43 6 3
def add_generic_args()
in kilt/readers/t5/base_transformer.py
42 1 1
def generic_train()
in kilt/readers/t5/base_transformer.py
41 8 2
def get_ranking_metrics()
in kilt/eval_retrieval.py
37 14 4