Showing 226 of 388 total issues
Method setElementValue
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def setElementValue(type,val)
if val.class == Array
val = val.first
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 dateHelper
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def dateHelper dates
dateRet = ''
c2 = false
c3 = false
c4 = 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"
Further reading
Method custom_permissions
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
def custom_permissions
can [:solr], :all
def create_permissions
#can :create, :all if user_groups.include? 'registered'
Method serialize
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def serialize
check_type( graph, rdf_subject, DAMS.AssembledCollection )
if(!@unitURI.nil?)
if new?
graph.insert([rdf_subject, DAMS.unit, @unitURI])
- 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 get_dams_data
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def get_dams_data
if(!params[:q].nil? && params[:q] != '' && params[:q] == 'Topic')
@docs = get_objects_json('MadsTopic','name_tesim')
elsif(!params[:q].nil? && params[:q] != '' && params[:q] == 'BuiltWorkPlace')
- 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 show
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
refcon = referrer_controller request
if params[:counter]
# if there is a counter, update pager state & redirect to no-counter view
logger.info "dams_resource_controller#show (#{refcon}) adding query to session and redirecting"
Method insertCopyRightsInfoGraph
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def insertCopyRightsInfoGraph
if(!@rightURI.nil?)
if new?
graph.insert([rdf_subject, DAMS.copyright, @rightURI])
else
- 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 get_simple_subjects
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_simple_subjects(object)
simpleSubjectArray = Array.new
Method load_collection
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def load_collection (collection,assembledCollection,provenanceCollection,provenanceCollectionPart)
collections = []
[collection,assembledCollection,provenanceCollection,provenanceCollectionPart].each do |coltype|
coltype.each do |col|
begin
- 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 authLabel
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def authLabel
main = value
subt = subtitle
nons = nonSort
pnam = partName
- 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_derivatives
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def create_derivatives(object, file, fullPath)
if file.nil? || !file.respond_to?(:original_filename)
return { alert: "No file uploaded" }
else
begin
- 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 get_related_resource_url
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_related_resource_url(object_type_param,field1,field2)
@doc = get_search_results(:q => "has_model_ssim:info:fedora/afmodel:#{object_type_param}", :rows => '10000')
@objects = Array.new
@doc.each do |col|
if col.class == Array
- 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 DamsObject
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class DamsObject < ActiveFedora::Base
include Hydra::AccessControls::Permissions
include Hydra::ModelMethods
has_metadata 'damsMetadata', :type => DamsObjectDatastream
has_attributes :assembledCollection_attributes,
Method date_list
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def date_list( document )
dateVal = ''
dates = document['date_json_tesim']
if dates != nil
dates.each do |txt|
- 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 insertTitleFields
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def insertTitleFields ( solr_doc, cid, titles )
sort_title = ""
titles.each do |t|
begin
if(t.name.class == ActiveFedora::RdfNode::TermProxy)
Method to_solr
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_solr (solr_doc = {})
super(solr_doc)
facetable = Solrizer::Descriptor.new(:string, :indexed, :multivalued)
Method serialize
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def serialize
check_type( graph, rdf_subject, DAMS.Object )
if(!@unitURI.nil?)
if new?
Method show
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def show
# load metadata
start = Time.now.to_f
begin
objid = params[: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 loadRdfObjects
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def loadRdfObjects (object, className, reload = true)
objects = []
if !object.first.nil?
object.each do |o|
o_pid = o.pid;
- 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 getAutocompleteList_callback
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAutocompleteList_callback(formtype,fieldname,elementID,elementLabel){
var IDTag='#'+elementID;
var typeaheadLabelTag='#'+elementLabel+'.typeahead';