apple / cups
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 112 units with 12,356 lines of code in units (3.9% of code).
    • 14 very complex units (7,353 lines of code)
    • 15 complex units (2,583 lines of code)
    • 16 medium complex units (1,258 lines of code)
    • 9 simple units (298 lines of code)
    • 58 very simple units (864 lines of code)
59% | 20% | 10% | 2% | 6%
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
c59% | 20% | 10% | 2% | 6%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
backend61% | 15% | 11% | 3% | 7%
systemv91% | 8% | 0% | 0% | 0%
cups50% | 20% | 17% | 2% | 8%
tools100% | 0% | 0% | 0% | 0%
scheduler38% | 45% | 0% | 4% | 11%
notifier0% | 100% | 0% | 0% | 0%
berkeley0% | 100% | 0% | 0% | 0%
cgi-bin0% | 0% | 83% | 0% | 16%
filter0% | 0% | 92% | 0% | 7%
vcnet0% | 0% | 64% | 0% | 35%
locale0% | 0% | 0% | 0% | 100%
ppdc0% | 0% | 0% | 0% | 100%
xcode0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static void cancel_job()
in backend/ipp.c
1447 405 6
static int check_constraints()
in systemv/cupstestppd.c
1249 386 4
1005 208 9
static int add_file()
in scheduler/ipp.c
461 124 4
288 121 4
533 107 3
static void check_dest()
in systemv/lpstat.c
394 92 4
static int lpd_command()
in backend/lpd.c
286 80 3
198 80 3
static void add_printer_filter()
in scheduler/cupsfilter.c
366 76 4
static void walk_cb()
in backend/testbackend.c
410 74 4
static int setpagedevice()
in cups/raster-interpret.c
266 69 3
static void utf16_to_utf8()
in backend/snmp-supplies.c
179 64 5
271 51 3
178 42 10
static void device_cb()
in systemv/lpinfo.c
201 42 7
337 40 9
149 40 2
static int show_jobs()
in berkeley/lpq.c
200 40 6
static int save_rss()
in notifier/rss.c
216 38 3