apple / swift-llbuild2
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 331 units with 1,625 lines of code in units (9.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (54 lines of code)
    • 1 medium size units (22 lines of code)
    • 17 small units (239 lines of code)
    • 312 very small units (1,310 lines of code)
0% | 3% | 1% | 14% | 80%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 3% | 1% | 14% | 80%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/LLBNinja0% | 67% | 0% | 13% | 18%
Sources/BazelRemoteAPI0% | 0% | 4% | 24% | 71%
Sources/LLBBuildSystem0% | 0% | 0% | 25% | 74%
Sources/llbuild2fx0% | 0% | 0% | 5% | 94%
Sources/Tools0% | 0% | 0% | 26% | 73%
Sources/llbuild20% | 0% | 0% | 0% | 100%
Sources/LLBBuildSystemUtil0% | 0% | 0% | 0% | 100%
Sources/LLBBazelBackend0% | 0% | 0% | 0% | 100%
Sources/LLBCommands0% | 0% | 0% | 0% | 100%
Sources/LLBBuildSystemTestHelpers0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func lookupFunction()
in Sources/LLBNinja/NinjaBuild.swift
54 5 2
func listOperations()
in Sources/BazelRemoteAPI/Generated/google/longrunning/operations.grpc.swift
22 1 2
func requestInputs()
in Sources/LLBBuildSystem/Functions/Execution/Action.swift
20 5 2
func findMissingBlobs()
in Sources/BazelRemoteAPI/Generated/build/bazel/remote/execution/v2/remote_execution.grpc.swift
19 1 2
func getOperation()
in Sources/BazelRemoteAPI/Generated/google/longrunning/operations.grpc.swift
18 1 2
func batchUpdateBlobs()
in Sources/BazelRemoteAPI/Generated/build/bazel/remote/execution/v2/remote_execution.grpc.swift
15 1 2
func lookupFunction()
in Sources/LLBBuildSystem/BuildEngine.swift
15 2 2
init()
in Sources/BazelRemoteAPI/Generated/build/bazel/remote/execution/v2/remote_execution.pb.swift
14 1 1
func read()
in Sources/BazelRemoteAPI/Generated/google/bytestream/bytestream.grpc.swift
14 1 3
func deleteOperation()
in Sources/BazelRemoteAPI/Generated/google/longrunning/operations.grpc.swift
14 1 2
func allKeys()
in Sources/llbuild2fx/CommandLineArgsCoder.swift
14 3 1
func countUnkeyed()
in Sources/llbuild2fx/CommandLineArgsCoder.swift
14 3 1
init()
in Sources/LLBBuildSystem/Functions/Evaluation/Configuration.swift
13 2 1
init()
in Sources/LLBBuildSystem/Rules/Provider.swift
13 2 1
func execute()
in Sources/BazelRemoteAPI/Generated/build/bazel/remote/execution/v2/remote_execution.grpc.swift
12 1 3
func batchReadBlobs()
in Sources/BazelRemoteAPI/Generated/build/bazel/remote/execution/v2/remote_execution.grpc.swift
11 1 2
init()
in Sources/LLBNinja/NinjaBuild.swift
11 3 2
func run()
in Sources/Tools/llcastool/CASCommands.swift
11 1 0
func withTemporaryDirectory()
in Sources/llbuild2fx/TreeMaterialization.swift
11 2 2
func fetchBlob()
in Sources/BazelRemoteAPI/Generated/build/bazel/remote/asset/v1/remote_asset.grpc.swift
10 1 2