pytorch / tutorials
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 940 units with 7,789 lines of code in units (50.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (169 lines of code)
    • 14 medium complex units (705 lines of code)
    • 45 simple units (1,011 lines of code)
    • 879 very simple units (5,904 lines of code)
0% | 2% | 9% | 12% | 75%
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
js0% | 8% | 17% | 8% | 64%
py0% | 0% | 6% | 14% | 78%
cpp0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
_static0% | 8% | 18% | 8% | 64%
advanced_source0% | 0% | 42% | 8% | 49%
beginner_source0% | 0% | 3% | 15% | 80%
advanced_source/rpc_ddp_tutorial0% | 0% | 52% | 38% | 9%
intermediate_source0% | 0% | <1% | 16% | 82%
ROOT0% | 0% | 0% | 64% | 35%
beginner_source/nlp0% | 0% | 0% | 18% | 81%
beginner_source/introyt0% | 0% | 0% | 9% | 90%
beginner_source/former_torchies0% | 0% | 0% | 8% | 91%
recipes_source/recipes0% | 0% | 0% | 0% | 100%
prototype_source0% | 0% | 0% | 0% | 100%
advanced_source/transformer__timeseries_cpp_tutorial0% | 0% | 0% | 0% | 100%
beginner_source/basics0% | 0% | 0% | 0% | 100%
beginner_source/blitz0% | 0% | 0% | 0% | 100%
advanced_source/dispatcher0% | 0% | 0% | 0% | 100%
advanced_source/torch_script_custom_classes0% | 0% | 0% | 0% | 100%
beginner_source/hybrid_frontend0% | 0% | 0% | 0% | 100%
beginner_source/examples_nn0% | 0% | 0% | 0% | 100%
advanced_source/torch_script_custom_ops0% | 0% | 0% | 0% | 100%
beginner_source/examples_autograd0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function eq()
in _static/underscore-1.3.1.js
58 41 3
this.stemWord = function()
in _static/searchtools.js
111 29 1
def run_worker()
in advanced_source/ddp_pipeline.py
150 20 2
(function()()
in _static/underscore-1.3.1.js
102 20 1
performTermsSearch : function()
in _static/searchtools.js
60 19 4
query : function()
in _static/searchtools.js
64 16 1
performObjectSearch : function()
in _static/searchtools.js
53 15 2
def backtrack()
in intermediate_source/forced_alignment_with_torchaudio_tutorial.py
16 14 4
def main()
in _static/tv-training-code.py
28 14 0
function createCommentDiv()
in _static/websupport.js
26 14 1
def test()
in beginner_source/fgsm_tutorial.py
29 14 4
def run_worker()
in advanced_source/rpc_ddp_tutorial/main.py
46 12 2
function handleVote()
in _static/websupport.js
34 12 1
def train_model()
in beginner_source/transfer_learning_tutorial.py
43 12 5
def get_style_model_and_losses()
in advanced_source/neural_style_tutorial.py
38 11 7
var each = _.each = _.forEach = function()
in _static/underscore-1.3.1.js
16 11 3
def evaluateInput()
in beginner_source/chatbot_tutorial.py
12 10 4
def evaluateInput()
in beginner_source/deploy_seq2seq_hybrid_frontend_tutorial.py
12 10 2
def _run_trainer()
in advanced_source/rpc_ddp_tutorial/main.py
34 9 2
def optimize_model()
in intermediate_source/reinforcement_q_learning.py
23 9 0