tensorflow / lucid
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 442 units with 4,350 lines of code in units (64.1% of code).
    • 1 very long units (118 lines of code)
    • 5 long units (297 lines of code)
    • 40 medium size units (1,154 lines of code)
    • 91 small units (1,321 lines of code)
    • 305 very small units (1,460 lines of code)
2% | 6% | 26% | 30% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py2% | 6% | 26% | 30% | 33%
js0% | 0% | 30% | 12% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lucid/misc/io16% | 7% | 24% | 27% | 24%
lucid/scratch/pretty_graphs0% | 26% | 16% | 25% | 31%
lucid/modelzoo0% | 14% | 14% | 27% | 43%
lucid/scratch/rl_util0% | 15% | 36% | 15% | 32%
lucid/scratch/atlas_pipeline0% | 0% | 82% | 0% | 17%
lucid/misc/gl0% | 0% | 52% | 9% | 37%
lucid/optvis0% | 0% | 23% | 33% | 42%
lucid/misc/graph_analysis0% | 0% | 29% | 41% | 28%
lucid/misc0% | 0% | 30% | 40% | 28%
lucid/recipes0% | 0% | 43% | 44% | 12%
lucid/scratch/js0% | 0% | 30% | 12% | 57%
lucid/recipes/activation_atlas0% | 0% | 16% | 60% | 23%
lucid/optvis/overrides0% | 0% | 22% | 52% | 25%
lucid/optvis/param0% | 0% | 0% | 52% | 47%
lucid/scratch/scripts0% | 0% | 0% | 32% | 67%
lucid/scratch/web0% | 0% | 0% | 43% | 56%
lucid/scratch0% | 0% | 0% | 44% | 55%
lucid/modelzoo/other_models0% | 0% | 0% | 85% | 14%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def textured_mesh()
in lucid/misc/io/showing.py
118 1 3
def suggest_save_args()
in lucid/modelzoo/vision_base.py
67 23 1
def render_with_groups()
in lucid/scratch/pretty_graphs/format_graph.py
63 25 5
def parse_graph()
in lucid/scratch/pretty_graphs/format_graph.py
60 17 1
def vis_dataset()
in lucid/scratch/rl_util/nmf.py
55 8 6
def save()
in lucid/misc/io/saving.py
52 21 5
def summarize()
in lucid/scratch/atlas_pipeline/pipeline.py
47 11 4
def get_activations_iter()
in lucid/modelzoo/get_activations.py
43 7 8
def parse_structure()
in lucid/misc/graph_analysis/parse_overlay.py
43 12 1
def load_obj()
in lucid/misc/gl/meshutil.py
43 17 1
def __init__()
in lucid/misc/gl/glrenderer.py
41 1 2
def grid()
in lucid/scratch/atlas_pipeline/grid.py
39 7 3
def get_paths()
in lucid/scratch/rl_util/attribution.py
37 12 5
def sample_binary_image()
in lucid/misc/stimuli.py
36 13 5
def argmax_nd()
in lucid/scratch/rl_util/nmf.py
35 8 5
def clear_cnn()
in lucid/scratch/rl_util/arch.py
35 2 2
def multi_interpolation_basis()
in lucid/recipes/image_interpolation_params.py
33 11 4
def render_tile()
in lucid/scratch/atlas_pipeline/render_tile.py
33 4 8
function load()
in lucid/scratch/js/src/load.js
30 6 2
def load()
in lucid/misc/io/loading.py
30 8 4