Showing 1,475 of 2,432 total issues
Method serialize_indexes
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def serialize_indexes(data, xml, fragments)
data.indexes.each do |note|
next if note["publish"] === false && !@include_unpublished
audatt = note["publish"] === false ? {:audience => 'internal'} : {}
content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)
- 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 serialize_indexes
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def serialize_indexes(data, xml, fragments)
data.indexes.each do |note|
next if note["publish"] === false && !@include_unpublished
content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)
head_text = 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
Method id_based_slug_for
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def self.id_based_slug_for(entity, klass)
if klass == Resource || klass == Accession
if AppConfig[:generate_resource_slugs_with_eadid] && entity[:ead_id] && klass == Resource
# use EADID if configured. Otherwise, use identifier.
slug = entity[:ead_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 from_endpoint_defn
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def self.from_endpoint_defn(endpoint, method)
raise "#{method} not in #{endpoint[:method]}" unless endpoint[:method].include? method
params = {}
uri = endpoint[:uri].dup
endpoint[:params].each do |param_defn|
- 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 large_tree
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
function (rootNode) {
self.$container.find('.record-title').attr('href', '#');
function menuSelectHandler(level) {
// remove any existing placeholder row
if (self.inserted_row != undefined) {
Method _control
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _control(json, xml)
xml.control do
# AGENT_RECORD_IDENTIFIERS
with(xml, json['agent_record_identifiers']) do |ari|
if ari['primary_identifier'] == true
File top_container.rb
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'uri'
require 'net/http'
class TopContainer < Sequel::Model(:top_container)
include ASModel
Method opt
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def opt name, desc="", opts={}
raise ArgumentError, "you already have an argument named '#{name}'" if @specs.member? name
## fill in :type
opts[:type] = # normalize
- 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 uses_enums
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def uses_enums(*definitions)
definitions.each do |definition|
Enumeration.register_enumeration_dependant(definition, self)
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 stringify_date
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def self.stringify_date(date_json)
date_substring = ""
if date_json["date_type_structured"] == "single"
std = date_json["structured_date_single"]['date_standardized']
- 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 check_row
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def check_row
err_arr = []
begin
# we'll check hierarchical level first, in case there was a parent that didn't get created
hier = @row_hash["hierarchy"]
- 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_archival_object
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def create_archival_object(parent_uri)
errs = []
ao = JSONModel(:archival_object).new._always_valid!
ao.title = @row_hash["title"] if @row_hash["title"]
ao.dates = create_dates
- 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 migrate_agent_rights_statements
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def migrate_agent_rights_statements
# Migrate any agent rights statements to a new note type 'Rights Statement'
# known by the schema note_agent_rights_statement
#
# Required fields:
- 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 map_record_fields_to_digital_object
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def map_record_fields_to_digital_object(record)
if ['resource', 'accession', 'archival_object'].include? record['jsonmodel_type']
record_hash = (record.class == Hash ? record : record.to_hash)
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 start_worker_thread
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def start_worker_thread(queue, record_type)
repo_id = JSONModel.repository
session = JSONModel::HTTP.current_backend_session
Thread.new do
- 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 extract_string_values
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def self.extract_string_values(doc, *opts)
return doc, doc if doc.is_a?(String)
if doc.is_a?(Array)
published_queue = doc.flatten
- 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 map_oai_record
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
def map_oai_record(record)
jsonmodel = record.jsonmodel_record
result = Nokogiri::XML::Builder.new do |xml|
xml['oai_dc'].dc('xmlns:oai_dc' => 'http://www.openarchives.org/OAI/2.0/oai_dc/',
'xmlns:dc' => 'http://purl.org/dc/elements/1.1/',
Class MARCModel
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class MARCModel < ASpaceExport::ExportModel
model_for :marc21
include JSONModel
Class JSONModelType
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class JSONModelType
# Class instance variables store the bits specific to this model
def self.init(type, schema, mixins = [])
@record_type = type
Function init_subrecord_form
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.init_subrecord_form = function () {
$(this).each(function () {
var $this = $(this);
if (