facebookresearch / quip
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 41 units with 1,037 lines of code in units (81.4% of code).
    • 2 very long units (359 lines of code)
    • 1 long units (73 lines of code)
    • 11 medium size units (336 lines of code)
    • 13 small units (172 lines of code)
    • 14 very small units (97 lines of code)
34% | 7% | 32% | 16% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py34% | 7% | 32% | 16% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/hf82% | 0% | 8% | 7% | <1%
src16% | 10% | 39% | 20% | 13%
scripts0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in src/hf/run_ner.py
244 82 0
def main()
in src/run_sentiment.py
115 34 1
def run_prediction()
in src/biencoder_predict_qa.py
73 16 4
def main()
in src/run_paraphrase.py
45 6 1
def train_ft()
in src/run_paraphrase.py
40 4 7
def read_mrqa_all()
in src/biencoder_predict_qa.py
34 8 2
def main()
in src/biencoder_predict_qa.py
34 5 0
def read_data()
in src/run_paraphrase.py
32 13 4
def read_data()
in src/run_sentiment.py
29 9 3
def main()
in scripts/regenerate_paws_kshot.py
28 9 0
25 8 2
def load_few_shot_file()
in src/hf/run_ner.py
25 8 3
def forward()
in src/run_paraphrase.py
23 5 5
def featurize_dataset()
in src/run_paraphrase.py
21 6 3
def compute_similarity()
in src/run_paraphrase.py
17 6 3
def evaluate()
in src/run_paraphrase.py
17 4 3
def evaluate()
in src/run_sentiment.py
16 3 3
def read_squad()
in src/biencoder_predict_qa.py
16 5 3
def find_span()
in src/biencoder_predict_qa.py
14 4 3
def parse_args()
in src/run_paraphrase.py
13 1 1