microsoft / reactxp
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 764 units with 9,082 lines of code in units (45.4% of code).
    • 5 very long units (720 lines of code)
    • 16 long units (1,025 lines of code)
    • 78 medium size units (2,375 lines of code)
    • 155 small units (2,165 lines of code)
    • 510 very small units (2,797 lines of code)
7% | 11% | 26% | 23% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx7% | 13% | 26% | 22% | 29%
ts9% | 3% | 23% | 28% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
extensions/virtuallistview43% | 5% | 19% | 17% | 12%
src/web4% | 14% | 27% | 28% | 25%
src/common14% | 11% | 17% | 28% | 28%
src/native-common0% | 12% | 25% | 21% | 39%
src/windows0% | 16% | 13% | 22% | 48%
extensions/navigation0% | 10% | 37% | 21% | 29%
extensions/webview0% | 0% | 35% | 9% | 54%
extensions/video0% | 0% | 45% | 7% | 46%
src/tslint0% | 0% | 72% | 15% | 11%
extensions/imagesvg0% | 0% | 100% | 0% | 0%
src/native-desktop0% | 0% | 23% | 29% | 47%
src/macos0% | 0% | 33% | 0% | 66%
extensions/netinfo0% | 0% | 56% | 0% | 43%
src/android0% | 0% | 0% | 35% | 64%
src/ios0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private _adaptStyles()
in src/web/Styles.ts
172 57 3
private _calcNewRenderedItemState()
in extensions/virtuallistview/src/VirtualListView.tsx
158 34 1
export function recalcPositionFromLayoutData()
in src/common/PopupContainerViewBase.tsx
151 54 5
render()
in extensions/virtuallistview/src/VirtualListView.tsx
137 28 0
private _handleItemListChange()
in extensions/virtuallistview/src/VirtualListView.tsx
102 28 1
protected _buildInternalProps()
in src/windows/View.tsx
95 33 1
render()
in src/web/View.tsx
87 17 0
render()
in src/web/TextInput.tsx
81 11 0
render()
in src/native-common/ScrollView.tsx
68 14 0
protected _buildInternalProps()
in src/native-common/View.tsx
68 24 1
private _handleWillAnimate()
in src/web/listAnimations/AnimateListEdits.tsx
65 13 2
private _updateStyles()
in src/web/Animated.tsx
62 21 2
private _sendMultiTouchEvents()
in src/common/GestureView.tsx
60 15 4
private _adaptStyles()
in src/native-common/Styles.ts
58 18 3
render()
in src/web/AlertModalContent.tsx
58 10 0
private _buildTransitionSpec()
in extensions/navigation/src/native-common/NavigatorExperimentalDelegate.tsx
56 17 1
private _updateTransition()
in src/web/Animated.tsx
56 11 0
setTop()
in extensions/virtuallistview/src/VirtualListCell.tsx
53 13 4
private _sendPanEvent()
in src/common/GestureView.tsx
53 17 5
componentDidUpdate()
in src/web/listAnimations/MonitorListEdits.tsx
53 5 1