Showing 1,505 of 2,469 total issues
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"
Further reading
Method apply_nested_records
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def apply_nested_records(json, new_record = false)
self.remove_nested_records if !new_record
self.class.nested_records.each do |nested_record|
# Read the subrecords from our JSON blob and fetch or create
- 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 dataset_iterator
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dataset_iterator(&block)
DB.open do |db|
@ao_ids.each_slice(BATCH_SIZE) do |batch|
base_fields = [:id, :lock_version] + FIELDS_OF_INTEREST.fetch(:archival_object).map {|field| field.column}
base = ArchivalObject
Method set_up_base_permissions
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.set_up_base_permissions
if not Repository[:repo_code => Repository.GLOBAL]
Repository.create(:repo_code => Repository.GLOBAL,
:name => "Global repository",
:json_schema_version => JSONModel(:repository).schema_version,
File bootstrap-accessibility.js
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ========================================================================
* Extends Bootstrap v3.1.1
* Copyright (c) <2015> PayPal
File trollop.rb
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'date'
module Trollop
VERSION = "2.0"
Method archdesc_dates
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def archdesc_dates
unless @archdesc_dates
results = []
dates = self.dates || []
dates.each do |date|
- 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 initImportJobForm
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
var initImportJobForm = function () {
var supportsHTML5MultipleFileInput = function () {
var input = document.createElement('input');
input.setAttribute('multiple', 'true');
return input.multiple === true;
Method process_row
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def process_row(row_hash = nil)
#This allows the processing of a single row
if (!row_hash.nil?)
@row_hash = row_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
Function ClipboardAction
has 185 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ClipboardAction = (function () {
/**
* @param {Object} options
*/
function ClipboardAction(options) {
Method defaults
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.defaults
{
'show_suppressed' => false,
'publish' => false,
'rde_sort_alpha' => true,
File rest.rb
has 465 lines of code (exceeds 250 allowed). Consider refactoring. Open
module RESTHelpers
include JSONModel
Method serialize_subnotes
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def serialize_subnotes(subnotes, xml, fragments, include_p = true)
subnotes.each do |sn|
next if sn["publish"] === false && !@include_unpublished
audatt = sn["publish"] === false ? {:audience => 'internal'} : {}
- 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_subnotes
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def serialize_subnotes(subnotes, xml, fragments, include_p = true)
subnotes.each do |sn|
next if sn["publish"] === false && !@include_unpublished
audatt = sn["publish"] === false ? {:audience => 'internal'} : {}
- 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_langmaterial_notes
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def migrate_langmaterial_notes
# Find all langmaterial notes
self[:note].each do |note_id|
if note_id[:notes].lit.include?('langmaterial')
- 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
Class IndexerCommon
has 50 methods (exceeds 20 allowed). Consider refactoring. Open
class IndexerCommon
include JSONModel
@@record_types = IndexerCommonConfig.record_types
Class ApplicationController
has 50 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
include ActionView::Helpers::TranslationHelper
protect_from_forgery with: :exception
helper :all