Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/reports/codequality_reports.rb')
-rw-r--r--lib/gitlab/ci/reports/codequality_reports.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/ci/reports/codequality_reports.rb b/lib/gitlab/ci/reports/codequality_reports.rb
index 3196bf3fc6d..aba2d2e8b19 100644
--- a/lib/gitlab/ci/reports/codequality_reports.rb
+++ b/lib/gitlab/ci/reports/codequality_reports.rb
@@ -42,6 +42,18 @@ module Gitlab
rescue StandardError => _
false
end
+
+ def code_quality_report_summary
+ report_degradations = @degradations.presence
+ return if report_degradations.nil?
+
+ summary = ::Gitlab::Ci::Reports::CodequalityReports::SEVERITY_PRIORITIES.keys.index_with(0)
+ report_degradations.each_value do |degradation|
+ summary[degradation[:severity]] += 1
+ end
+ summary['count'] = summary.values.sum
+ summary
+ end
end
end
end