facebookresearch / loop_tool
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 283 units with 4,992 lines of code in units (60.8% of code).
    • 1 very complex units (215 lines of code)
    • 6 complex units (689 lines of code)
    • 20 medium complex units (1,207 lines of code)
    • 32 simple units (1,144 lines of code)
    • 224 very simple units (1,737 lines of code)
4% | 13% | 24% | 22% | 34%
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
cpp5% | 11% | 27% | 26% | 29%
py0% | 60% | 13% | 4% | 22%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/core7% | 13% | 23% | 26% | 28%
loop_tool_py0% | 93% | 0% | 0% | 6%
src/backends/cuda0% | 15% | 43% | 6% | 33%
src/frontends0% | 0% | 38% | 30% | 30%
ROOT0% | 0% | 36% | 12% | 50%
src/backends/cpu0% | 0% | 0% | 74% | 25%
include/loop_tool0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
std::vector unify()
in src/core/symbolic.cpp
215 54 1
def ui()
in loop_tool_py/ui.py
183 47 3
Expr Expr::simplify()
in src/core/symbolic.cpp
116 38 0
141 37 2
std::string gen_loop()
in src/backends/cuda/cuda.cpp
108 27 5
88 26 1
Expr differentiate()
in src/core/symbolic.cpp
53 26 2
40 24 2
82 24 1
IR::NodeRef TensorImpl::resolve()
in src/frontends/lazy.cpp
97 23 3
std::string gen_access()
in src/backends/cuda/cuda.cpp
69 22 6
104 21 2
81 20 2
49 19 1
std::string Expr::dump()
in src/core/symbolic.cpp
62 19 1
std::string IR::dump()
in src/core/ir.cpp
61 16 1
std::string gen_mem_decl()
in src/backends/cuda/cuda.cpp
59 16 5
std::string Compiler::gen_string()
in src/core/compile.cpp
68 15 2
Constraint isolate()
in src/core/symbolic.cpp
54 14 2
26 13 1