Showing 98 of 164 total issues
Avoid too many return
statements within this method. Open
return false if banned_from_group?
Avoid too many return
statements within this method. Open
return false if group.closed? && !member?
Avoid too many return
statements within this method. Open
return false if group.closed? && !member?
Avoid too many return
statements within this method. Open
return true if group && has_group_permission?(:content)
Avoid too many return
statements within this method. Open
return true if group && has_group_permission?(:content)
Avoid too many return
statements within this method. Open
return false if user.has_role?(:banned)
Avoid too many return
statements within this method. Open
return false if group.restricted? && !has_group_permission?(:content)
Avoid too many return
statements within this method. Open
return false unless /[a-z]{2}(_[a-z]{2})?/.match?(title)
Avoid too many return
statements within this method. Open
return false if banned_from_group?
Method trace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.trace(key, data)
if key.start_with?('execute_query')
# Set the transaction name based on the operation type and name
selected_op = data[:query].selected_operation
if selected_op
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method validate_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_value(name, value, target)
return unless target
return if target === value # rubocop:disable Style/CaseEquality
if target.respond_to?(:begin) && target.respond_to?(:end)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method apply
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply(relation, _order_options)
if offset?
paginator.apply(relation, _order_options)
else
# We apply the PagedPaginator logic ourselves because it uses offset/limit
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method resolve
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def resolve(**input)
AccountMutator.create(**input)
rescue ActiveRecord::RecordInvalid => e
validation_errors = Types::Errors::Validation.for_record(e.record, transform_path: ->(path) {
path = path.map { |p| p == 'password_digest' ? 'password' : p }
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method should_query?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def should_query?(filters)
return false unless filters.respond_to?(:keys)
return false unless @_query_fields
filters.keys.any? { |key| @_query_fields.include?(key) }
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method edit_page
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def edit_page
return @edit_page if @edit_page
raise ListSync::NotFoundError unless mal_id
url = "https://myanimelist.net/ownlist/#{media_kind}/#{mal_id}/edit"
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method behind_feature_flag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def behind_feature_flag(flag)
if method_defined?(:visible?)
define_method(:visible?) do |context|
super(context) && Flipper[flag].enabled?(context[:user])
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method should_query?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def should_query?(filters)
return false unless filters.respond_to?(:keys)
return false unless @_query_fields
filters.keys.any? { |key| @_query_fields.include?(key) }
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method download_xml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def download_xml
head 404 unless User.current.present?
head 404 unless Flipper[:xml_download].enabled?(User.current)
head 400 unless params[:kind].in?(%w[anime manga])
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"