aws-samples / aws-dev-hour-frontend
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 22 units with 491 lines of code in units (28.4% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (55 lines of code)
    • 0 medium complex units (0 lines of code)
    • 3 simple units (109 lines of code)
    • 18 very simple units (327 lines of code)
0% | 11% | 0% | 22% | 66%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
js0% | 11% | 0% | 22% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/lib0% | 100% | 0% | 0% | 0%
src/components/home0% | 0% | 0% | 78% | 21%
src/components0% | 0% | 0% | 24% | 75%
src0% | 0% | 0% | 37% | 62%
src/components/auth0% | 0% | 0% | 0% | 100%
src/components/photos0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function validateForm()
in src/lib/formValidation.js
55 27 2
function FormErrors()
in src/components/FormErrors.js
35 9 1
function registerValidSW()
in src/serviceWorker.js
33 8 2
export default function HomeContent()
in src/components/home/HomeContent.js
41 7 0
export function register()
in src/serviceWorker.js
22 5 1
render()
in src/components/Navbar.js
47 5 0
function checkValidServiceWorker()
in src/serviceWorker.js
23 4 2
function addImagesToList()
in src/components/photos/Photos.js
32 4 1
componentDidMount()
in src/components/auth/VerifyAccount.js
6 3 0
export function unregister()
in src/serviceWorker.js
7 2 0
function bytesToSize()
in src/components/PhotosAdmin.js
6 2 1
custom_header: async()
in src/index.js
3 1 0
async function getPresignedURLS()
in src/components/photos/Photos.js
6 1 2
async function getPhotoLabels()
in src/components/photos/Photos.js
17 1 1
function getImageDetails()
in src/components/PhotosAdmin.js
12 1 1
render()
in src/components/PhotosAdmin.js
20 1 0
render()
in src/components/auth/ChangePasswordConfirm.js
10 1 0
render()
in src/components/auth/ForgotPasswordVerification.js
67 1 0
export default function Welcome()
in src/components/auth/Welcome.js
14 1 0
export default function Home()
in src/components/Home.js
13 1 0