microsoft / tensorwatch
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 673 units with 5,893 lines of code in units (89.4% of code).
    • 0 very long units (0 lines of code)
    • 7 long units (449 lines of code)
    • 57 medium size units (1,587 lines of code)
    • 98 small units (1,387 lines of code)
    • 511 very small units (2,470 lines of code)
0% | 7% | 26% | 23% | 41%
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% | 26% | 23% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorwatch/saliency0% | 18% | 25% | 25% | 30%
tensorwatch/model_graph/hiddenlayer0% | 5% | 31% | 22% | 40%
tensorwatch/mpl0% | 14% | 45% | 20% | 20%
tensorwatch/plotly0% | 23% | 29% | 18% | 28%
tensorwatch/model_graph/torchstat0% | 9% | 11% | 35% | 43%
tensorwatch/saliency/lime0% | 16% | 56% | 10% | 15%
tensorwatch0% | 0% | 20% | 21% | 57%
tensorwatch/model_graph0% | 0% | 0% | 77% | 22%
tensorwatch/embeddings0% | 0% | 0% | 70% | 30%
tensorwatch/receptive_field0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in tensorwatch/model_graph/hiddenlayer/summary_graph.py
83 13 4
def conv_nd_inverse()
in tensorwatch/saliency/inverter_util.py
78 24 3
def _show_stream_items()
in tensorwatch/mpl/line_plot.py
62 21 3
def _show_stream_items()
in tensorwatch/plotly/line_plot.py
61 22 3
def linear_inverse()
in tensorwatch/saliency/inverter_util.py
58 21 3
def report_format()
in tensorwatch/model_graph/torchstat/reporter.py
56 5 1
def explain_instance()
in tensorwatch/saliency/lime/lime_image.py
51 9 4
def build_dot()
in tensorwatch/model_graph/hiddenlayer/graph.py
47 14 2
def _show_stream_items()
in tensorwatch/mpl/image_plot.py
45 16 3
def init_stream_plot()
in tensorwatch/mpl/line_plot.py
42 17 11
def _show_stream_items()
in tensorwatch/mpl/bar_plot.py
41 19 3
def innvestigate()
in tensorwatch/saliency/epsilon_lrp.py
41 14 3
def make_dot()
in tensorwatch/model_graph/hiddenlayer/pytorch_builder_grad.py
37 11 3
def feature_selection()
in tensorwatch/saliency/lime/lime_base.py
35 10 6
def _create_stream_by_string()
in tensorwatch/stream_factory.py
35 16 3
def match()
in tensorwatch/model_graph/hiddenlayer/ge.py
34 15 3
def explain_instance_with_data()
in tensorwatch/saliency/lime/lime_base.py
33 3 8
def import_graph()
in tensorwatch/model_graph/hiddenlayer/pytorch_builder.py
32 19 5
def read_pfm()
in tensorwatch/utils.py
32 6 1
def create_stream()
in tensorwatch/watcher_base.py
32 16 7