kubernetes / community
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 47 units with 921 lines of code in units (15.5% of code).
    • 1 very long units (102 lines of code)
    • 3 long units (225 lines of code)
    • 11 medium size units (352 lines of code)
    • 6 small units (95 lines of code)
    • 26 very small units (147 lines of code)
11% | 24% | 38% | 10% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py21% | 20% | 34% | 10% | 13%
go0% | 29% | 42% | 10% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sig-contributor-experience/surveys/k8s_survey_analysis23% | 22% | 38% | 8% | 8%
generator0% | 29% | 42% | 10% | 18%
hack0% | 0% | 0% | 29% | 70%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def make_single_likert_chart()
in sig-contributor-experience/surveys/k8s_survey_analysis/plot_utils.py
102 9 5
def make_bar_chart()
in sig-contributor-experience/surveys/k8s_survey_analysis/plot_utils.py
95 12 4
func()
in generator/app.go
70 30 1
func main()
in generator/app.go
60 15 0
func()
in generator/app.go
38 6 1
def split_for_likert()
in sig-contributor-experience/surveys/k8s_survey_analysis/plot_utils.py
37 5 2
def get_df()
in sig-contributor-experience/surveys/k8s_survey_analysis/prepare_2019.py
37 16 1
def process_header()
in sig-contributor-experience/surveys/k8s_survey_analysis/prepare_2019.py
36 16 1
func createAnnualReport()
in generator/app.go
34 9 2
def make_single_bar_chart_multi_year()
in sig-contributor-experience/surveys/k8s_survey_analysis/plot_utils.py
33 3 4
func getExistingContent()
in generator/app.go
32 9 2
31 9 2
func writeTemplate()
in generator/app.go
30 7 4
func createGroupReadme()
in generator/app.go
23 7 2
def get_df()
in sig-contributor-experience/surveys/k8s_survey_analysis/prepare_2018.py
21 10 1
def make_long()
in sig-contributor-experience/surveys/k8s_survey_analysis/plot_utils.py
18 2 3
18 5 3
def get_single_year_data_subset()
in sig-contributor-experience/surveys/k8s_survey_analysis/plot_utils.py
17 3 3
func()
in generator/app.go
17 3 1
def repos_from_k8s_group()
in hack/generate-devstats-repo-sql.py
13 6 1