tensorflow / swift
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 125 units with 1,842 lines of code in units (64.3% of code).
    • 2 very long units (495 lines of code)
    • 1 long units (54 lines of code)
    • 14 medium size units (413 lines of code)
    • 28 small units (376 lines of code)
    • 80 very small units (504 lines of code)
26% | 2% | 22% | 20% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift26% | 2% | 22% | 20% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/SIL26% | 2% | 22% | 20% | 27%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func parseInstructionBody()
in Sources/SIL/SILParser.swift
259 56 1
func print()
in Sources/SIL/SILPrinter.swift
236 49 1
func parse()
in Sources/SIL/BitcodeParser.swift
54 8 0
func parseNakedType()
in Sources/SIL/SILParser.swift
47 12 0
func parseInfoBlock()
in Sources/SIL/BitcodeParser.swift
42 8 1
func naked()
in Sources/SIL/SILPrinter.swift
41 14 1
func print()
in Sources/SIL/SILPrinter.swift
31 14 1
func printExpr()
in Sources/SIL/SExpr.swift
30 10 1
func print()
in Sources/SIL/SILPrinter.swift
29 7 1
func print()
in Sources/SIL/SILPrinter.swift
28 11 1
func print()
in Sources/SIL/BitcodePrinter.swift
27 6 2
func print()
in Sources/SIL/SILPrinter.swift
24 11 1
func parseFieldType()
in Sources/SIL/BitcodeParser.swift
24 7 0
func print()
in Sources/SIL/BitcodePrinter.swift
24 5 1
func parseExpr()
in Sources/SIL/SExpr.swift
23 8 0
func print()
in Sources/SIL/SILPrinter.swift
22 10 1
func read()
in Sources/SIL/BitcodeParser.swift
21 7 1
func parseConvention()
in Sources/SIL/SILParser.swift
19 5 0
func parseValue()
in Sources/SIL/SExpr.swift
18 4 0
func parseMany()
in Sources/SIL/Parser.swift
17 3 4