aws-samples / one-observability-demo
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 341 units with 4,524 lines of code in units (41.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (465 lines of code)
    • 10 simple units (350 lines of code)
    • 330 very simple units (3,709 lines of code)
0% | 0% | 10% | 7% | 81%
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
ts0% | 0% | 57% | 10% | 32%
go0% | 0% | 0% | 9% | 90%
cs0% | 0% | 0% | 6% | 93%
java0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
PetAdoptions/cdk0% | 0% | 18% | 8% | 72%
PetAdoptions/payforadoption-go0% | 0% | 0% | 16% | 83%
PetAdoptions/petsite0% | 0% | 0% | 8% | 91%
PetAdoptions/petsearch0% | 0% | 0% | 19% | 80%
PetAdoptions/petlistadoptions-go0% | 0% | 0% | 0% | 100%
PetAdoptions/petsearch-java0% | 0% | 0% | 0% | 100%
PetAdoptions/payforadoption0% | 0% | 0% | 0% | 100%
PetAdoptions/petlistadoptions0% | 0% | 0% | 0% | 100%
PetAdoptions/trafficgenerator0% | 0% | 0% | 0% | 100%
PetAdoptions/petstatusupdater0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
constructor()
in PetAdoptions/cdk/pet_stack/lib/services.ts
465 12 3
private async Task GetPetDetails()
in PetAdoptions/cdk/pet_stack/resources/microservices/petsite/petsite/Controllers/HomeController.cs
24 10 3
private async Task GetPetDetails()
in PetAdoptions/petsite/petsite/Controllers/HomeController.cs
24 10 3
func fetchConfigFromParameterStore()
in PetAdoptions/payforadoption-go/config.go
32 7 1
func fetchConfigFromParameterStore()
in PetAdoptions/cdk/pet_stack/resources/microservices/payforadoption-go/config.go
32 7 1
private async Task GetPetDetails()
in PetAdoptions/cdk/pet_stack/resources/microservices/petsite/petsite/Controllers/AdoptionController.cs
8 7 1
private async Task GetPetDetails()
in PetAdoptions/petsite/petsite/Controllers/AdoptionController.cs
8 7 1
public async Task Get()
in PetAdoptions/petsearch/petsearch/Controllers/SearchController.cs
26 7 1
func()
in PetAdoptions/payforadoption-go/payforadoption/repository.go
57 6 1
constructor()
in PetAdoptions/cdk/pet_stack/lib/services/ecs-service.ts
82 6 3
func()
in PetAdoptions/cdk/pet_stack/resources/microservices/payforadoption-go/payforadoption/repository.go
57 6 1
public List search()
in PetAdoptions/petsearch-java/src/main/java/ca/petsearch/controllers/SearchController.java
25 5 3
func()
in PetAdoptions/payforadoption-go/payforadoption/repository.go
25 5 1
public List search()
in PetAdoptions/cdk/pet_stack/resources/microservices/petsearch-java/src/main/java/ca/petsearch/controllers/SearchController.java
25 5 3
func()
in PetAdoptions/cdk/pet_stack/resources/microservices/payforadoption-go/payforadoption/repository.go
25 5 1
func()
in PetAdoptions/cdk/pet_stack/resources/microservices/petlistadoptions-go/petlistadoptions/repository.go
38 5 1
func fetchConfigFromParameterStore()
in PetAdoptions/cdk/pet_stack/resources/microservices/petlistadoptions-go/config.go
24 5 1
func()
in PetAdoptions/petlistadoptions-go/petlistadoptions/repository.go
38 5 1
func fetchConfigFromParameterStore()
in PetAdoptions/petlistadoptions-go/config.go
24 5 1
func()
in PetAdoptions/payforadoption-go/payforadoption/service.go
25 4 1