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 /app/finders/admin | |
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 'app/finders/admin')
-rw-r--r-- | app/finders/admin/projects_finder.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/finders/admin/projects_finder.rb b/app/finders/admin/projects_finder.rb index 543bf1a1415..6b805c432f6 100644 --- a/app/finders/admin/projects_finder.rb +++ b/app/finders/admin/projects_finder.rb @@ -6,6 +6,7 @@ class Admin::ProjectsFinder @current_user = current_user end + # rubocop: disable CodeReuse/ActiveRecord def execute items = Project.without_deleted.with_statistics.with_route items = by_namespace_id(items) @@ -19,6 +20,7 @@ class Admin::ProjectsFinder items = items.includes(namespace: [:owner, :route]) sort(items).page(params[:page]) end + # rubocop: enable CodeReuse/ActiveRecord private @@ -26,9 +28,11 @@ class Admin::ProjectsFinder params[:namespace_id].present? ? items.in_namespace(params[:namespace_id]) : items end + # rubocop: disable CodeReuse/ActiveRecord def by_visibilty_level(items) params[:visibility_level].present? ? items.where(visibility_level: params[:visibility_level]) : items end + # rubocop: enable CodeReuse/ActiveRecord def by_with_push(items) params[:with_push].present? ? items.with_push : items @@ -38,9 +42,11 @@ class Admin::ProjectsFinder params[:abandoned].present? ? items.abandoned : items end + # rubocop: disable CodeReuse/ActiveRecord def by_last_repository_check_failed(items) params[:last_repository_check_failed].present? ? items.where(last_repository_check_failed: true) : items end + # rubocop: enable CodeReuse/ActiveRecord def by_archived(items) if params[:archived] == 'only' |