Showing 714 of 1,025 total issues
Method arrayify_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def arrayify_params(blob_params)
result = []
Array(blob_params[:data_url]).each.with_index do |url, index|
unless url.blank?
result << { data_url: url,
- 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 find_and_authorize_associated_asset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_and_authorize_associated_asset
asset = asset_object
if asset
if asset.can_download? || (params[:code] && asset.auth_by_code?(params[:code]))
@asset = asset
- 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 last_rdf_file_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def last_rdf_file_path item
path = nil
path ||= item.rdf_storage_path if File.exists?(item.rdf_storage_path)
path ||= item.private_rdf_storage_path if File.exists?(item.private_rdf_storage_path)
path ||= item.public_rdf_storage_path if File.exists?(item.public_rdf_storage_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 resolve_feed_date
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.resolve_feed_date(entry)
date = nil
date = entry.try(:updated) if entry.respond_to?(:updated)
date ||= entry.try(:published) if entry.respond_to?(:published)
date ||= entry.try(:last_modified) if entry.respond_to?(:last_modified)
- 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_annotations_ajax
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_annotations_ajax
entity=controller_name.singularize.camelize.constantize.find(params[:id])
if entity.can_view?
clear_cloud = immediately_clear_tag_cloud?
update_owned_annotations entity
- 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 process_data_fuse_response
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_data_fuse_response response
parser = LibXML::XML::Parser.string(response, :encoding => LibXML::XML::Encoding::UTF_8)
doc = parser.parse
doc.find("//data_fuse_results/result").collect do |node|
r=DataFuseResult.new
- 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_descendants_cache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_descendants_cache
disable_authorization_checks do
if new_record?
if parent_id
self.ancestors = self.calculate_ancestors
- 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_blob_search_terms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def content_blob_search_terms
if self.respond_to?(:content_blob) || self.respond_to?(:content_blobs)
blobs = self.respond_to?(:content_blobs) ? content_blobs : [content_blob]
blobs.compact.collect do |blob|
[blob.original_filename] | [blob.pdf_contents_for_search]
- 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_versioned_table
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_versioned_table(create_table_options = {})
# create version column in main table if it does not exist
if !self.content_columns.find { |c| %w(version lock_version).include? c.name }
self.connection.add_column table_name, :version, :integer, :default=>1
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 split_tree
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def split_tree tree
items = []
if !tree[:children].nil? && !tree[:children].empty? && tree[:children][0][:is_directory]
tree[:children].each {|i| items = items + split_tree(i)}
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 child_select_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def child_select_options parent, depth=0
result = []
unless parent.children.empty?
parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
result << ["---"*depth + child.title, child.id]
- 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 acts_as_yellow_pages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def acts_as_yellow_pages
acts_as_favouritable
validates :title,:presence=>true
- 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 send_immediate_subscriptions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def send_immediate_subscriptions activity_log
if Seek::Config.email_enabled && subscribers_are_notified_of?(activity_log.action)
subscriptions.each do |subscription|
if !subscription.person.user.nil? && subscription.person.receive_notifications? && subscription.immediately? && can_view?(subscription.person.user)
- 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 fix_file_extensions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fix_file_extensions(run)
Dir.mktmpdir("#{run.id}", Rails.root.join("tmp")) do |tmp_dir|
tmp_zip = File.join(tmp_dir, "all.zip")
Zip::File.open(run.results.path) do |old_zip|
Zip::File.open(tmp_zip, Zip::File::CREATE) do |new_zip|
- 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"