microsoft / NeuronBlocks
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 601 units with 6,522 lines of code in units (81.2% of code).
    • 1 very complex units (86 lines of code)
    • 6 complex units (757 lines of code)
    • 35 medium complex units (1,487 lines of code)
    • 57 simple units (1,084 lines of code)
    • 502 very simple units (3,108 lines of code)
1% | 11% | 22% | 16% | 47%
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
py1% | 11% | 22% | 16% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT3% | 32% | 33% | 9% | 20%
block_zoo0% | 0% | 10% | 17% | 72%
model_visualizer0% | 0% | 93% | 0% | 6%
metrics0% | 0% | 33% | 29% | 36%
utils0% | 0% | 19% | 8% | 71%
core0% | 0% | 0% | 30% | 69%
tools0% | 0% | 0% | 91% | 8%
losses0% | 0% | 0% | 50% | 49%
dataset0% | 0% | 0% | 60% | 40%
autotest0% | 0% | 0% | 75% | 25%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
86 56 1
def check_conf()
in ModelConf.py
67 45 1
def train()
in LearningMachine.py
214 41 3
def predict()
in LearningMachine.py
104 38 5
def interactive()
in LearningMachine.py
86 31 5
def evaluate()
in LearningMachine.py
221 30 14
def __init__()
in Model.py
65 27 5
42 25 1
def main()
in train.py
78 25 1
def startOfChunk()
in metrics/conlleval.py
13 23 4
def countChunks()
in metrics/conlleval.py
49 23 4
53 22 6
def endOfChunk()
in metrics/conlleval.py
11 21 4
def build()
in problem.py
72 21 17
def load_embedding()
in utils/corpus_utils.py
38 21 6
42 20 1
def json2graph()
in model_visualizer/get_model_graph.py
99 20 2
def json2graph()
in model_visualizer/server/mv.py
96 20 1
def decode()
in problem.py
59 19 4
def prepare_dir()
in utils/common_utils.py
30 17 5