opensearch-project / alerting
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 651 units with 6,239 lines of code in units (44.0% of code).
    • 2 very long units (257 lines of code)
    • 7 long units (408 lines of code)
    • 53 medium size units (1,603 lines of code)
    • 123 small units (1,820 lines of code)
    • 466 very small units (2,151 lines of code)
4% | 6% | 25% | 29% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
kt4% | 7% | 25% | 30% | 32%
java0% | 0% | 30% | 17% | 52%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
alerting/src/main/kotlin/org/opensearch/alerting18% | 15% | 41% | 12% | 11%
alerting/src/main/kotlin/org/opensearch/alerting/aggregation34% | 16% | 6% | 24% | 17%
alerting/src/main/kotlin/org/opensearch/alerting/model0% | 13% | 25% | 24% | 36%
core/src/main/kotlin/org/opensearch/alerting/core0% | 10% | 9% | 28% | 52%
alerting/src/main/kotlin/org/opensearch/alerting/transport0% | 0% | 35% | 40% | 23%
notification/src/main/java/org/opensearch/alerting/destination0% | 0% | 30% | 17% | 52%
alerting/src/main/kotlin/org/opensearch/alerting/util0% | 0% | 68% | 18% | 13%
alerting/src/main/kotlin/org/opensearch/alerting/resthandler0% | 0% | 16% | 56% | 27%
alerting/src/main/kotlin/org/opensearch/alerting/action0% | 0% | 0% | 21% | 78%
alerting/src/main/kotlin/org/opensearch/alerting/alerts0% | 0% | 0% | 32% | 67%
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%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
suspend fun runBucketLevelMonitor()
in alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunner.kt
148 31 4
fun parse()
in alerting/src/main/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregationBuilder.kt
109 14 2
fun parse()
in alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Destination.kt
69 4 5
fun composeQueryLevelAlert()
in alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt
62 12 3
fun publish()
in alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Destination.kt
60 1 4
override fun getSettings()
in alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt
57 1 0
fun parse()
in core/src/main/kotlin/org/opensearch/alerting/core/model/Schedule.kt
55 7 1
fun parse()
in alerting/src/main/kotlin/org/opensearch/alerting/model/action/Action.kt
54 6 1
override fun doReduce()
in alerting/src/main/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregator.kt
51 13 2
private CustomWebhookMessage()
in notification/src/main/java/org/opensearch/alerting/destination/message/CustomWebhookMessage.java
49 14 13
suspend fun collectInputResults()
in alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt
49 2 4
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 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/TransportExecuteMonitorAction.kt
42 4 3
override fun doExecute()
in alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetAlertsAction.kt
42 6 3
override fun doExecute()
in alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetDestinationsAction.kt
41 5 3
suspend fun saveNewAlerts()
in alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt
39 7 2
fun updateActionResultsForBucketLevelAlert()
in alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt
38 4 3
private EmailMessage()
in notification/src/main/java/org/opensearch/alerting/destination/message/EmailMessage.java
37 10 11