diff --git a/src/main/kotlin/de/fraunhofer/iem/dataprovider/kpi/enumeration/KpiKind.kt b/src/main/kotlin/de/fraunhofer/iem/dataprovider/kpi/enumeration/KpiKind.kt index 920adcce1cba50dfe6e1eef558e0fff7f2e87b98..e09afe3b8deade5a328cbc55e3deb87f88682cce 100644 --- a/src/main/kotlin/de/fraunhofer/iem/dataprovider/kpi/enumeration/KpiKind.kt +++ b/src/main/kotlin/de/fraunhofer/iem/dataprovider/kpi/enumeration/KpiKind.kt @@ -174,15 +174,18 @@ enum class KpiKind { return KPITreeResponseDto( value = value, name = this.getName(), - description = "Used to approximate the the availability of documentation " + - "based upon the availability of, e.g., a wiki, and/or a docs folder.", + description = "Used to assess compliance with a common development process and" + + " certain software quality standards. For this purpose, it is checked whether " + + "the repository provides documentation for the software made available. It should " + + "be noted that this is not a sufficient criterion, since in this case only the existence " + + "of certain folders or wiki pages is checked.", children = children, isEmpty = isEmpty ) } override fun getName(): String { - return "Documentation Infrastructure" + return "Existence of Documentation Infrastructure" } }, @@ -209,6 +212,50 @@ enum class KpiKind { return "Commit Signature Ratio" } }, + INTERNAL_QUALITY { + override fun toViewModel( + value: Int, + children: List<KPITreeChildResponseDto>, + isEmpty: Boolean + ): KPITreeResponseDto { + return KPITreeResponseDto( + value = value, + name = this.getName(), + description = "Assesses software quality from a developer perspective" + + " and includes metrics for code quality, maintainability, readability and testability.", + children = children, + isEmpty = isEmpty, + order = 3 + ) + } + + override fun getName(): String { + return "Internal Quality" + } + }, + EXTERNAL_QUALITY { + override fun toViewModel( + value: Int, + children: List<KPITreeChildResponseDto>, + isEmpty: Boolean + ): KPITreeResponseDto { + return KPITreeResponseDto( + value = value, + name = this.getName(), + description = "Assesses the software quality from the user's perspective " + + "and includes metrics for the fulfillment of functional requirements, user-friendliness, " + + "reliability and performance." + + "has context menu", + children = children, + isEmpty = isEmpty, + order = 3 + ) + } + + override fun getName(): String { + return "External Quality" + } + }, PROCESS_COMPLIANCE { override fun toViewModel( value: Int, @@ -223,7 +270,7 @@ enum class KpiKind { " compared with common development standards to enable an assessment.", children = children, isEmpty = isEmpty, - order = 4 + order = 5 ) } @@ -246,7 +293,7 @@ enum class KpiKind { "about the software development process within the repository.", children = children, isEmpty = isEmpty, - order = 3 + order = 4 ) } diff --git a/src/main/kotlin/de/fraunhofer/iem/dataprovider/kpi/service/KPIService.kt b/src/main/kotlin/de/fraunhofer/iem/dataprovider/kpi/service/KPIService.kt index cfe145a51bbdef99a8f08738f4a41cdabb65f977..f0db4f5945ac51befd7b31c03388f400618629aa 100644 --- a/src/main/kotlin/de/fraunhofer/iem/dataprovider/kpi/service/KPIService.kt +++ b/src/main/kotlin/de/fraunhofer/iem/dataprovider/kpi/service/KPIService.kt @@ -224,7 +224,7 @@ class KPIService( kind = KpiKind.PROCESS_TRANSPARENCY, calculationStrategy = AggregationKPICalculationStrategy() ) - processTransparencyKPI.addChildKPI(documentationKpi, 0.5) + processComplianceKPI.addChildKPI(documentationKpi, 0.5) processTransparencyKPI.addChildKPI(signedCommitsRatioKPI, 0.5) val securityKPI = KpiCalculationDto( @@ -232,6 +232,19 @@ class KPIService( calculationStrategy = AggregationKPICalculationStrategy() ) + val internalQuality = KpiCalculationDto( + kind = KpiKind.INTERNAL_QUALITY, + calculationStrategy = AggregationKPICalculationStrategy() + ) + + val externalQuality = KpiCalculationDto( + kind = KpiKind.EXTERNAL_QUALITY, + calculationStrategy = AggregationKPICalculationStrategy() + ) + + externalQuality.addChildKPI(documentationKpi, 1.0) + internalQuality.addChildKPI(documentationKpi, 1.0) + val maximalDependencyVulnerabilityKPI = KpiCalculationDto( kind = KpiKind.MAXIMAL_VULNERABILITY, calculationStrategy = MaximumKPICalculationStrategy() @@ -262,9 +275,11 @@ class KPIService( calculationStrategy = AggregationKPICalculationStrategy(), ) - rootKPI.addChildKPI(processTransparencyKPI, 0.25) - rootKPI.addChildKPI(processComplianceKPI, 0.25) - rootKPI.addChildKPI(securityKPI, 0.5) + rootKPI.addChildKPI(processTransparencyKPI, 0.1) + rootKPI.addChildKPI(processComplianceKPI, 0.1) + rootKPI.addChildKPI(internalQuality, 0.15) + rootKPI.addChildKPI(externalQuality, 0.25) + rootKPI.addChildKPI(securityKPI, 0.4) return rootKPI }