awslabs / predictive-maintenance-using-machine-learning
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 8,697 units with 100,254 lines of code in units (79.9% of code).
    • 14 very complex units (2,941 lines of code)
    • 99 complex units (8,756 lines of code)
    • 620 medium complex units (23,835 lines of code)
    • 1,081 simple units (22,821 lines of code)
    • 6,883 very simple units (41,901 lines of code)
2% | 8% | 23% | 22% | 41%
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
py2% | 8% | 23% | 22% | 41%
c0% | 54% | 0% | 0% | 45%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/predictive_maintenance/numpy/f2py26% | 26% | 20% | 7% | 17%
source/predictive_maintenance/numpy/lib9% | 10% | 19% | 21% | 38%
source/predictive_maintenance/pandas/core<1% | 8% | 25% | 23% | 41%
source/predictive_maintenance/numpy/distutils3% | 2% | 25% | 28% | 40%
source/predictive_maintenance/pandas/io0% | 11% | 24% | 26% | 37%
source/predictive_maintenance/numpy/core0% | 12% | 23% | 20% | 44%
source/predictive_maintenance/pandas/plotting0% | 8% | 25% | 25% | 41%
source/predictive_maintenance/numpy/linalg0% | 12% | 8% | 30% | 49%
source/predictive_maintenance/numpy/testing0% | 4% | 18% | 26% | 50%
source/predictive_maintenance/numpy/ma0% | 0% | 22% | 26% | 50%
source/predictive_maintenance/numpy/polynomial0% | 0% | 25% | 16% | 57%
source/predictive_maintenance/pandas/util0% | 0% | 20% | 29% | 49%
source/predictive_maintenance/pandas/tseries0% | 0% | 21% | 21% | 57%
source/predictive_maintenance/pytz0% | 0% | 23% | 11% | 65%
source/predictive_maintenance/numpy0% | 0% | 31% | 6% | 61%
source/predictive_maintenance/numpy/matrixlib0% | 0% | 27% | 34% | 37%
source/predictive_maintenance/pandas/compat0% | 0% | 11% | 5% | 82%
source/predictive_maintenance/numpy/fft0% | 0% | 14% | 11% | 73%
source/predictive_maintenance/pandas0% | 0% | 10% | 0% | 89%
source/predictive_maintenance/numpy/compat0% | 0% | 0% | 20% | 79%
source/notebooks/sagemaker_predictive_maintenance0% | 0% | 0% | 51% | 48%
source/predictive_maintenance/numpy/random0% | 0% | 0% | 12% | 87%
source/notebooks/sagemaker_predictive_maintenance/sagemaker_predictive_maintenance_entry_point0% | 0% | 0% | 0% | 100%
source/predictive_maintenance0% | 0% | 0% | 0% | 100%
deployment/solution-assistant/src0% | 0% | 0% | 0% | 100%
source/predictive_maintenance/pandas/errors0% | 0% | 0% | 0% | 100%
source/predictive_maintenance/numpy/doc0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def analyzeline()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
527 178 3
def analyzevars()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
335 161 1
def genfromtxt()
in source/predictive_maintenance/numpy/lib/npyio.py
394 104 23
def _setitem_with_indexer()
in source/predictive_maintenance/pandas/core/indexing.py
212 76 3
def loadtxt()
in source/predictive_maintenance/numpy/lib/npyio.py
194 71 11
def updatevars()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
140 65 4
def _get_grouper()
in source/predictive_maintenance/pandas/core/groupby/grouper.py
127 63 8
def run_compile()
in source/predictive_maintenance/numpy/f2py/f2py2e.py
147 58 0
def getarrlen()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
143 55 3
def vars2fortran()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
114 55 5
def scaninputline()
in source/predictive_maintenance/numpy/f2py/f2py2e.py
138 55 1
def build_extension()
in source/predictive_maintenance/numpy/distutils/command/build_ext.py
161 53 2
def run()
in source/predictive_maintenance/numpy/distutils/command/build_ext.py
168 52 1
def pad()
in source/predictive_maintenance/numpy/lib/arraypad.py
141 51 4
def build_a_library()
in source/predictive_maintenance/numpy/distutils/command/build_clib.py
152 49 4
def _parse_einsum_input()
in source/predictive_maintenance/numpy/core/einsumfunc.py
114 49 1
def _do_init()
in source/predictive_maintenance/numpy/core/machar.py
186 48 6
def _aggregate()
in source/predictive_maintenance/pandas/core/base.py
124 48 4
def write_result()
in source/predictive_maintenance/pandas/io/formats/latex.py
99 48 2
def _clean_options()
in source/predictive_maintenance/pandas/io/parsers.py
124 48 3