tensorflow / moonlight
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 311 units with 3,285 lines of code in units (71.5% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (195 lines of code)
    • 49 medium size units (1,441 lines of code)
    • 51 small units (717 lines of code)
    • 208 very small units (932 lines of code)
0% | 5% | 43% | 21% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 6% | 45% | 20% | 28%
js0% | 0% | 0% | 60% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
moonlight/glyphs0% | 14% | 51% | 14% | 19%
moonlight/training0% | 12% | 30% | 28% | 27%
moonlight/staves0% | 9% | 58% | 13% | 19%
moonlight/structure0% | 0% | 52% | 26% | 20%
moonlight/util0% | 0% | 71% | 19% | 9%
moonlight/conversions0% | 0% | 52% | 0% | 47%
moonlight/evaluation0% | 0% | 27% | 37% | 36%
moonlight/score0% | 0% | 20% | 10% | 69%
moonlight0% | 0% | 38% | 18% | 42%
moonlight/models0% | 0% | 25% | 51% | 22%
moonlight/vision0% | 0% | 35% | 13% | 50%
moonlight/tools0% | 0% | 0% | 63% | 36%
moonlight/pipeline0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in moonlight/glyphs/saved_classifier.py
75 11 6
def process()
in moonlight/training/generation/generation.py
65 12 2
def staves_interpolated_y()
in moonlight/staves/base.py
55 6 1
def __init__()
in moonlight/glyphs/knn.py
50 6 4
def apply()
in moonlight/structure/section_barlines.py
44 3 2
def knn_kmeans_model()
in moonlight/glyphs/knn_model.py
43 7 3
def true_segments_1d()
in moonlight/util/segments.py
43 8 5
def peaks()
in moonlight/util/segments.py
43 9 4
def remove_staves()
in moonlight/staves/removal.py
42 4 1
def train_kmeans()
in moonlight/training/clustering/staffline_patches_kmeans_pipeline.py
42 1 5
def compute()
in moonlight/structure/__init__.py
41 14 3
def main()
in moonlight/training/clustering/staffline_patches_kmeans_pipeline.py
40 4 1
def score_to_musicxml()
in moonlight/conversions/musicxml.py
37 16 1
def _estimate_staffline_distance()
in moonlight/staves/staffline_distance.py
35 5 2
def _projection_to_staves()
in moonlight/staves/projection.py
33 6 2
def __init__()
in moonlight/staves/staffline_extractor.py
33 4 5
def _data()
in moonlight/staves/hough.py
33 1 1
def _assign_barlines()
in moonlight/structure/barlines.py
33 16 2
def apply()
in moonlight/structure/stems.py
32 8 2
def __init__()
in moonlight/glyphs/neural.py
31 9 8