microsoft / opensource-management-portal
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 2,056 units with 29,009 lines of code in units (53.1% of code).
    • 6 very complex units (1,100 lines of code)
    • 17 complex units (2,128 lines of code)
    • 126 medium complex units (6,416 lines of code)
    • 235 simple units (5,879 lines of code)
    • 1,672 very simple units (13,486 lines of code)
3% | 7% | 22% | 20% | 46%
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
ts3% | 7% | 22% | 20% | 46%
js0% | 0% | 0% | 33% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
api25% | 9% | 19% | 21% | 22%
jobs7% | 22% | 31% | 9% | 29%
features24% | 0% | 32% | 21% | 20%
middleware5% | 4% | 33% | 23% | 33%
routes0% | 14% | 23% | 19% | 41%
business0% | 3% | 15% | 24% | 55%
webhooks0% | 29% | 41% | 7% | 21%
user0% | 19% | 0% | 20% | 59%
lib0% | 0% | 22% | 22% | 54%
entities0% | 0% | 9% | 3% | 87%
github0% | 0% | 9% | 20% | 69%
ROOT0% | 0% | 0% | 35% | 64%
config0% | 0% | 0% | 80% | 19%
scripts0% | 0% | 0% | 75% | 24%
default-assets-package0% | 0% | 0% | 0% | 100%
interfaces0% | 0% | 0% | 0% | 100%
views0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export default function SiteErrorHandler()
in middleware/errorHandler.ts
149 85 4
268 79 7
async lockdownIfNecessary()
in features/newRepositoryLockdown.ts
235 63 4
reasons: transformReasonsToArray()
in jobs/reports/repositories.ts
122 61 2
async function processRepository()
in jobs/reports/repositories.ts
164 56 2
async function sendEmail()
in api/createRepo.ts
162 51 12
162 46 3
176 45 1
async function processTeam()
in jobs/reports/teams.ts
143 44 2
export async function sendTerminatedAccountMail()
in business/operations/unlinkMail.ts
156 39 5
137 38 5
async function getOrganizationData()
in jobs/reports/organizations.ts
136 33 1
async run()
in webhooks/tasks/repository.ts
78 31 3
async run()
in webhooks/tasks/team.ts
82 31 3
232 30 6
async function refreshOrganization()
in jobs/refreshQueryCache/task.ts
181 29 5
export default asyncHandler()
in routes/reposPager.ts
116 29 3
render()
in user/index.ts
94 29 1
async function processDeletedRepositories()
in jobs/refreshQueryCache/deletedRepositories.ts
133 27 1
78 27 2