apple / swift-source-compat-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 136 units with 1,745 lines of code in units (89.4% of code).
    • 2 very long units (240 lines of code)
    • 3 long units (204 lines of code)
    • 21 medium size units (648 lines of code)
    • 19 small units (284 lines of code)
    • 91 very small units (369 lines of code)
13% | 11% | 37% | 16% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py13% | 11% | 37% | 16% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT13% | 11% | 37% | 15% | 20%
utils0% | 0% | 0% | 56% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def add_arguments()
in project_future.py
137 2 1
def dispatch()
in project_future.py
103 10 16
def clone_repos()
in common.py
81 2 0
def main()
in reproduce.py
65 22 0
def add_minimal_arguments()
in project_future.py
58 1 1
def main()
in runner.py
49 7 0
def __str__()
in project_future.py
42 15 1
def get_prebuild_command()
in project_future.py
40 10 2
def parse_args()
in reproduce.py
38 1 0
def get_build_command()
in project_future.py
37 9 2
def failed()
in project_future.py
34 6 3
def succeeded()
in project_future.py
34 6 2
def git_update()
in common.py
33 6 6
def build_swift_package()
in project_future.py
32 9 10
def __init__()
in project_future.py
30 1 17
def main()
in build_incremental.py
28 2 0
def main()
in builder.py
28 2 0
def is_xfailed()
in project_future.py
28 10 6
def __init__()
in project_future.py
28 1 19
def build_incremental()
in project_future.py
28 4 4