apple / swift-atomics
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 16 units with 155 lines of code in units (1.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (64 lines of code)
    • 1 medium size units (23 lines of code)
    • 2 small units (30 lines of code)
    • 12 very small units (38 lines of code)
0% | 41% | 14% | 19% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 48% | 17% | 22% | 12%
h0% | 0% | 0% | 0% | 100%
c0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Utilities0% | 48% | 17% | 22% | 12%
Sources/_AtomicsShims/include0% | 0% | 0% | 0% | 100%
Sources/_AtomicsShims/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
def tokenize_template()
in Utilities/gyb.py
64 4 1
23 6 3
def token_pos_to_index()
in Utilities/gyb.py
19 5 3
def shimOrders()
in Utilities/gyb_utils.py
11 5 2
def get_line_starts()
in Utilities/gyb.py
6 2 1
void _sa_retain_n()
in Sources/_AtomicsShims/src/_AtomicsShims.c
5 1 2
void _sa_release_n()
in Sources/_AtomicsShims/src/_AtomicsShims.c
5 1 2
_sa_dword _sa_dword_create()
in Sources/_AtomicsShims/include/_AtomicsShims.h
3 1 2
uintptr_t _sa_dword_extract_high()
in Sources/_AtomicsShims/include/_AtomicsShims.h
3 1 1
uintptr_t _sa_dword_extract_low()
in Sources/_AtomicsShims/include/_AtomicsShims.h
3 1 1
_sa_dword _sa_decode_dword()
in Sources/_AtomicsShims/include/_AtomicsShims.h
3 1 1
def strip_trailing_nl()
in Utilities/gyb.py
2 2 1
def split_lines()
in Utilities/gyb.py
2 2 1
def autogenerated_warning()
in Utilities/gyb_utils.py
2 1 0
def lowerFirst()
in Utilities/gyb_utils.py
2 2 1
def argLabel()
in Utilities/gyb_utils.py
2 2 1