Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
682a3c01
Commit
682a3c01
authored
Sep 17, 2019
by
Peter Leitzen
Committed by
Douglas Barbosa Alexandre
Sep 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `except` from blacklist of `CodeReuse/ActiveRecord`
parent
c830aeee
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
12 additions
and
43 deletions
+12
-43
app/controllers/dashboard/todos_controller.rb
app/controllers/dashboard/todos_controller.rb
+1
-1
app/helpers/diff_helper.rb
app/helpers/diff_helper.rb
+0
-2
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+0
-2
app/helpers/safe_params_helper.rb
app/helpers/safe_params_helper.rb
+0
-2
app/services/applications/create_service.rb
app/services/applications/create_service.rb
+1
-1
app/services/issuable/clone/attributes_rewriter.rb
app/services/issuable/clone/attributes_rewriter.rb
+0
-2
app/services/milestones/update_service.rb
app/services/milestones/update_service.rb
+0
-2
app/services/projects/lfs_pointers/lfs_object_download_list_service.rb
...projects/lfs_pointers/lfs_object_download_list_service.rb
+1
-1
app/services/projects/propagate_service_template.rb
app/services/projects/propagate_service_template.rb
+0
-2
app/services/projects/update_service.rb
app/services/projects/update_service.rb
+0
-2
app/services/releases/update_service.rb
app/services/releases/update_service.rb
+0
-2
app/services/users/update_service.rb
app/services/users/update_service.rb
+1
-1
ee/app/controllers/projects/alerting/notifications_controller.rb
...controllers/projects/alerting/notifications_controller.rb
+1
-1
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
+1
-1
ee/app/services/ee/projects/operations/update_service.rb
ee/app/services/ee/projects/operations/update_service.rb
+1
-1
ee/app/services/geo/node_status_post_service.rb
ee/app/services/geo/node_status_post_service.rb
+1
-1
ee/app/services/security/store_report_service.rb
ee/app/services/security/store_report_service.rb
+1
-1
ee/lib/api/managed_licenses.rb
ee/lib/api/managed_licenses.rb
+0
-2
ee/lib/ee/api/settings.rb
ee/lib/ee/api/settings.rb
+0
-2
ee/lib/ee/gitlab/scim/params_parser.rb
ee/lib/ee/gitlab/scim/params_parser.rb
+0
-2
lib/api/pipelines.rb
lib/api/pipelines.rb
+0
-2
lib/api/project_container_repositories.rb
lib/api/project_container_repositories.rb
+1
-1
lib/file_size_validator.rb
lib/file_size_validator.rb
+0
-2
lib/gitlab/ci/config/entry/root.rb
lib/gitlab/ci/config/entry/root.rb
+2
-2
lib/gitlab/legacy_github_import/label_formatter.rb
lib/gitlab/legacy_github_import/label_formatter.rb
+0
-2
lib/gitlab/multi_collection_paginator.rb
lib/gitlab/multi_collection_paginator.rb
+0
-2
rubocop/cop/code_reuse/active_record.rb
rubocop/cop/code_reuse/active_record.rb
+0
-1
No files found.
app/controllers/dashboard/todos_controller.rb
View file @
682a3c01
...
...
@@ -84,7 +84,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
end
def
todos_page_count
(
todos
)
if
todo_params
.
except
(
:sort
,
:page
).
empty?
# rubocop: disable CodeReuse/ActiveRecord
if
todo_params
.
except
(
:sort
,
:page
).
empty?
(
current_user
.
todos_pending_count
.
to_f
/
todos
.
limit_value
).
ceil
else
todos
.
total_pages
...
...
app/helpers/diff_helper.rb
View file @
682a3c01
...
...
@@ -189,11 +189,9 @@ module DiffHelper
params
[
:w
]
==
'1'
end
# rubocop: disable CodeReuse/ActiveRecord
def
params_with_whitespace
hide_whitespace?
?
request
.
query_parameters
.
except
(
:w
)
:
request
.
query_parameters
.
merge
(
w:
1
)
end
# rubocop: enable CodeReuse/ActiveRecord
def
toggle_whitespace_link
(
url
,
options
)
options
[
:class
]
=
[
*
options
[
:class
],
'btn btn-default'
].
join
(
' '
)
...
...
app/helpers/projects_helper.rb
View file @
682a3c01
...
...
@@ -235,7 +235,6 @@ module ProjectsHelper
#
# If no limit is applied we'll just issue a COUNT since the result set could
# be too large to load into memory.
# rubocop: disable CodeReuse/ActiveRecord
def
any_projects?
(
projects
)
return
projects
.
any?
if
projects
.
is_a?
(
Array
)
...
...
@@ -245,7 +244,6 @@ module ProjectsHelper
projects
.
except
(
:offset
).
any?
end
end
# rubocop: enable CodeReuse/ActiveRecord
# TODO: Remove this method when removing the feature flag
# https://gitlab.com/gitlab-org/gitlab/merge_requests/11209#note_162234863
...
...
app/helpers/safe_params_helper.rb
View file @
682a3c01
...
...
@@ -3,7 +3,6 @@
module
SafeParamsHelper
# Rails 5.0 requires to permit `params` if they're used in url helpers.
# Use this helper when generating links with `params.merge(...)`
# rubocop: disable CodeReuse/ActiveRecord
def
safe_params
if
params
.
respond_to?
(
:permit!
)
params
.
except
(
:host
,
:port
,
:protocol
).
permit!
...
...
@@ -11,5 +10,4 @@ module SafeParamsHelper
params
end
end
# rubocop: enable CodeReuse/ActiveRecord
end
app/services/applications/create_service.rb
View file @
682a3c01
...
...
@@ -6,7 +6,7 @@ module Applications
def
initialize
(
current_user
,
params
)
@current_user
=
current_user
@params
=
params
.
except
(
:ip_address
)
# rubocop: disable CodeReuse/ActiveRecord
@params
=
params
.
except
(
:ip_address
)
end
# EE would override and use `request` arg
...
...
app/services/issuable/clone/attributes_rewriter.rb
View file @
682a3c01
...
...
@@ -45,11 +45,9 @@ module Issuable
original_entity
.
resource_label_events
.
find_in_batches
do
|
batch
|
events
=
batch
.
map
do
|
event
|
entity_key
=
new_entity
.
is_a?
(
Issue
)
?
'issue_id'
:
'epic_id'
# rubocop: disable CodeReuse/ActiveRecord
event
.
attributes
.
except
(
'id'
,
'reference'
,
'reference_html'
)
.
merge
(
entity_key
=>
new_entity
.
id
,
'action'
=>
ResourceLabelEvent
.
actions
[
event
.
action
])
# rubocop: enable CodeReuse/ActiveRecord
end
Gitlab
::
Database
.
bulk_insert
(
ResourceLabelEvent
.
table_name
,
events
)
...
...
app/services/milestones/update_service.rb
View file @
682a3c01
...
...
@@ -2,7 +2,6 @@
module
Milestones
class
UpdateService
<
Milestones
::
BaseService
# rubocop: disable CodeReuse/ActiveRecord
def
execute
(
milestone
)
state
=
params
[
:state_event
]
...
...
@@ -19,7 +18,6 @@ module Milestones
milestone
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
...
...
app/services/projects/lfs_pointers/lfs_object_download_list_service.rb
View file @
682a3c01
...
...
@@ -29,7 +29,7 @@ module Projects
# Getting all Lfs pointers already in the database and linking them to the project
linked_oids
=
LfsLinkService
.
new
(
project
).
execute
(
lfs_pointers_in_repository
.
keys
)
# Retrieving those oids not present in the database which we need to download
missing_oids
=
lfs_pointers_in_repository
.
except
(
*
linked_oids
)
# rubocop: disable CodeReuse/ActiveRecord
missing_oids
=
lfs_pointers_in_repository
.
except
(
*
linked_oids
)
# Downloading the required information and gathering it inside a LfsDownloadObject for each oid
LfsDownloadLinkListService
.
new
(
project
,
remote_uri:
current_endpoint_uri
).
execute
(
missing_oids
)
rescue
LfsDownloadLinkListService
::
DownloadLinksError
=>
e
...
...
app/services/projects/propagate_service_template.rb
View file @
682a3c01
...
...
@@ -70,7 +70,6 @@ module Projects
)
end
# rubocop: disable CodeReuse/ActiveRecord
def
service_hash
@service_hash
||=
begin
...
...
@@ -84,7 +83,6 @@ module Projects
end
end
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def
run_callbacks
(
batch
)
...
...
app/services/projects/update_service.rb
View file @
682a3c01
...
...
@@ -7,7 +7,6 @@ module Projects
ValidationError
=
Class
.
new
(
StandardError
)
# rubocop: disable CodeReuse/ActiveRecord
def
execute
remove_unallowed_params
validate!
...
...
@@ -31,7 +30,6 @@ module Projects
rescue
ValidationError
=>
e
error
(
e
.
message
)
end
# rubocop: enable CodeReuse/ActiveRecord
def
run_auto_devops_pipeline?
return
false
if
project
.
repository
.
gitlab_ci_yml
||
!
project
.
auto_devops
&
.
previous_changes
&
.
include?
(
'enabled'
)
...
...
app/services/releases/update_service.rb
View file @
682a3c01
...
...
@@ -26,10 +26,8 @@ module Releases
Ability
.
allowed?
(
current_user
,
:update_release
,
release
)
end
# rubocop: disable CodeReuse/ActiveRecord
def
empty_params?
params
.
except
(
:tag
).
empty?
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
app/services/users/update_service.rb
View file @
682a3c01
...
...
@@ -57,7 +57,7 @@ module Users
params
.
reject!
{
|
key
,
_
|
read_only
.
include?
(
key
.
to_sym
)
}
end
@user
.
assign_attributes
(
params
.
except
(
*
identity_attributes
))
unless
params
.
empty?
# rubocop: disable CodeReuse/ActiveRecord
@user
.
assign_attributes
(
params
.
except
(
*
identity_attributes
))
unless
params
.
empty?
end
def
assign_identity
...
...
ee/app/controllers/projects/alerting/notifications_controller.rb
View file @
682a3c01
...
...
@@ -46,7 +46,7 @@ module Projects
end
def
permitted_params
params
.
except
(
*
PARAMS_TO_EXCLUDE
).
permit!
# rubocop:disable CodeReuse/ActiveRecord
params
.
except
(
*
PARAMS_TO_EXCLUDE
).
permit!
end
end
end
...
...
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
View file @
682a3c01
...
...
@@ -47,7 +47,7 @@ module Security
def
normalize_report_occurrences
(
report_occurrences
)
report_occurrences
.
map
do
|
report_occurrence
|
occurrence_hash
=
report_occurrence
.
to_hash
.
except
(
:compare_key
,
:identifiers
,
:location
,
:scanner
)
# rubocop:disable CodeReuse/ActiveRecord
.
except
(
:compare_key
,
:identifiers
,
:location
,
:scanner
)
occurrence
=
Vulnerabilities
::
Occurrence
.
new
(
occurrence_hash
)
...
...
ee/app/services/ee/projects/operations/update_service.rb
View file @
682a3c01
...
...
@@ -37,7 +37,7 @@ module EE
if
regenerate_token
attr
[
:token
]
=
nil
else
attr
=
attr
.
except
(
:token
)
# rubocop: disable CodeReuse/ActiveRecord
attr
=
attr
.
except
(
:token
)
end
{
alerting_setting_attributes:
attr
}
...
...
ee/app/services/geo/node_status_post_service.rb
View file @
682a3c01
...
...
@@ -27,7 +27,7 @@ module Geo
private
def
payload
(
status
)
status
.
attributes
.
except
(
'id'
)
# rubocop: disable CodeReuse/ActiveRecord
status
.
attributes
.
except
(
'id'
)
end
def
handle_failure_for
(
response
)
...
...
ee/app/services/security/store_report_service.rb
View file @
682a3c01
...
...
@@ -54,7 +54,7 @@ module Security
}
create_params
=
occurrence
.
to_hash
.
except
(
:compare_key
,
:identifiers
,
:location
,
:scanner
)
# rubocop: disable CodeReuse/ActiveRecord
.
except
(
:compare_key
,
:identifiers
,
:location
,
:scanner
)
begin
project
.
vulnerabilities
...
...
ee/lib/api/managed_licenses.rb
View file @
682a3c01
...
...
@@ -89,7 +89,6 @@ module API
values:
%w(approved blacklisted)
,
desc:
'The approval status of the license. "blacklisted" or "approved".'
end
# rubocop: disable CodeReuse/ActiveRecord
patch
':id/managed_licenses/:managed_license_id'
,
requirements:
{
managed_license_id:
/.*/
}
do
authorize_can_admin!
break
not_found!
(
'SoftwareLicensePolicy'
)
unless
software_license_policy
...
...
@@ -106,7 +105,6 @@ module API
render_api_error!
(
result
[
:message
],
result
[
:http_status
])
end
end
# rubocop: enable CodeReuse/ActiveRecord
desc
'Delete an existing software license policy from a project'
do
success
EE
::
API
::
Entities
::
ManagedLicense
...
...
ee/lib/ee/api/settings.rb
View file @
682a3c01
...
...
@@ -10,7 +10,6 @@ module EE
extend
::
Gitlab
::
Utils
::
Override
override
:filter_attributes_using_license
# rubocop: disable CodeReuse/ActiveRecord
def
filter_attributes_using_license
(
attrs
)
unless
::
License
.
feature_available?
(
:repository_mirrors
)
attrs
=
attrs
.
except
(
*::
EE
::
ApplicationSettingsHelper
.
repository_mirror_attributes
)
...
...
@@ -30,7 +29,6 @@ module EE
attrs
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
end
...
...
ee/lib/ee/gitlab/scim/params_parser.rb
View file @
682a3c01
...
...
@@ -72,7 +72,6 @@ module EE
parse_params
.
merge
(
overwrites
)
end
# rubocop: disable CodeReuse/ActiveRecord
def
parse_params
# compact can remove :active if the value for that is nil
@params
.
except
(
:email
,
:name
).
compact
.
each_with_object
({})
do
|
(
param
,
value
),
hash
|
...
...
@@ -81,7 +80,6 @@ module EE
hash
[
attribute
]
=
coerce
(
value
)
if
attribute
end
end
# rubocop: enable CodeReuse/ActiveRecord
def
parse_emails
emails
=
@params
[
:emails
]
...
...
lib/api/pipelines.rb
View file @
682a3c01
...
...
@@ -46,7 +46,6 @@ module API
requires
:ref
,
type:
String
,
desc:
'Reference'
optional
:variables
,
Array
,
desc:
'Array of variables available in the pipeline'
end
# rubocop: disable CodeReuse/ActiveRecord
post
':id/pipeline'
do
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-foss/issues/42124'
)
...
...
@@ -67,7 +66,6 @@ module API
render_validation_error!
(
new_pipeline
)
end
end
# rubocop: enable CodeReuse/ActiveRecord
desc
'Gets a the latest pipeline for the project branch'
do
detail
'This feature was introduced in GitLab 12.3'
...
...
lib/api/project_container_repositories.rb
View file @
682a3c01
...
...
@@ -75,7 +75,7 @@ module API
render_api_error!
(
message
,
400
)
unless
obtain_new_cleanup_container_lease
CleanupContainerRepositoryWorker
.
perform_async
(
current_user
.
id
,
repository
.
id
,
declared_params
.
except
(
:repository_id
))
# rubocop: disable CodeReuse/ActiveRecord
declared_params
.
except
(
:repository_id
))
status
:accepted
end
...
...
lib/file_size_validator.rb
View file @
682a3c01
...
...
@@ -34,7 +34,6 @@ class FileSizeValidator < ActiveModel::EachValidator
end
end
# rubocop: disable CodeReuse/ActiveRecord
def
validate_each
(
record
,
attribute
,
value
)
raise
(
ArgumentError
,
"A CarrierWave::Uploader::Base object was expected"
)
unless
value
.
is_a?
CarrierWave
::
Uploader
::
Base
...
...
@@ -65,7 +64,6 @@ class FileSizeValidator < ActiveModel::EachValidator
record
.
errors
.
add
(
attribute
,
MESSAGES
[
key
],
errors_options
)
end
end
# rubocop: enable CodeReuse/ActiveRecord
def
help
Helper
.
instance
...
...
lib/gitlab/ci/config/entry/root.rb
View file @
682a3c01
...
...
@@ -132,12 +132,12 @@ module Gitlab
return
unless
@config
.
is_a?
(
Hash
)
@jobs_config
=
@config
.
except
(
*
self
.
class
.
reserved_nodes_names
)
# rubocop: disable CodeReuse/ActiveRecord
.
except
(
*
self
.
class
.
reserved_nodes_names
)
.
select
do
|
name
,
config
|
Entry
::
Jobs
.
find_type
(
name
,
config
).
present?
end
@config
=
@config
.
except
(
*
@jobs_config
.
keys
)
# rubocop: disable CodeReuse/ActiveRecord
@config
=
@config
.
except
(
*
@jobs_config
.
keys
)
end
end
end
...
...
lib/gitlab/legacy_github_import/label_formatter.rb
View file @
682a3c01
...
...
@@ -15,7 +15,6 @@ module Gitlab
:labels
end
# rubocop: disable CodeReuse/ActiveRecord
def
create!
params
=
attributes
.
except
(
:project
)
service
=
::
Labels
::
FindOrCreateService
.
new
(
nil
,
project
,
params
)
...
...
@@ -25,7 +24,6 @@ module Gitlab
label
end
# rubocop: enable CodeReuse/ActiveRecord
private
...
...
lib/gitlab/multi_collection_paginator.rb
View file @
682a3c01
...
...
@@ -55,7 +55,6 @@ module Gitlab
@first_collection_page_count
=
first_collection_page
.
total_pages
end
# rubocop: disable CodeReuse/ActiveRecord
def
first_collection_last_page_size
return
@first_collection_last_page_size
if
defined?
(
@first_collection_last_page_size
)
...
...
@@ -63,6 +62,5 @@ module Gitlab
.
except
(
:select
)
.
size
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
rubocop/cop/code_reuse/active_record.rb
View file @
682a3c01
...
...
@@ -27,7 +27,6 @@ module RuboCop
create_with:
true
,
distinct:
false
,
eager_load:
true
,
except:
true
,
exists?:
true
,
find_by:
true
,
find_by!:
true
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment