pytorch / tnt
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 136 units with 1,221 lines of code in units (82.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (46 lines of code)
    • 9 simple units (201 lines of code)
    • 126 very simple units (974 lines of code)
0% | 0% | 3% | 16% | 79%
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% | 16% | 79%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
torchnet/meter0% | 0% | 14% | 25% | 60%
torchnet/logger0% | 0% | 0% | 23% | 76%
torchnet/dataset0% | 0% | 0% | 15% | 84%
torchnet0% | 0% | 0% | 44% | 55%
example0% | 0% | 0% | 0% | 100%
torchnet/utils0% | 0% | 0% | 0% | 100%
torchnet/engine0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def add()
in torchnet/meter/apmeter.py
46 14 4
def tablemergekeys()
in torchnet/transform.py
17 9 0
def __init__()
in torchnet/dataset/splitdataset.py
25 8 4
def value()
in torchnet/meter/apmeter.py
27 8 1
def print_meter()
in torchnet/logger/meterlogger.py
24 7 6
def _log_all()
in torchnet/logger/visdomlogger.py
20 7 6
def __getitem__()
in torchnet/dataset/tensordataset.py
8 7 2
def add()
in torchnet/meter/classerrormeter.py
24 7 3
def add()
in torchnet/meter/confusionmeter.py
30 7 3
def log()
in torchnet/logger/visdomlogger.py
26 6 3
def __addmeter()
in torchnet/logger/meterlogger.py
13 5 2
def __init__()
in torchnet/dataset/tensordataset.py
13 5 2
def __len__()
in torchnet/dataset/tensordataset.py
7 5 1
def canmergetensor()
in torchnet/utils/table.py
10 5 1
def __addlogger()
in torchnet/logger/meterlogger.py
23 4 3
def update_meter()
in torchnet/logger/meterlogger.py
11 4 4
def reset_meter()
in torchnet/logger/meterlogger.py
10 4 3
def _gather_outputs()
in torchnet/logger/visdomlogger.py
15 4 6
def __init__()
in torchnet/dataset/shuffledataset.py
9 4 4
def __init__()
in torchnet/dataset/transformdataset.py
9 4 3