Showing 441 of 4,033 total issues
File application_helper.rb
has 1379 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'avatar/view/action_view_support'
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
include ExtendedFieldsHelpers
Method do_work
has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring. Open
def do_work(args = nil)
# start from scratch
@last_id = nil
@done = false
@record_count = 0
- 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_new_item_from_record
has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring. Open
def create_new_item_from_record(record, zoom_class, options = {})
zoom_class_for_params = zoom_class.tableize.singularize
params = options[:params]
- 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 extended_content_field_xml_tag
has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring. Open
def extended_content_field_xml_tag(options = {})
xml = options[:xml]
field = options[:field]
value = options[:value] || nil
xml_element_name = options[:xml_element_name] || 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"
Further reading
File importer.rb
has 806 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'tempfile'
require 'fileutils'
require 'mime/types'
require 'oai_dc_helpers'
require 'xml_helpers'
Method records_pre_processor
has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
def records_pre_processor
path_to_records_file_output = @import_dir_path + '/records.xml'
path_to_dfc_xml_file = @import_dir_path + '/records.dfc.xml'
path_to_dfc_convertor_log = @import_dir_path + '/convert.log'
- 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 importer_prepare_extended_field
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
def importer_prepare_extended_field(options = {})
params = options[:params]
field = options[:field]
value = options[:value]
zoom_class_for_params = options[:zoom_class_for_params]
- 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 index
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
def index
if !@current_basket.index_page_redirect_to_all.blank?
redirect_to_all_for(@current_basket.index_page_redirect_to_all)
else
@privacy_type = @current_basket.show_privacy_controls_with_inheritance? && permitted_to_view_private_items? ? 'private' : 'public'
- 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_new_item_from_record
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
def create_new_item_from_record(record, zoom_class, options = {})
zoom_class_for_params = zoom_class.tableize.singularize
params = options[:params]
- 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
File topic_test.rb
has 686 lines of code (exceeds 250 allowed). Consider refactoring. Open
require File.dirname(__FILE__) + '/../test_helper'
class TopicTest < ActiveSupport::TestCase
# fixtures preloaded
include KeteUrlFor
Class SystemSetting
has 82 methods (exceeds 20 allowed). Consider refactoring. Open
class SystemSetting
module Defaults
# RABID:
#
# Defaults, mostly taken from the system_setting table on an existing
Method importer_process
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
def importer_process(record, params)
current_record = @results[:records_processed] + 1
logger.info("starting record #{current_record}")
# clear this out so last related_topic
- 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_value
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def process_value(value)
@logger.info "in process_value: #{value}"
return unless within_table && within_data
if self.current_row == 1
- 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
File item_privacy_test_helper.rb
has 632 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ItemPrivacyTestHelper
module Model
# Normally, testing attachment_fu methods will cause real files to be written into your
# development and production environment file folders, as defined in the models.
# To work around this, this override forces the files to be saved into the
Class Basket
has 72 methods (exceeds 20 allowed). Consider refactoring. Open
class Basket < ActiveRecord::Base
scope :except_certain_baskets, lambda { |baskets| where("id not in (?) AND status = 'approved'", baskets) }
def self.settings
# * EOIN: we are pretty sure this is not called - raise an exception to be sure
File application_controller.rb
has 611 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
# helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
include DefaultUrlOptions
Method convert_extended_content_to_xml
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def convert_extended_content_to_xml(params_hash)
return '' if params_hash.blank?
builder = Nokogiri::XML::Builder.new
builder.root do |xml|
- 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
File extended_content.rb
has 540 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rexml/document'
require 'builder'
require 'xmlsimple'
# ExtendedContent provides a way to access additional, extended content directly on a model. (ExtendedContent is included in all
Method populate_result_sets_for
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def populate_result_sets_for(zoom_class)
# potential elements of query
# zoom_class and optionally basket
# search_terms which search both title attribute and all content attribute
# source_item for things related to item
- 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 populate_attributes_from_embedded_in
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def populate_attributes_from_embedded_in(file_path)
# if there is no file we just leave it up to validation
# to sort out what needs doing
return unless File.exist?(file_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"