aws / amazon-braket-sdk-python
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 743 units with 3,430 lines of code in units (56.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (131 lines of code)
    • 22 simple units (386 lines of code)
    • 717 very simple units (2,913 lines of code)
0% | 0% | 3% | 11% | 84%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | 3% | 11% | 84%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/braket/aws0% | 0% | 13% | 16% | 70%
src/braket/circuits0% | 0% | 1% | 10% | 87%
src/braket/jobs0% | 0% | 0% | 7% | 92%
src/braket/tasks0% | 0% | 0% | 9% | 90%
src/braket/devices0% | 0% | 0% | 0% | 100%
src/braket/annealing0% | 0% | 0% | 0% | 100%
src/braket0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def is_available()
in src/braket/aws/aws_device.py
47 17 1
def sort_moments()
in src/braket/circuits/moments.py
24 13 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 validate_circuit_and_shots()
in src/braket/circuits/circuit_helpers.py
13 10 2
def results()
in src/braket/aws/aws_quantum_task_batch.py
15 9 4
def build_diagram()
in src/braket/circuits/ascii_circuit_diagram.py
34 9 1
def _observable_from_ir_list_item()
in src/braket/circuits/observables.py
19 9 2
def cast_result_types()
in src/braket/tasks/gate_model_quantum_task_result.py
11 8 1
def _get_session_and_initialize()
in src/braket/aws/aws_device.py
20 8 2
def _construct_topology_graph()
in src/braket/aws/aws_device.py
19 8 1
def result()
in src/braket/aws/aws_quantum_task.py
13 8 1
def _get_future()
in src/braket/aws/aws_quantum_task.py
15 8 1
def _create_annealing_device_params()
in src/braket/aws/aws_quantum_task.py
22 8 2
def __init__()
in src/braket/aws/aws_session.py
28 8 5
def check_noise_target_gates()
in src/braket/circuits/noise_helpers.py
16 8 2
def __init__()
in src/braket/circuits/quantum_operator.py
24 8 3
def add()
in src/braket/circuits/circuit.py
19 8 4
def multi_stream_iter()
in src/braket/jobs/logs.py
18 7 4
def __init__()
in src/braket/circuits/noises.py
16 7 3