awslabs / mxboard
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 90 units with 765 lines of code in units (47.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (59 lines of code)
    • 7 medium size units (196 lines of code)
    • 18 small units (244 lines of code)
    • 64 very small units (266 lines of code)
0% | 7% | 25% | 31% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 7% | 25% | 31% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
python/mxboard0% | 8% | 25% | 29% | 37%
tools0% | 0% | 32% | 64% | 3%
python0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def make_image_grid()
in python/mxboard/utils.py
59 27 8
def _get_nodes_from_symbol()
in python/mxboard/summary.py
46 21 1
def add_embedding()
in python/mxboard/writer.py
36 13 6
def audio_summary()
in python/mxboard/summary.py
25 4 3
def _prepare_image()
in python/mxboard/utils.py
24 10 4
def _compute_curve()
in python/mxboard/summary.py
23 3 4
def process_file()
in tools/license_header.py
21 7 3
def pr_curve_summary()
in python/mxboard/summary.py
21 3 5
def _add_embedding_config()
in python/mxboard/utils.py
20 4 4
def _get_license()
in tools/license_header.py
16 6 1
def _make_metadata_tsv()
in python/mxboard/utils.py
16 8 2
def __init__()
in python/mxboard/writer.py
16 3 6
def process_folder()
in tools/license_header.py
15 7 2
def __init__()
in python/mxboard/event_file_writer.py
14 3 6
def run()
in python/mxboard/event_file_writer.py
14 4 1
def add_summary()
in python/mxboard/writer.py
14 5 3
def _add_scalars()
in python/mxboard/writer.py
14 3 4
def _make_image()
in python/mxboard/summary.py
13 2 1
def _init_if_needed()
in python/mxboard/event_file_writer.py
12 3 1
def _save_embedding_tsv()
in python/mxboard/utils.py
12 5 2