facebookresearch / nle
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 1,070 units with 19,266 lines of code in units (6.0% of code).
    • 6 very complex units (2,296 lines of code)
    • 19 complex units (2,202 lines of code)
    • 68 medium complex units (3,589 lines of code)
    • 108 simple units (2,962 lines of code)
    • 869 very simple units (8,217 lines of code)
11% | 11% | 18% | 15% | 42%
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
c23% | 5% | 21% | 13% | 37%
cpp2% | 20% | 17% | 14% | 45%
py0% | 8% | 13% | 30% | 46%
pl0% | 0% | 0% | 23% | 76%
pm0% | 0% | 0% | 30% | 69%
js0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src44% | 6% | 12% | 10% | 25%
sys/wince30% | 0% | 10% | 5% | 53%
win/Qt3% | 15% | 20% | 15% | 44%
win/Qt40% | 26% | 14% | 12% | 46%
nle/agent0% | 35% | 0% | 6% | 58%
sys/vms0% | 32% | 40% | 7% | 19%
sys/amiga0% | 51% | 0% | 43% | 4%
sys/winnt0% | 0% | 55% | 18% | 26%
sys/share0% | 0% | 23% | 10% | 65%
nle/scripts0% | 0% | 25% | 45% | 29%
win/curses0% | 0% | 62% | 0% | 37%
win/X110% | 0% | 19% | 24% | 55%
win/win320% | 0% | 25% | 20% | 53%
nle/env0% | 0% | 5% | 27% | 66%
win/tty0% | 0% | 0% | 47% | 52%
DEVEL0% | 0% | 0% | 48% | 51%
DEVEL/hooksdir0% | 0% | 0% | 30% | 69%
sys/mac0% | 0% | 0% | 29% | 70%
nle/nethack0% | 0% | 0% | 27% | 72%
win/gem0% | 0% | 0% | 44% | 55%
sys/msdos0% | 0% | 0% | 5% | 94%
util0% | 0% | 0% | 0% | 100%
nle/dashboard0% | 0% | 0% | 0% | 100%
win/share0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
win/gnome0% | 0% | 0% | 0% | 100%
win/rl0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
1182 521 1
int FDECL()
in src/zap.c
238 121 1
help_requested ?()
in src/cmd.c
246 68 1
int __cdecl fscanf()
in sys/wince/celib.c
195 66 3
HUP raw_printf()
in src/files.c
273 61 2
char NetHackQtYnDialog::Exec()
in win/Qt/qt_win.cpp
162 56 0
114 47 5
78 46 6
char NetHackQtYnDialog::Exec()
in win/Qt4/qt4yndlg.cpp
161 45 0
184 43 6
133 41 0
149 36 0
103 35 2
void QtTableView::paintEvent()
in win/Qt/qttableview.cpp
114 33 1
void QtTableView::updateScrollBars()
in win/Qt/qttableview.cpp
68 33 1
131 33 1
120 32 1
79 30 4
122 28 1
81 28 0