aws / amazon-braket-sdk-python
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 743 units with 3,430 lines of code in units (56.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 12 medium size units (353 lines of code)
    • 61 small units (871 lines of code)
    • 670 very small units (2,206 lines of code)
0% | 0% | 10% | 25% | 64%
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% | 10% | 25% | 64%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/braket/aws0% | 0% | 19% | 40% | 40%
src/braket/circuits0% | 0% | 4% | 17% | 78%
src/braket/tasks0% | 0% | 31% | 26% | 41%
src/braket/jobs0% | 0% | 8% | 33% | 58%
src/braket/devices0% | 0% | 0% | 0% | 100%
src/braket/annealing0% | 0% | 0% | 0% | 100%
src/braket0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _from_object_internal_computational_basis_sampling()
in src/braket/tasks/gate_model_quantum_task_result.py
50 5 2
def is_available()
in src/braket/aws/aws_device.py
47 17 1
def build_diagram()
in src/braket/circuits/ascii_circuit_diagram.py
34 9 1
def logs()
in src/braket/aws/aws_quantum_job.py
32 12 3
def retry_unsuccessful_tasks()
in src/braket/aws/aws_quantum_task_batch.py
28 11 1
def __init__()
in src/braket/aws/aws_session.py
28 8 5
def __init__()
in src/braket/circuits/quantum_operator.py
24 8 3
def sort_moments()
in src/braket/circuits/moments.py
24 13 1
def _create_annealing_device_params()
in src/braket/aws/aws_quantum_task.py
22 8 2
def log_stream()
in src/braket/jobs/logs.py
22 4 5
def _from_object()
in src/braket/tasks/annealing_quantum_task_result.py
21 2 2
def run_local_job()
in src/braket/jobs/local/local_job_container.py
21 3 3
def _get_session_and_initialize()
in src/braket/aws/aws_device.py
20 8 2
def create()
in src/braket/aws/aws_quantum_job.py
20 1 23
def _create_s3_bucket_if_it_does_not_exist()
in src/braket/aws/aws_session.py
20 2 3
def _get_log_streams_for_job()
in src/braket/jobs/metrics_data/cwl_metrics_fetcher.py
20 6 3
def calculate_unitary()
in src/braket/circuits/unitary_calculation.py
20 3 2
def _construct_topology_graph()
in src/braket/aws/aws_device.py
19 8 1
def add()
in src/braket/circuits/circuit.py
19 8 4
def _observable_from_ir_list_item()
in src/braket/circuits/observables.py
19 9 2