tensorflow / swift
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 125 units with 1,842 lines of code in units (64.3% of code).
    • 1 very complex units (259 lines of code)
    • 1 complex units (236 lines of code)
    • 5 medium complex units (171 lines of code)
    • 11 simple units (299 lines of code)
    • 107 very simple units (877 lines of code)
14% | 12% | 9% | 16% | 47%
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
swift14% | 12% | 9% | 16% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/SIL14% | 12% | 9% | 16% | 47%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func parseInstructionBody()
in Sources/SIL/SILParser.swift
259 56 1
func print()
in Sources/SIL/SILPrinter.swift
236 49 1
func naked()
in Sources/SIL/SILPrinter.swift
41 14 1
func print()
in Sources/SIL/SILPrinter.swift
31 14 1
func parseNakedType()
in Sources/SIL/SILParser.swift
47 12 0
func print()
in Sources/SIL/SILPrinter.swift
24 11 1
func print()
in Sources/SIL/SILPrinter.swift
28 11 1
func print()
in Sources/SIL/SILPrinter.swift
22 10 1
func printExpr()
in Sources/SIL/SExpr.swift
30 10 1
func parseInfoBlock()
in Sources/SIL/BitcodeParser.swift
42 8 1
func parse()
in Sources/SIL/BitcodeParser.swift
54 8 0
func parseExpr()
in Sources/SIL/SExpr.swift
23 8 0
func print()
in Sources/SIL/SILPrinter.swift
29 7 1
func parseInstructionDefs()
in Sources/SIL/SILParser.swift
17 7 0
func read()
in Sources/SIL/BitcodeParser.swift
21 7 1
func parseFieldType()
in Sources/SIL/BitcodeParser.swift
24 7 0
func parseGlobalName()
in Sources/SIL/SILParser.swift
10 6 0
func print()
in Sources/SIL/BitcodePrinter.swift
27 6 2
func print()
in Sources/SIL/SILPrinter.swift
12 5 1
func print()
in Sources/SIL/SILPrinter.swift
15 5 1