Showing 1,469 of 2,413 total issues
File utils.js
has 867 lines of code (exceeds 250 allowed). Consider refactoring. Open
//= require trimpath-template-1.0.38
//= require bootstrap-datepicker
//= require bootstrap-combobox
var AS = {}; // eslint-disable-line
Method map_oai_record
has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring. Open
def map_oai_record(record)
jsonmodel = record.jsonmodel_record
result = Nokogiri::XML::Builder.new do |xml|
xml['oai_dcterms'].dcterms('xmlns:dcterms' => 'http://purl.org/dc/terms/',
- 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 init
has 416 lines of code (exceeds 25 allowed). Consider refactoring. Open
var init = function () {
var $form = $('#job_form');
var initReportJobForm = function () {
var locationReportSubFormChange = function () {
File marcxml_auth_agent_base_map.rb
has 840 lines of code (exceeds 250 allowed). Consider refactoring. Open
module MarcXMLAuthAgentBaseMap
# import_events determines whether maintenance events are imported
# import_subjects determines whether subjects are imported
def BASE_RECORD_MAP(opts = {:import_events => false, :import_subjects => false})
import_events = opts[:import_events]
File ead_converter.rb
has 829 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'converter'
require 'set'
class EADConverter < Converter
Method map_oai_record
has a Cognitive Complexity of 94 (exceeds 5 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/',
- 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 ead.rb
has 785 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
require 'securerandom'
require 'cgi'
class EADSerializer < ASpaceExport::Serializer
File clipboard.js
has 758 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* clipboard.js v1.6.1
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
File top_containers.bulk.js
has 738 lines of code (exceeds 250 allowed). Consider refactoring. Open
//= require tablesorter/jquery.tablesorter.min
/***************************************************************************
* BulkContainerSearch - provides all the behaviour to the ajax search
* and selection of records.
Method map_oai_record
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
def map_oai_record(record)
jsonmodel = record.jsonmodel_record
result = Nokogiri::XML::Builder.new do |xml|
xml.mods('xmlns' => 'http://www.loc.gov/mods/v3',
- 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 exports.rb
has 715 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ArchivesSpaceService < Sinatra::Base
include ExportHelpers
Endpoint.get('/repositories/:repo_id/digital_objects/dublin_core/:id.xml')
.description("Get a Dublin Core representation of a Digital Object")
File marc21.rb
has 690 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MARCModel < ASpaceExport::ExportModel
model_for :marc21
include JSONModel
Method _cpfdesc
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
def _cpfdesc(json, xml, obj)
xml.cpfDescription do
xml.identity do
# AGENT_IDENTIFIERS
with(xml, json['agent_identifiers']) do |ad|
- 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 run
has 291 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
begin
# SETUP
@job.write_output("Resetting autogenerated slugs")
@job.write_output("================================")
File eac.rb
has 648 lines of code (exceeds 250 allowed). Consider refactoring. Open
class EACSerializer < ASpaceExport::Serializer
serializer_for :eac
def serialize(eac, _opts = {})
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
File validations.rb
has 624 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'date'
require 'time'
require 'barcode_check'
module JSONModel::Validations
File marc_auth.rb
has 618 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MARCAuthSerializer < ASpaceExport::Serializer
serializer_for :marc_auth
def serialize(marc, _opts = {})
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
Method _control
has a Cognitive Complexity of 66 (exceeds 5 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
- 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 sequel_to_jsonmodel
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
def sequel_to_jsonmodel(objs, opts = {})
jsons = super
jsons.each do |json|
case self.name
- 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 merge_record
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
def merge_record(json_in, opts)
json = json_in.clone
direct_only = opts.fetch(:direct_only) { false }
remove_ancestors = opts.fetch(:remove_ancestors) { false }
- 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"