microsoft / QuantumKatas
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 131 units with 1,521 lines of code in units (47.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (38 lines of code)
    • 22 simple units (501 lines of code)
    • 108 very simple units (982 lines of code)
0% | 0% | 2% | 32% | 64%
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% | 4% | 31% | 64%
cs0% | 0% | 0% | 35% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tutorials/LinearAlgebra0% | 0% | 6% | 40% | 52%
utilities/Microsoft.Quantum.Katas0% | 0% | 0% | 58% | 41%
tutorials/ComplexArithmetic0% | 0% | 0% | 15% | 84%
utilities/DumpUnitary0% | 0% | 0% | 76% | 23%
utilities/Common0% | 0% | 0% | 26% | 73%
SimonsAlgorithm0% | 0% | 0% | 0% | 100%
PhaseEstimation0% | 0% | 0% | 0% | 100%
utilities/DumpUnitaryTest0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def gen_matrix_message()
in tutorials/LinearAlgebra/testing.py
38 11 2
def matrix_equal()
in tutorials/LinearAlgebra/testing.py
14 10 2
def format_row()
in tutorials/LinearAlgebra/testing.py
26 9 1
def is_matrix_unitary_test()
in tutorials/LinearAlgebra/testing.py
23 9 1
def row_reduce()
in tutorials/LinearAlgebra/testing.py
21 9 1
def gen_unitary_matrix()
in tutorials/LinearAlgebra/testing.py
20 8 1
def find_eigenvector_test()
in tutorials/LinearAlgebra/testing.py
22 7 1
public static void RunDumpUnitary()
in utilities/DumpUnitary/Driver.cs
43 7 3
public virtual bool Simulate()
in utilities/Microsoft.Quantum.Katas/CheckKataMagic.cs
43 7 3
public virtual bool Simulate()
in utilities/Microsoft.Quantum.Katas/KataMagic.cs
36 7 3
def assert_tuple()
in tutorials/ComplexArithmetic/testing.py
6 6 1
def modulus_test()
in tutorials/ComplexArithmetic/testing.py
17 6 1
def polar_mult_test()
in tutorials/ComplexArithmetic/testing.py
29 6 1
def is_matrix_unitary_ref()
in tutorials/LinearAlgebra/testing.py
10 6 1
def inner_prod_test()
in tutorials/LinearAlgebra/testing.py
19 6 1
def tensor_product_ref()
in tutorials/LinearAlgebra/testing.py
15 6 2
def determinant()
in tutorials/LinearAlgebra/testing.py
18 6 1
def gen_eigenmatrix()
in tutorials/LinearAlgebra/testing.py
16 6 1
def find_eigenvalue_test()
in tutorials/LinearAlgebra/testing.py
22 6 1
public void CountOperationCalls()
in utilities/Common/CounterSimulator.cs
25 6 2