awslabs / performance-dashboard-on-aws
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 701 units with 16,311 lines of code in units (48.4% of code).
    • 2 very complex units (856 lines of code)
    • 5 complex units (1,494 lines of code)
    • 22 medium complex units (2,302 lines of code)
    • 64 simple units (3,315 lines of code)
    • 608 very simple units (8,344 lines of code)
5% | 9% | 14% | 20% | 51%
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
tsx6% | 16% | 18% | 24% | 33%
ts3% | 0% | 8% | 15% | 72%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
frontend/src/components18% | 21% | 19% | 17% | 22%
frontend/src/services18% | 0% | 9% | 11% | 60%
frontend/src/containers0% | 15% | 17% | 30% | 36%
backend/src/lib0% | 0% | 13% | 19% | 67%
frontend/src/layouts0% | 0% | 46% | 0% | 53%
frontend/src/hooks0% | 0% | 0% | 26% | 73%
frontend/src0% | 0% | 0% | 8% | 91%
cdk/lib/constructs0% | 0% | 0% | 3% | 96%
cdk/lib0% | 0% | 0% | 0% | 100%
cdk/lib/envconfig0% | 0% | 0% | 0% | 100%
backend/src/lambda0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function Table()
in frontend/src/components/Table.tsx
601 72 1
function moveWidget()
in frontend/src/services/OrderingService.ts
255 58 3
function AddChart()
in frontend/src/containers/AddChart.tsx
420 48 0
function VisualizeChart()
in frontend/src/components/VisualizeChart.tsx
421 40 1
function AddTable()
in frontend/src/containers/AddTable.tsx
353 31 0
function SectionWidget()
in frontend/src/components/SectionWidget.tsx
154 30 1
function ChartWidgetComponent()
in frontend/src/components/ChartWidget.tsx
146 28 1
message: t()
in frontend/src/containers/EditMetric.tsx
69 21 1
function MetricsList()
in frontend/src/components/MetricsList.tsx
225 21 1
message: t()
in frontend/src/containers/AddMetric.tsx
68 20 1
function Tabs()
in frontend/src/components/Tabs.tsx
89 18 1
async function updateSettings()
in backend/src/lib/controllers/settings-ctrl.ts
111 18 2
async function duplicateWidget()
in backend/src/lib/controllers/widget-ctrl.ts
78 18 2
function EditImage()
in frontend/src/containers/EditImage.tsx
264 17 0
function formatNumber()
in frontend/src/services/TickFormatter.ts
46 17 6
async function createDataset()
in backend/src/lib/controllers/ingestapi-ctrl.ts
88 17 2
async function getPublicHomepageWithQuery()
in backend/src/lib/controllers/homepage-ctrl.ts
67 16 2
async function updateDataset()
in backend/src/lib/controllers/ingestapi-ctrl.ts
72 16 2
function AddContent()
in frontend/src/containers/AddContent.tsx
113 15 0
function VisualizeTable()
in frontend/src/components/VisualizeTable.tsx
227 14 1