apple / sourcekit-lsp
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 234 units with 3,082 lines of code in units (21.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 8 medium complex units (383 lines of code)
    • 14 simple units (472 lines of code)
    • 212 very simple units (2,227 lines of code)
0% | 0% | 12% | 15% | 72%
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
swift0% | 0% | 10% | 14% | 74%
py0% | 0% | 45% | 31% | 22%
cpp0% | 0% | 0% | 0% | 100%
c0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/SourceKitLSP0% | 0% | 11% | 14% | 73%
Utilities0% | 0% | 49% | 34% | 15%
Sources/LanguageServerProtocolJSONRPC0% | 0% | 57% | 29% | 13%
Sources/SKCore0% | 0% | 0% | 20% | 79%
Sources/SKTestSupport0% | 0% | 0% | 0% | 100%
Sources/SKSwiftPMWorkspace0% | 0% | 0% | 0% | 100%
Sources/sourcekit-lsp0% | 0% | 0% | 0% | 100%
Sources/LanguageServerProtocol0% | 0% | 0% | 0% | 100%
Sources/SourceKitD0% | 0% | 0% | 0% | 100%
Sources/SKSupport0% | 0% | 0% | 0% | 100%
Sources/CSKTestSupport0% | 0% | 0% | 0% | 100%
Sources/LSPLogging0% | 0% | 0% | 0% | 100%
Sources/LSPTestSupport0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func asCompletionItemKind()
in Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift
52 22 1
mutating func toMarkdown()
in Sources/SourceKitLSP/Swift/CommentXML.swift
85 21 1
func initialize()
in Sources/SourceKitLSP/SourceKitServer.swift
56 16 1
def handle_invocation()
in Utilities/build-script-helper.py
40 15 2
def get_swiftpm_options()
in Utilities/build-script-helper.py
35 13 1
func parseAndHandleMessages()
in Sources/LanguageServerProtocolJSONRPC/JSONRPCConnection.swift
56 12 1
func asSymbolKind()
in Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift
33 12 1
func asLspSymbolKind()
in Sources/SourceKitLSP/SourceKitServer.swift
26 11 0
def main()
in Utilities/build-script-helper.py
53 9 0
func cachedStatusOrRegisterForSettings()
in Sources/SKCore/BuildSystemManager.swift
29 7 2
func patching()
in Sources/SKCore/FileBuildSettings.swift
20 7 2
func retrieveQuickFixCodeActions()
in Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift
42 7 2
func parseTokens()
in Sources/SourceKitLSP/Swift/SyntaxHighlightingTokenParser.swift
30 7 3
func handle()
in Sources/LanguageServerProtocolJSONRPC/JSONRPCConnection.swift
29 6 1
func updateAndNotifyStatuses()
in Sources/SKCore/BuildSystemManager.swift
26 6 1
func toolchain()
in Sources/SourceKitLSP/SourceKitServer.swift
21 6 2
func registerCapabilities()
in Sources/SourceKitLSP/SourceKitServer.swift
32 6 3
func completionsFromSKDResponse()
in Sources/SourceKitLSP/Swift/CodeCompletion.swift
53 6 5
func update()
in Sources/SourceKitLSP/Swift/CodeCompletionSession.swift
25 6 5
func close()
in Sources/SourceKitLSP/Swift/CodeCompletionSession.swift
22 6 0