apple / swift-syntax
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 86 files with 75,703 lines of code.
    • 18 very long files (67,959 lines of code)
    • 3 long files (2,083 lines of code)
    • 11 medium size files (3,556 lines of codeclsfd_ftr_w_mp_ins)
    • 7 small files (1,155 lines of code)
    • 47 very small files (950 lines of code)
89% | 2% | 4% | 1% | 1%
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
swift90% | 2% | 4% | 1% | 1%
py0% | 70% | 0% | 23% | 6%
cfg0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
c0% | 0% | 0% | 0% | 100%
File Size per Logical Decomposition
primary
1001+
501-1000
201-500
101-200
1-100
Sources/SwiftSyntax/gyb_generated94% | 2% | 2% | <1% | 0%
Sources/SwiftSyntaxBuilder/gyb_generated95% | 0% | 3% | 0% | <1%
Sources/SwiftSyntax32% | 0% | 56% | 3% | 7%
ROOT0% | 86% | 0% | 0% | 13%
lit_tests0% | 0% | 0% | 80% | 19%
Sources/SwiftSyntaxParser0% | 0% | 0% | 87% | 12%
Sources/SwiftSyntaxBuilder/gyb_helpers0% | 0% | 0% | 79% | 20%
Sources/SwiftSyntaxBuilder0% | 0% | 0% | 0% | 100%
lit_tests/incrParse0% | 0% | 0% | 0% | 100%
Sources/_CSwiftSyntax/include0% | 0% | 0% | 0% | 100%
Sources/SwiftSyntaxParser/gyb_generated0% | 0% | 0% | 0% | 100%
Sources/_CSwiftSyntax/src0% | 0% | 0% | 0% | 100%
Longest Files (Top 50)
File# lines# units
SyntaxNodes.swift
in Sources/SwiftSyntax/gyb_generated/syntax_nodes
9930 -
BuildableNodes.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
9252 -
SyntaxBuilders.swift
in Sources/SwiftSyntax/gyb_generated
7623 -
SyntaxCollections.swift
in Sources/SwiftSyntax/gyb_generated
6194 41
SyntaxFactory.swift
in Sources/SwiftSyntax/gyb_generated
5419 -
SyntaxDeclNodes.swift
in Sources/SwiftSyntax/gyb_generated/syntax_nodes
4326 -
SyntaxExprNodes.swift
in Sources/SwiftSyntax/gyb_generated/syntax_nodes
4210 -
SyntaxRewriter.swift
in Sources/SwiftSyntax/gyb_generated
3528 -
SyntaxVisitor.swift
in Sources/SwiftSyntax/gyb_generated
3465 -
SyntaxStmtNodes.swift
in Sources/SwiftSyntax/gyb_generated/syntax_nodes
2266 -
ExpressibleAsProtocols.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
1868 487
TokenKind.swift
in Sources/SwiftSyntax/gyb_generated
1860 -
Misc.swift
in Sources/SwiftSyntax/gyb_generated
1718 -
SyntaxAnyVisitor.swift
in Sources/SwiftSyntax/gyb_generated
1464 -
SyntaxTypeNodes.swift
in Sources/SwiftSyntax/gyb_generated/syntax_nodes
1396 -
ResultBuilders.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
1231 -
BuildableCollectionNodes.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
1143 -
RawSyntax.swift
in Sources/SwiftSyntax
1066 36
SyntaxPatternNodes.swift
in Sources/SwiftSyntax/gyb_generated/syntax_nodes
788 -
SyntaxEnum.swift
in Sources/SwiftSyntax/gyb_generated
752 -
build-script.py
in root
543 30
Tokens.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
472 -
Syntax.swift
in Sources/SwiftSyntax
377 14
SyntaxClassifier.swift
in Sources/SwiftSyntax
371 13
SourceLocation.swift
in Sources/SwiftSyntax
338 14
SyntaxClassification.swift
in Sources/SwiftSyntax/gyb_generated
333 -
SyntaxKind.swift
in Sources/SwiftSyntax/gyb_generated
313 -
SyntaxBaseNodes.swift
in Sources/SwiftSyntax/gyb_generated
310 10
Trivia.swift
in Sources/SwiftSyntax/gyb_generated
303 1
SyntaxChildren.swift
in Sources/SwiftSyntax
266 18
IncrementalParseTransition.swift
in Sources/SwiftSyntax
261 5
SyntaxData.swift
in Sources/SwiftSyntax
212 26
coloring.swift
in lit_tests
193 27
SyntaxBuildableWrappers.py
in Sources/SwiftSyntaxBuilder/gyb_helpers
182 36
coloring_configs.swift
in lit_tests
172 8
SyntaxParser.swift
in Sources/SwiftSyntaxParser
170 6
SyntaxTraits.swift
in Sources/SwiftSyntax/gyb_generated
166 29
Diagnostic.swift
in Sources/SwiftSyntaxParser
152 2
SyntaxOtherNodes.swift
in Sources/SwiftSyntax
120 -
BuildableBaseProtocols.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
100 18
Package.swift
in root
85 -
Utils.swift
in Sources/SwiftSyntax
84 4
StringConvenienceInitializers.swift
in Sources/SwiftSyntaxBuilder
48 -
SourceLength.swift
in Sources/SwiftSyntax
47 -
CNodes.swift
in Sources/SwiftSyntaxParser
44 -
CNodes.swift
in Sources/SwiftSyntax
40 -
cfg
lit.cfg
in lit_tests
40 -
ExpressibleAsConformances.py
in Sources/SwiftSyntaxBuilder/gyb_helpers
37 -
c-syntax-nodes.h
in Sources/_CSwiftSyntax/include
37 -
reuse.swift
in lit_tests/incrParse
31 5
Files With Most Units (Top 20)
File# lines# units
ExpressibleAsProtocols.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
1868 487
SyntaxCollections.swift
in Sources/SwiftSyntax/gyb_generated
6194 41
RawSyntax.swift
in Sources/SwiftSyntax
1066 36
SyntaxBuildableWrappers.py
in Sources/SwiftSyntaxBuilder/gyb_helpers
182 36
build-script.py
in root
543 30
SyntaxTraits.swift
in Sources/SwiftSyntax/gyb_generated
166 29
coloring.swift
in lit_tests
193 27
SyntaxData.swift
in Sources/SwiftSyntax
212 26
SyntaxChildren.swift
in Sources/SwiftSyntax
266 18
BuildableBaseProtocols.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
100 18
SourceLocation.swift
in Sources/SwiftSyntax
338 14
Syntax.swift
in Sources/SwiftSyntax
377 14
SyntaxClassifier.swift
in Sources/SwiftSyntax
371 13
coloring_comments.swift
in lit_tests
18 12
SyntaxBaseNodes.swift
in Sources/SwiftSyntax/gyb_generated
310 10
coloring_configs.swift
in lit_tests
172 8
SyntaxParser.swift
in Sources/SwiftSyntaxParser
170 6
funcs.swift
in lit_tests/incrParse
18 6
IncrementalParseTransition.swift
in Sources/SwiftSyntax
261 5
reuse.swift
in lit_tests/incrParse
31 5
Files With Long Lines (Top 12)

There are 12 files with lines longer than 120 characters. In total, there are 233 long lines.

File# lines# units# long lines
SyntaxFactory.swift
in Sources/SwiftSyntax/gyb_generated
5419 - 136
BuildableNodes.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
9252 - 54
BuildableCollectionNodes.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
1143 - 16
SyntaxBaseNodes.swift
in Sources/SwiftSyntax/gyb_generated
310 10 10
ExpressibleAsProtocols.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
1868 487 7
SyntaxBuildableWrappers.py
in Sources/SwiftSyntaxBuilder/gyb_helpers
182 36 3
FunctionCallExprConvenienceInitializers.swift
in Sources/SwiftSyntaxBuilder
20 - 2
IncrementalParseTransition.swift
in Sources/SwiftSyntax
261 5 1
Misc.swift
in Sources/SwiftSyntax/gyb_generated
1718 - 1
TokenSyntax.swift
in Sources/SwiftSyntaxBuilder/gyb_generated
26 - 1
SyntaxParser.swift
in Sources/SwiftSyntaxParser
170 6 1
multi-edit-mapping.swift
in lit_tests/incrParse
1 - 1