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:
authorYorick Peterse <yorickpeterse@gmail.com>2018-08-27 18:31:01 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2018-09-11 18:32:00 +0300
commit2039c8280db1646845c33d6c5a74e5f23ca6f4de (patch)
treee2b3cd3012d9711cda7c6afb962ae4228d59521a /lib/gitlab/contributions_calendar.rb
parent91c40973dc620430b173ea2df968587d2a708dff (diff)
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/contributions_calendar.rb')
-rw-r--r--lib/gitlab/contributions_calendar.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/contributions_calendar.rb b/lib/gitlab/contributions_calendar.rb
index 58ca077e636..3236abfa43f 100644
--- a/lib/gitlab/contributions_calendar.rb
+++ b/lib/gitlab/contributions_calendar.rb
@@ -14,6 +14,7 @@ module Gitlab
end
end
+ # rubocop: disable CodeReuse/ActiveRecord
def activity_dates
return @activity_dates if @activity_dates.present?
@@ -36,7 +37,9 @@ module Gitlab
activities[event["date"]] += event["total_amount"]
end
end
+ # rubocop: enable CodeReuse/ActiveRecord
+ # rubocop: disable CodeReuse/ActiveRecord
def events_by_date(date)
return Event.none unless can_read_cross_project?
@@ -44,6 +47,7 @@ module Gitlab
.where(created_at: date.beginning_of_day..date.end_of_day)
.where(project_id: projects)
end
+ # rubocop: enable CodeReuse/ActiveRecord
def starting_year
1.year.ago.year
@@ -59,6 +63,7 @@ module Gitlab
Ability.allowed?(current_user, :read_cross_project)
end
+ # rubocop: disable CodeReuse/ActiveRecord
def event_counts(date_from, feature)
t = Event.arel_table
@@ -87,5 +92,6 @@ module Gitlab
.where(conditions)
.where("events.project_id in (#{authed_projects.to_sql})") # rubocop:disable GitlabSecurity/SqlInjection
end
+ # rubocop: enable CodeReuse/ActiveRecord
end
end