cdklabs / construct-hub-webapp
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 65 units with 490 lines of code in units (4.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (55 lines of code)
    • 5 medium size units (135 lines of code)
    • 7 small units (93 lines of code)
    • 52 very small units (207 lines of code)
0% | 11% | 27% | 18% | 42%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 15% | 24% | 15% | 44%
tsx0% | 0% | 36% | 29% | 33%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/api0% | 27% | 41% | 25% | 4%
src/views0% | 0% | 21% | 20% | 58%
src/components0% | 0% | 24% | 15% | 60%
src/theme0% | 0% | 0% | 0% | 100%
src/lib0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in src/api/catalog-search/catalog-search.ts
55 6 2
private detectConstructFrameworks()
in src/api/catalog-search/catalog-search.ts
35 4 0
name: eventName()
in src/views/Search/CheckboxFilter.tsx
28 3 4
private filter()
in src/api/catalog-search/catalog-search.ts
26 5 2
private query()
in src/api/catalog-search/catalog-search.ts
23 4 1
dataEvent ? eventName()
in src/components/PackageCard/Heading.tsx
23 3 3
chosen by its publisher()
in src/views/FAQ/FAQ.tsx
15 2 5
dataEvent ? eventName()
in src/components/SearchBar/SearchBar.tsx
15 2 2
private sort()
in src/api/catalog-search/catalog-search.ts
14 2 2
private dedup()
in src/api/catalog-search/catalog-search.ts
13 4 1
private detectKeywords()
in src/api/catalog-search/catalog-search.ts
13 2 0
public search()
in src/api/catalog-search/catalog-search.ts
12 4 1
sort: newSort ?()
in src/views/Search/SortFilter.tsx
11 2 1
public findByName()
in src/api/catalog-search/catalog-search.ts
10 3 1
background: transparentize()
in src/theme/components/Tag.ts
10 1 2
AWS Partner Network()
in src/views/Contribute/Contribute.tsx
9 3 1
__storeWriter: getLocalStoreWriter()
in src/lib/shortbread/shortbread.ts
9 2 0
query: getParamFromUrl()
in src/views/Search/util.ts
7 2 1
7 1 3
keywords: parseQueryArray()
in src/views/Search/util.ts
6 2 1