aws-samples / amazon-braket-community-detection
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 21 units with 277 lines of code in units (88.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (85 lines of code)
    • 9 small units (128 lines of code)
    • 9 very small units (64 lines of code)
0% | 0% | 30% | 46% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 30% | 46% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 30% | 46% | 23%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run_community_detection()
in src/qbsolv_community.py
36 5 2
def create_random_graph()
in src/graph_community.py
25 8 6
def draw_graph_community()
in src/graph_community.py
24 10 6
def solve_hybrid()
in src/qbsolv_community.py
20 2 4
def qbsolv_response_to_community()
in src/qubo_community.py
20 9 3
def _save_results()
in src/qbsolv_community.py
15 5 4
def __init__()
in src/qbsolv_community.py
13 1 12
def qubo_matrix_community_sparse()
in src/qubo_community.py
13 10 3
def load_node_labels()
in src/graph_community.py
13 7 3
def _solve_single_graph()
in src/qbsolv_community.py
12 3 1
def solve_classical()
in src/qbsolv_community.py
11 1 2
def clean_graph_data()
in src/utils.py
11 5 2
def modularity_mx()
in src/qubo_community.py
10 5 1
def create_qubo_dict()
in src/qbsolv_community.py
9 2 3
def download_graphs()
in src/utils.py
9 3 2
def load_graph()
in src/graph_community.py
9 1 3
def __init__()
in src/qbsolv_community.py
7 1 7
def qpu_cost_warning()
in src/qbsolv_community.py
7 1 1
def draw_graph()
in src/graph_community.py
6 2 2
def _sort_nodes()
in src/graph_community.py
5 1 1