aws-samples / designing-cloud-native-microservices-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 187 units with 1,151 lines of code in units (47.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 0 simple units (0 lines of code)
    • 187 very simple units (1,151 lines of code)
0% | 0% | 0% | 0% | 100%
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
java0% | 0% | 0% | 0% | 100%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sources/coffeeshop/orders-domain0% | 0% | 0% | 0% | 100%
deployment/coffeeshop-cdk/lib0% | 0% | 0% | 0% | 100%
sources/coffeeshop/infrastructure0% | 0% | 0% | 0% | 100%
sources/coffeeshop/ddd-commons0% | 0% | 0% | 0% | 100%
sources/coffeeshop/orders-application0% | 0% | 0% | 0% | 100%
sources/coffeeshop/coffee-application0% | 0% | 0% | 0% | 100%
sources/coffeeshop/coffee-sls0% | 0% | 0% | 0% | 100%
sources/coffeeshop/coffee-domain0% | 0% | 0% | 0% | 100%
sources/coffeeshop/inventory-sls0% | 0% | 0% | 0% | 100%
sources/coffeeshop/orders-web0% | 0% | 0% | 0% | 100%
sources/coffeeshop/inventory-web0% | 0% | 0% | 0% | 100%
sources/coffeeshop/inventory-domain0% | 0% | 0% | 0% | 100%
sources/coffeeshop/service-discovery0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public boolean equals()
in sources/coffeeshop/ddd-commons/src/main/java/solid/humank/ddd/commons/baseclasses/Enumeration.java
7 5 1
public void when()
in sources/coffeeshop/orders-domain/src/main/java/solid/humank/coffeeshop/order/models/Order.java
18 5 1
public static void Verify()
in sources/coffeeshop/orders-domain/src/main/java/solid/humank/coffeeshop/order/policies/OrderPolicy.java
11 5 1
public Response createOrder()
in sources/coffeeshop/orders-web/src/main/java/solid/humank/coffeeshop/order/controllers/OrderResource.java
15 3 1
public void changeItem()
in sources/coffeeshop/orders-domain/src/main/java/solid/humank/coffeeshop/order/models/Order.java
9 3 1
private void verifyStatus()
in sources/coffeeshop/orders-domain/src/main/java/solid/humank/coffeeshop/order/models/Order.java
8 3 2
private Properties getCWEParameters()
in sources/coffeeshop/infrastructure/src/main/java/solid/humank/coffeeshop/infra/adapters/CloudWatchEventAdapter.java
16 3 0
public Object handleRequest()
in sources/coffeeshop/inventory-sls/src/main/java/helloworld/App.java
12 2 2
public List translate()
in sources/coffeeshop/orders-application/src/main/java/solid/humank/coffeeshop/order/domainservices/OrderItemsTranslator.java
14 2 1
public String modifiedDateString()
in sources/coffeeshop/coffee-domain/src/main/java/solid/humank/coffeeshop/coffee/models/Coffee.java
4 2 0
static
in sources/coffeeshop/coffee-domain/src/main/java/solid/humank/coffeeshop/coffee/models/CoffeeStatus.java
5 2 0
protected EntityId()
in sources/coffeeshop/ddd-commons/src/main/java/solid/humank/ddd/commons/baseclasses/EntityId.java
7 2 2
protected void applyEvent()
in sources/coffeeshop/ddd-commons/src/main/java/solid/humank/ddd/commons/baseclasses/Entity.java
4 2 1
public LocalDateTime deserialize()
in sources/coffeeshop/ddd-commons/src/main/java/solid/humank/ddd/commons/utilities/MillisOrLocalDateTimeDeserializer.java
8 2 2
public String writeToJsonString()
in sources/coffeeshop/ddd-commons/src/main/java/solid/humank/ddd/commons/utilities/DomainModelMapper.java
9 2 1
public T readValue()
in sources/coffeeshop/ddd-commons/src/main/java/solid/humank/ddd/commons/utilities/DomainModelMapper.java
9 2 2
public T readValue()
in sources/coffeeshop/ddd-commons/src/main/java/solid/humank/ddd/commons/utilities/DomainModelMapper.java
9 2 2
static
in sources/coffeeshop/orders-domain/src/main/java/solid/humank/coffeeshop/order/OrderErrorCode.java
5 2 0
public StatusTransitionSpec()
in sources/coffeeshop/orders-domain/src/main/java/solid/humank/coffeeshop/order/specifications/StatusTransitionSpec.java
5 2 3
public String modifiedDateString()
in sources/coffeeshop/orders-domain/src/main/java/solid/humank/coffeeshop/order/models/Order.java
4 2 0