diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-08-27 17:31:01 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-09-11 17:32:00 +0200 |
commit | 2039c8280db1646845c33d6c5a74e5f23ca6f4de (patch) | |
tree | e2b3cd3012d9711cda7c6afb962ae4228d59521a /lib/gitlab/ci/reports | |
parent | 91c40973dc620430b173ea2df968587d2a708dff (diff) | |
download | gitlab-ce-2039c8280db1646845c33d6c5a74e5f23ca6f4de.tar.gz |
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
Diffstat (limited to 'lib/gitlab/ci/reports')
-rw-r--r-- | lib/gitlab/ci/reports/test_reports.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/reports/test_reports_comparer.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/reports/test_suite.rb | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/ci/reports/test_reports.rb b/lib/gitlab/ci/reports/test_reports.rb index c6e732e68eb..c87bdb4a8a2 100644 --- a/lib/gitlab/ci/reports/test_reports.rb +++ b/lib/gitlab/ci/reports/test_reports.rb @@ -12,13 +12,17 @@ module Gitlab test_suites[suite_name] ||= TestSuite.new(suite_name) end + # rubocop: disable CodeReuse/ActiveRecord def total_time test_suites.values.sum(&:total_time) end + # rubocop: enable CodeReuse/ActiveRecord + # rubocop: disable CodeReuse/ActiveRecord def total_count test_suites.values.sum(&:total_count) end + # rubocop: enable CodeReuse/ActiveRecord def total_status if failed_count > 0 || error_count > 0 @@ -30,7 +34,9 @@ module Gitlab TestCase::STATUS_TYPES.each do |status_type| define_method("#{status_type}_count") do + # rubocop: disable CodeReuse/ActiveRecord test_suites.values.sum { |suite| suite.public_send("#{status_type}_count") } # rubocop:disable GitlabSecurity/PublicSend + # rubocop: enable CodeReuse/ActiveRecord end end end diff --git a/lib/gitlab/ci/reports/test_reports_comparer.rb b/lib/gitlab/ci/reports/test_reports_comparer.rb index c0943f5a51a..726c6a11a81 100644 --- a/lib/gitlab/ci/reports/test_reports_comparer.rb +++ b/lib/gitlab/ci/reports/test_reports_comparer.rb @@ -29,7 +29,9 @@ module Gitlab %w(total_count resolved_count failed_count).each do |method| define_method(method) do + # rubocop: disable CodeReuse/ActiveRecord suite_comparers.sum { |suite| suite.public_send(method) } # rubocop:disable GitlabSecurity/PublicSend + # rubocop: enable CodeReuse/ActiveRecord end end end diff --git a/lib/gitlab/ci/reports/test_suite.rb b/lib/gitlab/ci/reports/test_suite.rb index b722d0ba735..b5f15397c0f 100644 --- a/lib/gitlab/ci/reports/test_suite.rb +++ b/lib/gitlab/ci/reports/test_suite.rb @@ -21,9 +21,11 @@ module Gitlab @total_time += test_case.execution_time end + # rubocop: disable CodeReuse/ActiveRecord def total_count test_cases.values.sum(&:count) end + # rubocop: enable CodeReuse/ActiveRecord def total_status if failed_count > 0 || error_count > 0 |