aws-samples / aws-amplify-react-native-events-app-workshop
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 39 units with 781 lines of code in units (47.4% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (293 lines of code)
    • 7 medium size units (235 lines of code)
    • 10 small units (150 lines of code)
    • 18 very small units (103 lines of code)
0% | 37% | 30% | 19% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 43% | 29% | 19% | 7%
java0% | 0% | 41% | 20% | 38%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sample/src/screens0% | 59% | 19% | 18% | 2%
sample/src/utils0% | 0% | 72% | 14% | 13%
sample/android/app/src/debug0% | 0% | 100% | 0% | 0%
sample/src/components0% | 0% | 100% | 0% | 0%
sample0% | 0% | 0% | 80% | 19%
sample/android/app/src/main0% | 0% | 0% | 33% | 66%
sample/src0% | 0% | 0% | 0% | 100%
sample/ios/awsamplifyreactnative0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export default function()
in sample/src/screens/HomeScreen.js
86 4 2
export default function ChatScreen()
in sample/src/screens/ChatScreen.js
84 6 1
export default function CreateScreen()
in sample/src/screens/CreateScreen.js
64 4 1
export default function AccountScreen()
in sample/src/screens/AccountScreen.js
59 6 0
export default function EventScreen()
in sample/src/screens/EventScreen.js
47 4 1
async function updateDatabaseUser()
in sample/src/utils/users.js
42 8 3
public static void initializeFlipper()
in sample/android/app/src/debug/java/com/awsamplifyreactnative/ReactNativeFlipper.java
39 3 2
export default function EventBox()
in sample/src/components/EventBox.js
29 5 1
async function updateEndpoint()
in sample/src/utils/users.js
28 2 4
export default function()
in sample/src/screens/HistoryScreen.js
27 1 1
export default function()
in sample/src/screens/AuthScreen.js
23 1 1
private static void initializeFlipper()
in sample/android/app/src/main/java/com/awsamplifyreactnative/MainApplication.java
19 6 2
async function getAllEvents()
in sample/src/screens/HomeScreen.js
19 5 0
getEvent()
in sample/src/screens/ChatScreen.js
19 1 1
async function createEventChat()
in sample/src/screens/ChatScreen.js
16 2 3
async function deleteEventById()
in sample/src/screens/HomeScreen.js
15 1 1
function getCognitoUser()
in sample/src/utils/users.js
14 2 1
Roboto: require()
in sample/App.js
13 2 1
function formatMessage()
in sample/src/screens/ChatScreen.js
12 1 1
Roboto_medium: require()
in sample/App.js
12 2 1