microsoft / PowerBI-visuals-CardBrowser
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 134 units with 1,588 lines of code in units (50.1% of code).
    • 1 very long units (111 lines of code)
    • 3 long units (196 lines of code)
    • 13 medium size units (378 lines of code)
    • 23 small units (353 lines of code)
    • 94 very small units (550 lines of code)
6% | 12% | 23% | 22% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts17% | 30% | 13% | 20% | 18%
js0% | 0% | 31% | 23% | 45%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src17% | 30% | 13% | 20% | 19%
lib/@uncharted/cards/src/components/inlineCardsView0% | 0% | 62% | 9% | 27%
lib/@uncharted/cards/src/components/card0% | 0% | 40% | 19% | 40%
lib/@uncharted/cards/src/components/headerImage0% | 0% | 70% | 19% | 9%
lib/@uncharted/cards/src/util0% | 0% | 32% | 32% | 34%
lib/@uncharted/cards/src/components/readerContent0% | 0% | 41% | 41% | 17%
lib/@uncharted/cards/src/components/verticalReader0% | 0% | 0% | 40% | 59%
lib/@uncharted/cards/src/components/cards0% | 0% | 0% | 24% | 75%
lib/@uncharted/cards/src/components/wrappedCardsView0% | 0% | 0% | 18% | 81%
lib/@uncharted/cards/src/handlebarHelper0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in src/VisualMain.ts
111 17 1
public update()
in src/VisualMain.ts
79 19 1
function convertToRowObjs()
in src/dataConversion.ts
64 23 3
private updateCards()
in src/VisualMain.ts
53 2 1
_getIndexOfFirstCardInViewPort()
in lib/@uncharted/cards/src/components/inlineCardsView/inlineCardsView.js
45 9 1
render()
in lib/@uncharted/cards/src/components/card/card.js
38 8 0
renderCardsInViewPort()
in lib/@uncharted/cards/src/components/inlineCardsView/inlineCardsView.js
33 11 0
32 8 0
31 9 2
render()
in lib/@uncharted/cards/src/components/readerContent/readerContent.js
29 3 0
off()
in lib/@uncharted/cards/src/util/IBindable.js
29 11 3
render()
in lib/@uncharted/cards/src/components/headerImage/headerImage.js
27 7 0
_registerDomEvents()
in lib/@uncharted/cards/src/components/card/card.js
24 8 0
scaleImages()
in lib/@uncharted/cards/src/components/headerImage/headerImage.js
24 4 2
_expandAndCenterCard()
in lib/@uncharted/cards/src/components/inlineCardsView/inlineCardsView.js
23 4 2
function toHSL()
in src/utils.ts
22 7 1
export function grayShadeFromString()
in lib/@uncharted/cards/src/util/images.js
21 4 3
_registerDOMEvents()
in lib/@uncharted/cards/src/components/verticalReader/verticalReader.js
20 9 0
_fadeOutOverflowingCardMetadataTexts()
in lib/@uncharted/cards/src/components/cards/cards.js
19 8 1
on()
in lib/@uncharted/cards/src/util/IBindable.js
19 6 2