facebookresearch / vizseq
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 248 units with 1,222 lines of code in units (28.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (191 lines of code)
    • 14 small units (194 lines of code)
    • 228 very small units (837 lines of code)
0% | 0% | 15% | 15% | 68%
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% | 15% | 14% | 69%
js0% | 0% | 0% | 77% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
vizseq/_data0% | 0% | 13% | 22% | 63%
vizseq/scorers0% | 0% | 13% | 11% | 75%
vizseq/ipynb0% | 0% | 41% | 12% | 45%
vizseq0% | 0% | 20% | 19% | 60%
vizseq/_view0% | 0% | 16% | 0% | 83%
vizseq/_visualizers0% | 0% | 0% | 53% | 46%
website/src0% | 0% | 0% | 77% | 22%
vizseq/_utils0% | 0% | 0% | 0% | 100%
vizseq/_aligners0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _get_wer()
in vizseq/scorers/_wer.py
47 18 2
def _get_data()
in vizseq/ipynb/fairseq_viz.py
35 13 2
def get()
in vizseq/server.py
33 2 1
def __init__()
in vizseq/_data/data_sources.py
30 11 3
def get_scores()
in vizseq/_view/web_view.py
25 8 1
def __init__()
in vizseq/_data/data_sources.py
21 9 2
def start_server()
in vizseq/server.py
18 1 3
def cached()
in vizseq/_data/data_sources.py
16 5 2
def _get_edit_distance()
in vizseq/scorers/_ter.py
15 7 2
def set_up()
in vizseq/scorers/laser.py
15 4 0
def tag_lang_pair()
in vizseq/_data/lang_tagger.py
15 8 3
function Feature()
in website/src/pages/index.js
14 2 3
def visualize()
in vizseq/_visualizers/dict_visualizer.py
14 5 3
def get_len()
in vizseq/_data/data_sources.py
14 8 3
def post()
in vizseq/server.py
13 2 1
def tokenize_line()
in vizseq/_data/tokenizers.py
13 6 3
def sentence_ter_one_ref()
in vizseq/scorers/_ter.py
12 3 2
def to_dict()
in vizseq/_data/stats.py
12 6 2
def get_len()
in vizseq/_data/data_sources.py
12 8 3
def view_examples()
in vizseq/ipynb/core.py
11 1 0