awslabs / visual-search
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 13 units with 224 lines of code in units (50.5% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (120 lines of code)
    • 1 medium size units (25 lines of code)
    • 3 small units (51 lines of code)
    • 7 very small units (28 lines of code)
0% | 53% | 11% | 22% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 53% | 0% | 26% | 20%
py0% | 54% | 26% | 17% | 2%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
web-app/app/controllers0% | 60% | 0% | 30% | 8%
search0% | 100% | 0% | 0% | 0%
DeepLens0% | 0% | 92% | 0% | 7%
API0% | 0% | 0% | 100% | 0%
web-app/app/services0% | 0% | 0% | 0% | 100%
web-app/app/filters0% | 0% | 0% | 0% | 100%
web-app/app/directives0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
function()
in web-app/app/controllers/mainControllers.js
68 12 6
def lambda_handler()
in search/lambda_function.py
52 5 2
def greengrass_infinite_infer_run()
in DeepLens/greengrassHelloWorld.py
25 6 0
function()
in web-app/app/controllers/searchControllers.js
20 2 7
def lambda_handler()
in API/lambda_function.py
17 2 2
function()
in web-app/app/controllers/searchControllers.js
14 1 1
function checkForSearchResults()
in web-app/app/controllers/searchControllers.js
6 1 0
filter()
in web-app/app/filters/filters.js
5 1 3
directive()
in web-app/app/directives/directives.js
5 1 3
function()
in web-app/app/controllers/searchControllers.js
4 1 1
result: $resource()
in web-app/app/services/services.js
3 1 5
user: $resource()
in web-app/app/services/services.js
3 1 5
def function_handler()
in DeepLens/greengrassHelloWorld.py
2 1 2