Showing 1,469 of 2,413 total issues
Method parse
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def parse cmdline=ARGV
vals = {}
required = {}
opt :version, "Print version and exit" if @version unless @specs[:version] || @long["version"]
- 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 configure
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.configure
{
# 1. Map the cell data to schemas or handlers
'agent_role' => 'd.agent_role',
Method configure
has 251 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.configure
{
# 1. Map the cell data to schemas / handlers
# {column header} => {data address}
# or,
Function 7
has 247 lines of code (exceeds 25 allowed). Consider refactoring. Open
function (require, module, exports) {
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define(['module', 'select'], factory);
} else if (typeof exports !== 'undefined') {
File 088_rights_management.rb
has 577 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'securerandom'
require 'json'
def backup_rights_statement_table
File relationships.rb
has 569 lines of code (exceeds 250 allowed). Consider refactoring. Open
AbstractRelationship = Class.new(Sequel::Model) do
include ObjectGraph
# Create a relationship instance between two objects with a defined set of properties.
Method _cpfdesc
has 230 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _cpfdesc(json, xml, obj)
xml.cpfDescription do
xml.identity do
# AGENT_IDENTIFIERS
with(xml, json['agent_identifiers']) do |ad|
File application_controller.rb
has 548 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'asconstants'
require 'memoryleak'
require 'search'
require 'zlib'
Function 8
has 228 lines of code (exceeds 25 allowed). Consider refactoring. Open
function (require, module, exports) {
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define([
'module',
Method serialize_dates
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def serialize_dates(obj, xml, fragments)
add_unitdate = Proc.new do |value, context, fragments, atts={}|
context.unitdate(atts) {
sanitize_mixed_content( value, context, fragments )
}
- 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 linker.js
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
//= require jquery.tokeninput
$(function () {
let resource_edit_path_regex = new RegExp(
'^' + APP_PATH + 'resources/\\d+/edit$'
Method convert_ead2002_markup
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
def convert_ead2002_markup(content)
apply_changes = lambda do |fn, fragment|
fragment.element_children.each do |e|
fn.(e)
if !e.element_children.empty?
- 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_control
has 222 lines of code (exceeds 25 allowed). Consider refactoring. Open
def serialize_control(data, xml, fragments)
control_atts = {
repositoryencoding: "iso15511",
countryencoding: "iso3166-1",
dateencoding: "iso8601",
File mixed_content.config.js
has 528 lines of code (exceeds 250 allowed). Consider refactoring. Open
$(function () {
AS.mixedContentElements = {
language: {
tag: 'language',
attributes: [],
Class FormContext
has 60 methods (exceeds 20 allowed). Consider refactoring. Open
class FormContext
def initialize(name, values_from, parent)
values = values_from.is_a?(JSONModelType) ? values_from.to_hash(:raw) : values_from
Method process_file_versions
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
def process_file_versions(json)
dig_f = {}
unless json['file_versions'].blank?
embed_caption = ''
rep_caption = ''
- 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 returns
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
def returns(*returns, &block)
raise "No .permissions declaration for endpoint #{@methods.map {|m| m.to_s.upcase}.join('|')} #{@uri}" if !@has_permissions
@returns = returns.map { |r| r[1] = @@return_types[r[1]] || r[1]; r }
- 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 archival_objects.crud.js
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
//= require agents.crud
//= require subjects.crud
//= require dates.crud
//= require notes.crud
//= require instances.crud
Method preview_sort_name
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def preview_sort_name(target)
result = ""
case target['jsonmodel_type']
when 'name_person'
- 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_digital_object
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def serialize_digital_object(digital_object, xml, fragments)
return if digital_object["publish"] === false && !@include_unpublished
return if digital_object["suppressed"] === true
# ANW-285: Only serialize file versions that are published, unless include_unpublished flag is set
- 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"