apple / swift-distributed-actors
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 941 units with 7,636 lines of code in units (23.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 9 medium complex units (371 lines of code)
    • 30 simple units (829 lines of code)
    • 902 very simple units (6,436 lines of code)
0% | 0% | 4% | 10% | 84%
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% | 4% | 10% | 84%
c0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/DistributedActors0% | 0% | 4% | 11% | 83%
Sources/DistributedActorsBenchmarks0% | 0% | 22% | 0% | 77%
Sources/DistributedActorsGenerator0% | 0% | 0% | 24% | 75%
Sources/SwiftBenchmarkTools0% | 0% | 0% | 0% | 100%
Sources/DistributedActorsTestKit0% | 0% | 0% | 0% | 100%
Sources/ActorSingletonPlugin0% | 0% | 0% | 0% | 100%
Sources/CDistributedActorsMailbox0% | 0% | 0% | 0% | 100%
Plugins/DistributedActorsGeneratorPlugin0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
mutating func decodeMessage()
in Sources/DistributedActorsBenchmarks/Protobuf/bench.pb.swift
27 19 1
func interpretSignal()
in Sources/DistributedActors/Behaviors.swift
46 18 2
func canonicalize0()
in Sources/DistributedActors/Behaviors.swift
44 18 4
func traverse()
in Sources/DistributedActorsBenchmarks/Protobuf/bench.pb.swift
56 18 1
func interpretSystemMessage()
in Sources/DistributedActors/_ActorShell.swift
37 14 1
mutating func onIncomingHandshakeOffer()
in Sources/DistributedActors/Cluster/ClusterShellState.swift
62 12 3
mutating func decodeMessage()
in Sources/DistributedActors/Protobuf/WireProtocol.pb.swift
26 12 1
func receiveShellCommand()
in Sources/DistributedActors/Cluster/ClusterShell.swift
31 11 2
mutating func applyClusterEvent()
in Sources/DistributedActors/Cluster/ClusterShellState.swift
42 11 1
func sendPingRequests()
in Sources/DistributedActors/Cluster/SWIM/SWIMActorShell.swift
72 10 2
func sendMessage()
in Sources/DistributedActors/_Mailbox.swift
35 10 3
func renderFuncSwitchCase()
in Sources/DistributedActorsGenerator/Decls+GenActorRendering.swift
79 10 2
func handleError()
in Sources/DistributedActors/Supervision.swift
34 9 4
func onOutboundConnectionError()
in Sources/DistributedActors/Cluster/ClusterShell.swift
51 8 4
mutating func mergeForward()
in Sources/DistributedActors/Cluster/MembershipGossip/Cluster+MembershipGossip.swift
33 8 1
init()
in Sources/DistributedActors/Cluster/Protobuf/Membership+Serialization.swift
18 8 2
func recordMembership()
in Sources/DistributedActors/Metrics/Metrics+ActorSystem.swift
36 8 1
func timeAmount()
in Sources/DistributedActors/Time.swift
11 8 1
func render()
in Sources/DistributedActorsGenerator/Decls+GenActorRendering.swift
36 8 0
func isValidASCII()
in Sources/DistributedActors/ActorAddress.swift
6 7 1