Skip to content
Snippets Groups Projects
Commit 9ae92b8c authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Add cop to make sure we don't use ivar in a module

parent 4cadf22e
No related branches found
No related tags found
No related merge requests found
Showing
with 21 additions and 0 deletions
# rubocop:disable Cop/ModuleWithInstanceVariables
module BoardsResponses
def authorize_read_list
authorize_action_for!(board.parent, :read_list)
Loading
Loading
# rubocop:disable Cop/ModuleWithInstanceVariables
module CreatesCommit
extend ActiveSupport::Concern
 
Loading
Loading
module CycleAnalyticsParams
extend ActiveSupport::Concern
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def options(params)
@options ||= { from: start_date(params), current_user: current_user }
end
Loading
Loading
# rubocop:disable Cop/ModuleWithInstanceVariables
module IssuableActions
extend ActiveSupport::Concern
 
Loading
Loading
# rubocop:disable Cop/ModuleWithInstanceVariables
module IssuableCollections
extend ActiveSupport::Concern
include SortingHelper
Loading
Loading
# rubocop:disable Cop/ModuleWithInstanceVariables
module IssuesAction
extend ActiveSupport::Concern
include IssuableCollections
Loading
Loading
Loading
Loading
@@ -90,6 +90,7 @@ module LfsRequest
has_authentication_ability?(:build_download_code) && can?(user, :build_download_code, project)
end
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def storage_project
@storage_project ||= begin
result = project
Loading
Loading
@@ -103,6 +104,7 @@ module LfsRequest
end
end
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def objects
@objects ||= (params[:objects] || []).to_a
end
Loading
Loading
Loading
Loading
@@ -76,6 +76,7 @@ module MembershipActions
end
end
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def source_type
@source_type ||= membershipable.class.to_s.humanize(capitalize: false)
end
Loading
Loading
# rubocop:disable Cop/ModuleWithInstanceVariables
module MergeRequestsAction
extend ActiveSupport::Concern
include IssuableCollections
Loading
Loading
# rubocop:disable Cop/ModuleWithInstanceVariables
module MilestoneActions
extend ActiveSupport::Concern
 
Loading
Loading
# rubocop:disable Cop/ModuleWithInstanceVariables
module NotesActions
include RendersNotes
extend ActiveSupport::Concern
Loading
Loading
Loading
Loading
@@ -13,6 +13,7 @@ module OauthApplications
end
end
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def load_scopes
@scopes = Doorkeeper.configuration.scopes
end
Loading
Loading
module RendersCommits
# rubocop:disable Cop/ModuleWithInstanceVariables
def prepare_commits_for_rendering(commits)
Banzai::CommitRenderer.render(commits, @project, current_user)
 
Loading
Loading
module RendersNotes
# rubocop:disable Cop/ModuleWithInstanceVariables
def prepare_notes_for_rendering(notes, noteable = nil)
preload_noteable_for_regular_notes(notes)
preload_max_access_for_authors(notes, @project)
Loading
Loading
Loading
Loading
@@ -17,6 +17,7 @@ module RequiresWhitelistedMonitoringClient
ip_whitelist.any? { |e| e.include?(Gitlab::RequestContext.client_ip) }
end
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def ip_whitelist
@ip_whitelist ||= Settings.monitoring.ip_whitelist.map(&IPAddr.method(:new))
end
Loading
Loading
Loading
Loading
@@ -65,6 +65,7 @@ module ServiceParams
# Parameters to ignore if no value is specified
FILTER_BLANK_PARAMS = [:password].freeze
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def service_params
dynamic_params = @service.event_channel_names + @service.event_names
service_params = params.permit(:id, service: ALLOWED_PARAMS_CE + dynamic_params)
Loading
Loading
Loading
Loading
@@ -4,6 +4,7 @@ module SnippetsActions
def edit
end
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def raw
disposition = params[:inline] == 'false' ? 'attachment' : 'inline'
 
Loading
Loading
Loading
Loading
@@ -17,6 +17,7 @@ module SpammableActions
 
private
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def ensure_spam_config_loaded!
return @spam_config_loaded if defined?(@spam_config_loaded)
 
Loading
Loading
Loading
Loading
@@ -11,6 +11,7 @@ module ToggleSubscriptionAction
 
private
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def subscribable_project
@project || raise(NotImplementedError)
end
Loading
Loading
Loading
Loading
@@ -17,6 +17,7 @@ module IgnorableColumn
super.reject { |column| ignored_columns.include?(column.name) }
end
 
# rubocop:disable Cop/ModuleWithInstanceVariables
def ignored_columns
@ignored_columns ||= Set.new
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment