Compare commits

...

7 Commits

Author SHA1 Message Date
cclecle
eee2bf551c bvlabnaal 2023-03-23 23:02:57 +00:00
cclecle
01ce809823 add missing import 2023-03-23 22:57:14 +00:00
cclecle
4ab70409a0 switch to BigDecimal grrrrr 2023-03-23 22:49:08 +00:00
cclecle
7b9752a17a cast to decimalformat 2023-03-23 22:47:52 +00:00
cclecle
879a7ca03d fix wrong method name :-/ 2023-03-23 22:42:07 +00:00
cclecle
bd3389aeb2 cast to double + fix complexity 2023-03-23 22:37:45 +00:00
cclecle
886a22bef2 add missing java lib in groovy 2023-03-23 22:23:57 +00:00

10
Jenkinsfile vendored
View File

@@ -11,6 +11,8 @@ import static javax.xml.xpath.XPathConstants.*
import javax.xml.xpath.*
import groovy.xml.DOMBuilder
import groovy.xml.dom.DOMCategory
import java.math.RoundingMode
import java.math.BigDecimal
// configurable settings:
// use to send email if workflow problem
@@ -90,7 +92,7 @@ int GetCoverageValue_line_rate(String CoverageFilePath) { return GetCoverageValu
int GetCoverageValue_branches_valid(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-valid") }
int GetCoverageValue_branches_covered(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-covered") }
int GetCoverageValue_branch_rate(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branch-rate") }
int GetCoverageValue_branches_complexity(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-complexity") }
int GetCoverageValue_complexity(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@complexity") }
pipeline {
@@ -438,13 +440,13 @@ pipeline {
println GetCoverageValue_branches_valid(coverage_report_path)
println GetCoverageValue_branches_covered(coverage_report_path)
println GetCoverageValue_branch_rate(coverage_report_path)
println GetCoverageValue_branches_complexity(coverage_report_path)
println GetCoverageValue_complexity(coverage_report_path)
full_rate = (GetCoverageValue_line_rate(coverage_report_path) + GetCoverageValue_branch_rate(coverage_report_path)) / 2
full_rate = new BigDecimal( (GetCoverageValue_line_rate(coverage_report_path) + GetCoverageValue_branch_rate(coverage_report_path)) / 2 )
sz_full_rate =Float.toString(full_rate.setScale(2, RoundingMode.HALF_EVEN))
badge_coverage.setStatus(sz_full_rate)
complexity = GetCoverageValue_branches_complexity(coverage_report_path)
complexity = new BigDecimal( GetCoverageValue_complexity(coverage_report_path))
sz_complexity =Float.toString(complexity.setScale(2, RoundingMode.HALF_EVEN))
badge_complexity.setStatus(sz_complexity)
}