aws-samples / aws-admartech-samples
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 169 units with 2,915 lines of code in units (72.3% of code).
    • 2 very long units (232 lines of code)
    • 7 long units (411 lines of code)
    • 38 medium size units (1,176 lines of code)
    • 44 small units (681 lines of code)
    • 78 very small units (415 lines of code)
7% | 14% | 40% | 23% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 14% | 40% | 23% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
notebooks/identity-graph/nepytune/visualizations27% | 15% | 35% | 17% | 5%
notebooks/identity-graph/nepytune/cli24% | 0% | 27% | 27% | 21%
notebooks/identity-graph/nepytune/usecase0% | 27% | 46% | 19% | 5%
notebooks/identity-graph/nepytune0% | 24% | 26% | 21% | 26%
notebooks/identity-graph/nepytune/benchmarks0% | 0% | 54% | 22% | 22%
notebooks/identity-graph/nepytune/edges0% | 0% | 39% | 54% | 6%
notebooks/identity-graph/nepytune/nodes0% | 0% | 21% | 38% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def show_venn_diagram()
in identity-resolution/notebooks/identity-graph/nepytune/visualizations/venn_diagram.py
124 8 2
def main()
in identity-resolution/notebooks/identity-graph/nepytune/cli/transform.py
108 10 1
def show()
in identity-resolution/notebooks/identity-graph/nepytune/visualizations/pie_chart.py
68 1 1
def _show_most_common_visited_webpages()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/purchase_path.py
64 11 3
def _show_session_stats()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/purchase_path.py
63 8 2
def scatters_by_label()
in identity-resolution/notebooks/identity-graph/nepytune/drawing.py
60 13 4
def draw_referenced_subgraph()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/similar_audience.py
53 12 4
def get_activity_of_early_adopters()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/purchase_path.py
52 1 4
def recommend_similar_audience()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/similar_audience.py
51 3 4
def _build_networkx_graph_single()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/purchase_path.py
46 7 3
def get_sibling_attrs()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/user_summary.py
46 2 2
def _build_networkx_graph()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/user_summary.py
45 11 2
def main()
in identity-resolution/notebooks/identity-graph/nepytune/cli/add.py
44 6 1
def generate_user_website_edges()
in identity-resolution/notebooks/identity-graph/nepytune/edges/user_website.py
43 5 2
def draw_referenced_subgraph()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/undecided_users.py
43 17 5
def create_graph_for_website_and_transient_nodes()
in identity-resolution/notebooks/identity-graph/nepytune/visualizations/network_graph.py
42 5 2
def drop()
in identity-resolution/notebooks/identity-graph/nepytune/benchmarks/drop_graph.py
41 3 1
def _get_subgraph()
in identity-resolution/notebooks/identity-graph/nepytune/usecase/user_summary.py
40 1 2
def edge_fetcher()
in identity-resolution/notebooks/identity-graph/nepytune/benchmarks/drop_graph.py
36 5 4
def vertex_fetcher()
in identity-resolution/notebooks/identity-graph/nepytune/benchmarks/drop_graph.py
36 5 4