apple / swift-package-manager
File Size

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

Intro
  • File size measurements show the distribution of size of files.
  • Files are classified in four categories based on their size (lines of code): 1-100 (very small files), 101-200 (small files), 201-500 (medium size files), 501-1000 (long files), 1001+(very long files).
  • It is a good practice to keep files small. Long files may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
File Size Overall
  • There are 595 files with 56,938 lines of code.
    • 7 very long files (10,287 lines of code)
    • 19 long files (12,777 lines of code)
    • 55 medium size files (16,656 lines of codeclsfd_ftr_w_mp_ins)
    • 54 small files (7,935 lines of code)
    • 460 very small files (9,283 lines of code)
18% | 22% | 29% | 13% | 16%
Legend:
1001+
501-1000
201-500
101-200
1-100


explore: zoomable circles | sunburst | 3D view
File Size per Extension
1001+
501-1000
201-500
101-200
1-100
swift18% | 23% | 29% | 14% | 15%
c0% | 0% | 59% | 0% | 40%
h0% | 0% | 0% | 0% | 100%
yaml0% | 0% | 0% | 0% | 100%
cmake0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
mm0% | 0% | 0% | 0% | 100%
el0% | 0% | 0% | 0% | 100%
File Size per Logical Decomposition
primary
1001+
501-1000
201-500
101-200
1-100
Sources/Workspace44% | 16% | 20% | 14% | 4%
Sources/XCBuildSupport74% | 0% | 19% | 4% | 1%
Sources/Commands26% | 27% | 23% | 11% | 10%
Sources/Build43% | 40% | 10% | 4% | 1%
Sources/PackageGraph29% | 0% | 33% | 18% | 18%
Sources/PackageLoading26% | 48% | 13% | 7% | 4%
Sources/PackageCollections0% | 34% | 30% | 29% | 6%
Sources/SourceControl0% | 63% | 28% | 7% | 0%
Sources/SPMTestSupport0% | 24% | 31% | 19% | 24%
Sources/SPMBuildCore0% | 58% | 16% | 0% | 24%
Sources/PackageRegistry0% | 68% | 23% | 0% | 7%
Sources/PackageCollectionsSigning0% | 28% | 28% | 15% | 27%
Sources/PackageDescription0% | 27% | 49% | 0% | 23%
Sources/PackageModel0% | 15% | 47% | 15% | 22%
Sources/Xcodeproj0% | 28% | 62% | 5% | 2%
Sources/Basics0% | 0% | 44% | 43% | 12%
Sources/PackageCollectionsSigningLibc0% | 0% | 55% | 0% | 44%
Sources/SPMPackageEditor0% | 0% | 100% | 0% | 0%
ROOT0% | 0% | 100% | 0% | 0%
Sources/PackagePlugin0% | 0% | 30% | 42% | 26%
Sources/PackageCollectionsModel0% | 0% | 97% | 0% | 2%
Sources/LLBuildManifest0% | 0% | 35% | 47% | 16%
Sources/SPMLLBuild0% | 0% | 0% | 100% | 0%
Sources/PackageFingerprint0% | 0% | 0% | 60% | 39%
Fixtures/Miscellaneous0% | 0% | 0% | 0% | 100%
Fixtures/DependencyResolution0% | 0% | 0% | 0% | 100%
Fixtures/CFamilyTargets0% | 0% | 0% | 0% | 100%
Fixtures/Resources0% | 0% | 0% | 0% | 100%
Utilities/Docker0% | 0% | 0% | 0% | 100%
Sources/swiftpm-manifest-tool0% | 0% | 0% | 0% | 100%
Fixtures/ModuleMaps0% | 0% | 0% | 0% | 100%
Sources/swiftpm-xctest-helper0% | 0% | 0% | 0% | 100%
cmake/modules0% | 0% | 0% | 0% | 100%
Utilities0% | 0% | 0% | 0% | 100%
Sources/swift-package0% | 0% | 0% | 0% | 100%
Fixtures/ValidLayouts0% | 0% | 0% | 0% | 100%
Sources/tsan_utils0% | 0% | 0% | 0% | 100%
Utilities/Emacs0% | 0% | 0% | 0% | 100%
Sources/swift-build0% | 0% | 0% | 0% | 100%
Sources/swift-package-collection0% | 0% | 0% | 0% | 100%
Sources/swift-package-registry0% | 0% | 0% | 0% | 100%
Sources/swift-run0% | 0% | 0% | 0% | 100%
Sources/swift-test0% | 0% | 0% | 0% | 100%
Longest Files (Top 50)
File# lines# units
Workspace.swift
in Sources/Workspace
2994 57
SwiftPackageTool.swift
in Sources/Commands
1521 39
BuildPlan.swift
in Sources/Build
1453 4
PIFBuilder.swift
in Sources/XCBuildSupport
1229 27
PubgrubDependencyResolver.swift
in Sources/PackageGraph/Pubgrub
1051 17
PackageBuilder.swift
in Sources/PackageLoading
1037 8
PIF.swift
in Sources/XCBuildSupport
1002 5
SQLitePackageCollectionsStorage.swift
in Sources/PackageCollections/Storage
877 12
SwiftTool.swift
in Sources/Commands
838 38
ManifestLoader.swift
in Sources/PackageLoading
836 9
GitRepository.swift
in Sources/SourceControl
834 23
MockWorkspace.swift
in Sources/SPMTestSupport
800 2
PluginInvocation.swift
in Sources/SPMBuildCore
799 25
SwiftTestTool.swift
in Sources/Commands
708 6
LLBuildManifestBuilder.swift
in Sources/Build
705 6
RegistryClient.swift
in Sources/PackageRegistry
684 9
CertificatePolicy.swift
in Sources/PackageCollectionsSigning/Certificate
639 14
BuildOperationBuildSystemDelegateHandler.swift
in Sources/Build
638 34
Target.swift
in Sources/PackageDescription
618 -
WorkspaceState.swift
in Sources/Workspace
586 26
Target.swift
in Sources/PackageModel
563 -
PackageCollections.swift
in Sources/PackageCollections
552 2
ManifestJSONParser.swift
in Sources/PackageLoading
545 -
pbxproj.swift
in Sources/Xcodeproj
535 4
DefaultPluginScriptRunner.swift
in Sources/Workspace
516 4
TargetSourcesBuilder.swift
in Sources/PackageLoading
504 1
PackageGraph+Loading.swift
in Sources/PackageGraph
478 6
ManifestSourceGeneration.swift
in Sources/PackageModel
472 23
Package.swift
in root
470 -
Observability.swift
in Sources/Basics
466 8
JSONPackageCollectionProvider.swift
in Sources/PackageCollections/Providers
436 1
WorkspaceConfiguration.swift
in Sources/Workspace
431 -
HTTPClient.swift
in Sources/Basics
387 1
PackageDescriptionSerialization.swift
in Sources/PackageDescription
386 -
GitHubPackageMetadataProvider.swift
in Sources/PackageCollections/Providers
383 4
PinsStore.swift
in Sources/PackageGraph
367 15
RepositoryManager.swift
in Sources/SourceControl
366 14
Describe.swift
in Sources/Commands
363 68
VersionSetSpecifier.swift
in Sources/PackageGraph
356 3
XcodeProjectModelSerialization.swift
in Sources/Xcodeproj
354 9
SourceControlPackageContainer.swift
in Sources/Workspace
351 1
XCBuildMessage.swift
in Sources/XCBuildSupport
349 5
PluginInput.swift
in Sources/PackagePlugin
343 4
BuildOperation.swift
in Sources/Build
340 2
PackageIdentity.swift
in Sources/PackageModel
335 9
XcodeProjectModel.swift
in Sources/Xcodeproj
333 5
Manifest.swift
in Sources/PackageModel
330 -
SwiftPackageCollectionsTool.swift
in Sources/Commands
326 9
UserToolchain.swift
in Sources/Workspace
320 1
PackageCollectionModel+v1.swift
in Sources/PackageCollectionsModel
312 -
Files With Most Units (Top 20)
File# lines# units
Describe.swift
in Sources/Commands
363 68
Workspace.swift
in Sources/Workspace
2994 57
SwiftPackageTool.swift
in Sources/Commands
1521 39
SwiftTool.swift
in Sources/Commands
838 38
BuildOperationBuildSystemDelegateHandler.swift
in Sources/Build
638 34
Repository.swift
in Sources/SourceControl
104 27
PIFBuilder.swift
in Sources/XCBuildSupport
1229 27
WorkspaceState.swift
in Sources/Workspace
586 26
PluginInvocation.swift
in Sources/SPMBuildCore
799 25
ManifestSourceGeneration.swift
in Sources/PackageModel
472 23
GitRepository.swift
in Sources/SourceControl
834 23
API.swift
in Sources/PackageCollections
109 19
Certificate.swift
in Sources/PackageCollectionsSigning/Certificate
217 18
PubgrubDependencyResolver.swift
in Sources/PackageGraph/Pubgrub
1051 17
Trie.swift
in Sources/PackageCollections/Storage
180 15
PinsStore.swift
in Sources/PackageGraph
367 15
CertificatePolicy.swift
in Sources/PackageCollectionsSigning/Certificate
639 14
BuildSystemDelegate.swift
in Sources/SPMBuildCore
19 14
llbuild.swift
in Sources/SPMLLBuild
167 14
RepositoryManager.swift
in Sources/SourceControl
366 14
Files With Long Lines (Top 20)

There are 140 files with lines longer than 120 characters. In total, there are 1159 long lines.

File# lines# units# long lines
Workspace.swift
in Sources/Workspace
2994 57 173
SQLitePackageCollectionsStorage.swift
in Sources/PackageCollections/Storage
877 12 44
SwiftPackageTool.swift
in Sources/Commands
1521 39 43
MockWorkspace.swift
in Sources/SPMTestSupport
800 2 41
PubgrubDependencyResolver.swift
in Sources/PackageGraph/Pubgrub
1051 17 30
SwiftTool.swift
in Sources/Commands
838 38 29
PackageCollections.swift
in Sources/PackageCollections
552 2 28
JSONPackageCollectionProvider.swift
in Sources/PackageCollections/Providers
436 1 26
PackageBuilder.swift
in Sources/PackageLoading
1037 8 26
CertificatePolicy.swift
in Sources/PackageCollectionsSigning/Certificate
639 14 25
ManifestLoader.swift
in Sources/PackageLoading
836 9 25
PluginInvocation.swift
in Sources/SPMBuildCore
799 25 22
BuildPlan.swift
in Sources/Build
1453 4 20
Describe.swift
in Sources/Commands
363 68 20
SwiftPackageCollectionsTool.swift
in Sources/Commands
326 9 19
GitHubPackageMetadataProvider.swift
in Sources/PackageCollections/Providers
383 4 18
TargetDescription.swift
in Sources/PackageModel/Manifest
268 - 18
RegistryClient.swift
in Sources/PackageRegistry
684 9 18
HTTPClient.swift
in Sources/Basics
387 1 17
PackageGraph+Loading.swift
in Sources/PackageGraph
478 6 17