microsoft / graspologic
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 409 units with 3,779 lines of code in units (38.6% of code).
    • 1 very long units (128 lines of code)
    • 9 long units (660 lines of code)
    • 26 medium size units (740 lines of code)
    • 59 small units (834 lines of code)
    • 314 very small units (1,417 lines of code)
3% | 17% | 19% | 22% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 17% | 19% | 22% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
graspologic/layouts10% | 26% | 13% | 19% | 30%
graspologic/cluster0% | 52% | 21% | 11% | 14%
graspologic/embed0% | 19% | 26% | 21% | 32%
graspologic/plot0% | 0% | 49% | 26% | 24%
graspologic/align0% | 0% | 24% | 34% | 41%
graspologic/datasets0% | 0% | 87% | 0% | 12%
graspologic/pipeline0% | 0% | 15% | 7% | 77%
graspologic/models0% | 0% | 0% | 34% | 65%
graspologic/match0% | 0% | 0% | 62% | 37%
graspologic/nominate0% | 0% | 0% | 51% | 48%
graspologic/partition0% | 0% | 0% | 34% | 65%
graspologic/utils0% | 0% | 0% | 25% | 74%
graspologic/subgraph0% | 0% | 0% | 52% | 47%
graspologic/simulations0% | 0% | 0% | 0% | 100%
graspologic/preprocessing0% | 0% | 0% | 0% | 100%
graspologic0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _parser()
in graspologic/layouts/__main__.py
128 1 0
def layout_quad()
in graspologic/layouts/nooverlap/_quad_node.py
95 16 1
def fit()
in graspologic/cluster/autogmm.py
93 23 3
def _do_contraction_with_given_nodes()
in graspologic/layouts/nooverlap/_quad_node.py
88 15 2
def _do_contraction()
in graspologic/layouts/nooverlap/_quad_node.py
84 11 1
def _fit()
in graspologic/cluster/divisive_cluster.py
67 10 2
def fit()
in graspologic/cluster/gclust.py
67 13 3
def _reduce_dim()
in graspologic/embed/mase.py
57 13 2
55 10 2
def quad_stats()
in graspologic/layouts/nooverlap/_quad_node.py
54 10 1
def _common_edge_list_args()
in graspologic/layouts/__main__.py
49 1 1
def push_to_kids()
in graspologic/layouts/nooverlap/_quad_node.py
42 14 1
def fit()
in graspologic/embed/mds.py
38 8 3
def draw_colors()
in graspologic/plot/plot_matrix.py
36 8 6
def _cluster_and_decide()
in graspologic/cluster/divisive_cluster.py
34 8 2
def _render()
in graspologic/layouts/__main__.py
33 4 1
def matrixplot()
in graspologic/plot/plot_matrix.py
33 1 28
def fit()
in graspologic/align/seedless_procrustes.py
31 9 3
def fit()
in graspologic/cluster/kclust.py
31 6 3
def _check_sorting_kws()
in graspologic/plot/plot_matrix.py
29 6 7