opensearch-project / alerting
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 651 units with 6,239 lines of code in units (44.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (148 lines of code)
    • 4 medium complex units (271 lines of code)
    • 15 simple units (503 lines of code)
    • 631 very simple units (5,317 lines of code)
0% | 2% | 4% | 8% | 85%
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
kt0% | 2% | 3% | 6% | 86%
java0% | 0% | 9% | 24% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
alerting/src/main/kotlin/org/opensearch/alerting0% | 18% | 7% | 4% | 68%
alerting/src/main/kotlin/org/opensearch/alerting/aggregation0% | 0% | 50% | 5% | 43%
notification/src/main/java/org/opensearch/alerting/destination0% | 0% | 9% | 24% | 66%
alerting/src/main/kotlin/org/opensearch/alerting/model0% | 0% | 0% | 10% | 89%
core/src/main/kotlin/org/opensearch/alerting/core0% | 0% | 0% | 13% | 86%
alerting/src/main/kotlin/org/opensearch/alerting/util0% | 0% | 0% | 26% | 73%
alerting/src/main/kotlin/org/opensearch/alerting/transport0% | 0% | 0% | 3% | 96%
alerting/src/main/kotlin/org/opensearch/alerting/resthandler0% | 0% | 0% | 0% | 100%
alerting/src/main/kotlin/org/opensearch/alerting/action0% | 0% | 0% | 0% | 100%
alerting/src/main/kotlin/org/opensearch/alerting/alerts0% | 0% | 0% | 0% | 100%
core/src/main/kotlin/org/opensearch/alerting/elasticapi0% | 0% | 0% | 0% | 100%
alerting/src/main/kotlin/org/opensearch/alerting/script0% | 0% | 0% | 0% | 100%
alerting/src/main/kotlin/org/opensearch/alerting/settings0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
suspend fun runBucketLevelMonitor()
in alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunner.kt
148 31 4
private CustomWebhookMessage()
in notification/src/main/java/org/opensearch/alerting/destination/message/CustomWebhookMessage.java
49 14 13
fun parse()
in alerting/src/main/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregationBuilder.kt
109 14 2
override fun doReduce()
in alerting/src/main/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregator.kt
51 13 2
fun composeQueryLevelAlert()
in alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt
62 12 3
private EmailMessage()
in notification/src/main/java/org/opensearch/alerting/destination/message/EmailMessage.java
37 10 11
fun parse()
in alerting/src/main/kotlin/org/opensearch/alerting/model/action/ActionExecutionScope.kt
49 9 1
public String execute()
in notification/src/main/java/org/opensearch/alerting/destination/client/DestinationEmailClient.java
45 8 1
fun rewriteQuery()
in alerting/src/main/kotlin/org/opensearch/alerting/util/AggregationQueryRewriter.kt
32 8 3
suspend fun saveNewAlerts()
in alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt
39 7 2
override fun equals()
in alerting/src/main/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregationBuilder.kt
11 7 1
fun getSchemaVersion()
in alerting/src/main/kotlin/org/opensearch/alerting/util/IndexUtils.kt
28 7 1
fun parse()
in core/src/main/kotlin/org/opensearch/alerting/core/model/Schedule.kt
55 7 1
private CloseableHttpResponse getHttpResponse()
in notification/src/main/java/org/opensearch/alerting/destination/client/DestinationHttpClient.java
25 6 1
protected URI buildUri()
in notification/src/main/java/org/opensearch/alerting/destination/message/BaseMessage.java
19 6 6
override fun equals()
in alerting/src/main/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorIndices.kt
7 6 1
fun parse()
in alerting/src/main/kotlin/org/opensearch/alerting/model/action/Action.kt
54 6 1
fun parseInner()
in alerting/src/main/kotlin/org/opensearch/alerting/model/QueryLevelTrigger.kt
42 6 1
override fun doExecute()
in alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetAlertsAction.kt
42 6 3
override fun postIndex()
in core/src/main/kotlin/org/opensearch/alerting/core/JobSweeper.kt
18 6 3