Showing 261 of 342 total issues
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(owner, user, created_at, old_value, new_value)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(owner, name, options, blocks = [], &block)
Method store
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def store(revision, partition, _path, template, transaction)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(site, owner, filename, digest, headers = {})
Method store
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def store(revision, partition, path, template, transaction)
Method set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.set(site, field, value, user, asynchronous = false)
Method update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.update(site, content, params, user, asynchronous = false)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(site, revision, pages, progress = Spontaneous::Publishing::Progress::Silent.new, user = nil)
Method store
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def store(revision, partition, key, template, transaction)
Method redirect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def redirect(location, redirect_code=:temporary)
if String === location
destination = @site[location]
location = destination.path if destination and destination.respond_to?(:path)
else
- 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 content_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def content_type(type, params={})
default = params.delete :default
mime_type = mime_type(type) || default
fail "Unknown media type: %p" % type if mime_type.nil?
mime_type = mime_type.dup
- 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
Function PagePieceView
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Views.PagePieceView = (function($, S) {
'use strict';
var dom = S.Dom;
var PagePieceView = new JS.Class(Spontaneous.Views.PieceView, {
- 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 call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
return @app.call(env) unless ALLOWED_METHODS.include?(env[S::REQUEST_METHOD])
orig_path = env['PATH_INFO']
found = nil
@try.each do |path|
- 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 update_serialized_fields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_serialized_fields(fields = nil)
if fields.nil?
@field_set.serialize_db
else
field_store = (self.field_store || []).dup
- 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 geolocate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def geolocate(address)
return {} if address.blank?
url = "http://maps.google.com/maps/api/geocode/json?address=#{URI.escape(address)}&sensor=false"
response = open(url).read rescue "{}"
- 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 safe_stat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def safe_stat(file)
return unless file
stat = ::File.stat(file)
return file, stat if stat.file?
rescue Errno::ENOENT, Errno::ENOTDIR
- 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 load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load(id, reference)
@instance_lock.synchronize do
unless instance = @instances[id]
instance = UID.new(self, id, reference)
# check to make sure that the uid is valid first
- 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 create_visibility_modifications
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_visibility_modifications
# We only want to record visibility changes that originate from user action, not ones propagated
# from higher up the tree, hence the check against the hidden_origin.
return false unless changed_columns.include?(:hidden) && hidden_origin.nil?
if (previous_modification = local_modifications.detect { |mod| mod.type == :visibility })
- 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 create_slug_modifications
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_slug_modifications
change = changes_to_cascade[:slug]
return false if change.nil?
old_slug, new_slug = change.old_value, self[:slug]
return false if old_slug.nil? # ignore first change of slug from nil to provided or generated
- 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 named
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def named(name)
key = name.to_sym
return @store[key] if @store.key?(key)
value = (superset? ? superset.named(name) : nil)
return value unless value.nil?
- 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"