aws / aws-eks-best-practices
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 18 units with 278 lines of code in units (9.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (153 lines of code)
    • 5 small units (84 lines of code)
    • 7 very small units (41 lines of code)
0% | 0% | 55% | 30% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 45% | 40% | 14%
go0% | 0% | 83% | 0% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
projects/enable-irsa/src0% | 0% | 45% | 40% | 14%
projects/imds0% | 0% | 83% | 0% | 16%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
func updateLaunchTemplates()
in projects/imds/update.go
31 3 1
def patch_aws_node()
in projects/enable-irsa/src/main.py
31 6 2
func getLaunchTemplates()
in projects/imds/imds.go
28 4 0
def create_odic_provider()
in projects/enable-irsa/src/main.py
21 5 2
def create_trust_policy()
in projects/enable-irsa/src/main.py
21 2 2
def main()
in projects/enable-irsa/src/main.py
21 3 4
def describe_cluster()
in projects/enable-irsa/src/main.py
20 2 1
def update_cni_sa()
in projects/enable-irsa/src/main.py
19 3 3
def create_iam_role()
in projects/enable-irsa/src/main.py
18 4 2
def choose_context()
in projects/enable-irsa/src/main.py
14 4 0
def attach_role_policy()
in projects/enable-irsa/src/main.py
13 3 1
def create_clientset()
in projects/enable-irsa/src/main.py
8 1 3
func main()
in projects/imds/update.go
7 1 0
def get_token()
in projects/enable-irsa/src/main.py
7 1 1
def check_cluster_version()
in projects/enable-irsa/src/main.py
6 2 1
func main()
in projects/imds/imds.go
5 1 0
def __init__()
in projects/enable-irsa/src/main.py
5 1 7
def choice()
in projects/enable-irsa/src/main.py
3 1 1