apple / swift-package-registry-compatibility-test-suite
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 140 units with 1,568 lines of code in units (37.3% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (238 lines of code)
    • 13 medium size units (434 lines of code)
    • 26 small units (382 lines of code)
    • 97 very small units (514 lines of code)
0% | 15% | 27% | 24% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 15% | 27% | 24% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/PackageRegistryCompatibilityTestSuite0% | 34% | 9% | 16% | 39%
Sources/PackageRegistryExample/Controllers0% | 21% | 54% | 9% | 14%
Sources/PackageRegistryCompatibilityTestSuite/APITests0% | 15% | 27% | 28% | 29%
Sources/PackageRegistryExample/DataAccess0% | 0% | 23% | 44% | 32%
Sources/PackageRegistryExample0% | 0% | 40% | 25% | 33%
Sources/PackageRegistryTool0% | 0% | 100% | 0% | 0%
Sources/PostgresMigrations0% | 0% | 0% | 29% | 70%
Sources/DatabaseMigrations0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func run()
in Sources/PackageRegistryCompatibilityTestSuite/TestConfigurationGenerator.swift
70 5 2
func execute()
in Sources/PackageRegistryCompatibilityTestSuite/Commands.swift
65 11 0
func fetchManifest()
in Sources/PackageRegistryExample/Controllers/PackageManifestsController.swift
52 6 1
func run()
in Sources/PackageRegistryCompatibilityTestSuite/APITests/CreatePackageRelease.swift
51 7 0
init()
in Sources/PackageRegistryExample/Service+API.swift
49 4 2
func run()
in Sources/PackageRegistryCompatibilityTestSuite/APITests/FetchPackageReleaseManifest.swift
44 8 0
func run()
in Sources/PackageRegistryTool/Tool.swift
44 5 0
func fetchPackageReleaseInfo()
in Sources/PackageRegistryExample/Controllers/PackageReleasesController.swift
42 7 1
func pushPackageRelease()
in Sources/PackageRegistryExample/Controllers/CreatePackageReleaseController.swift
38 2 1
func readConfigAndRunTests()
in Sources/PackageRegistryCompatibilityTestSuite/Commands.swift
36 7 3
func create()
in Sources/PackageRegistryExample/DataAccess/Postgres/PackageReleasesDAO+Postgres.swift
35 4 10
func downloadSourceArchive()
in Sources/PackageRegistryExample/Controllers/PackageResourcesController.swift
29 3 1
func model()
in Sources/PackageRegistryExample/DataAccess/Postgres/PackageManifestsDAO+Postgres.swift
26 2 0
func run()
in Sources/PackageRegistryCompatibilityTestSuite/APITests/DownloadSourceArchive.swift
25 4 0
func run()
in Sources/PackageRegistryCompatibilityTestSuite/APITests/LookupPackageIdentifiers.swift
22 4 0
func listForPackage()
in Sources/PackageRegistryExample/Controllers/PackageReleasesController.swift
22 2 1
func delete()
in Sources/PackageRegistryExample/DataAccess/Postgres/PackageReleasesDAO+Postgres.swift
22 1 2
func create()
in Sources/PackageRegistryExample/DataAccess/Postgres/PackageManifestsDAO+Postgres.swift
20 1 6
func create()
in Sources/PackageRegistryExample/DataAccess/Postgres/PackageReleasesDAO+Postgres.swift
19 1 4
func run()
in Sources/PackageRegistryCompatibilityTestSuite/APITests/ListPackageReleases.swift
18 2 4