awslabs / one-line-scan
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 15 units with 211 lines of code in units (56.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (121 lines of code)
    • 3 small units (44 lines of code)
    • 8 very small units (46 lines of code)
0% | 0% | 57% | 20% | 21%
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% | 71% | 13% | 14%
c0% | 0% | 29% | 34% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
utils0% | 0% | 71% | 13% | 14%
regression/analysis/afl-mini0% | 0% | 100% | 0% | 0%
regression/analysis/cprover-analysis0% | 0% | 0% | 100% | 0%
regression/analysis/typical-bugs0% | 0% | 0% | 100% | 0%
regression/analysis/one-line-cr-bot0% | 0% | 0% | 0% | 100%
regression/analysis/cppcheck0% | 0% | 0% | 0% | 100%
regression/compilation/git0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 15 longest units
Unit# linesMcCabe index# params
def main()
in utils/extract_introduced_gcc_style.py
46 12 0
def comment_on_github_pr()
in utils/comment-github-pr.py
28 9 1
def parse_cli()
in utils/comment-github-pr.py
26 1 0
int main()
in regression/analysis/afl-mini/read-stdin.c
21 6 2
def markdownify_gcc_report()
in utils/comment-github-pr.py
19 7 3
int main()
in regression/analysis/cprover-analysis/main.c
14 4 2
int main()
in regression/analysis/typical-bugs/test.c
11 3 2
def drop_second_col()
in utils/extract_introduced_gcc_style.py
9 2 1
def main()
in utils/comment-github-pr.py
9 2 0
int main()
in regression/compilation/git/test.c
6 1 0
int main()
in regression/analysis/one-line-cr-bot/src/src.c
6 1 0
int f()
in regression/analysis/one-line-cr-bot/src/subsrc/sub.c
5 1 0
int f()
in regression/analysis/cppcheck/src/subsrc/sub.c
5 1 0
int main()
in regression/analysis/cppcheck/src/src.c
4 1 0
def usage()
in utils/extract_introduced_gcc_style.py
2 1 1