Showing 226 of 388 total issues
File controller_helper.rb
has 850 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Dams
module ControllerHelper
#Mapping for OSF API
def osf_title(document)
File dams_helper.rb
has 752 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/inflector'
module Dams
module DamsHelper
File dams_resource_datastream.rb
has 690 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'timeout'
class DamsResourceDatastream < ActiveFedora::RdfxmlRDFDatastream
include Dams::DamsHelper
rdf_subject { |ds|
Class DamsResourceDatastream
has 79 methods (exceeds 20 allowed). Consider refactoring. Open
class DamsResourceDatastream < ActiveFedora::RdfxmlRDFDatastream
include Dams::DamsHelper
rdf_subject { |ds|
if ds.pid.nil?
RDF::URI.new
File dams_object.rb
has 645 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/concern'
require 'date'
module Dams
module DamsObject
File edit.js
has 534 lines of code (exceeds 250 allowed). Consider refactoring. Open
function getAutocompleteList_callback(formtype,fieldname,elementID,elementLabel){
var IDTag='#'+elementID;
var typeaheadLabelTag='#'+elementLabel+'.typeahead';
File dams_objects_helper.rb
has 524 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "base64"
require "openssl"
module DamsObjectsHelper
include Dams::ControllerHelper
Method to_solr
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def to_solr (solr_doc = {})
super(solr_doc)
@facetable = Solrizer::Descriptor.new(:string, :indexed, :multivalued)
singleString = Solrizer::Descriptor.new(:string, :indexed, :stored)
- 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 to_solr
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_solr (solr_doc = {})
super(solr_doc)
@facetable = Solrizer::Descriptor.new(:string, :indexed, :multivalued)
singleString = Solrizer::Descriptor.new(:string, :indexed, :stored)
Method show
has a Cognitive Complexity of 43 (exceeds 5 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"
- 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 events_to_json
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def events_to_json( event )
event_array = []
events = load_events event
if events != nil
n = 0
- 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 insertRelationship
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def insertRelationship ( solr_doc, prefix, relationships )
# build map: role => [name1,name2]
rels = {}
relationships.map do |relationship|
- 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
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def serialize
check_type( graph, rdf_subject, DAMS.Object )
if(!@unitURI.nil?)
if new?
- 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
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def serialize
check_type( graph, rdf_subject, DAMS.ProvenanceCollection )
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 field_with_highlighting
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def field_with_highlighting document, field, sep=field_value_separator
highlighting = blacklight_config.highlighting
if !(field.is_a? Symbol) && !(field.is_a? String)
options = field
field = options[:'field']
- 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 a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def insertTitleFields ( solr_doc, cid, titles )
sort_title = ""
titles.each do |t|
begin
if(t.name.class == ActiveFedora::RdfNode::TermProxy)
- 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 select_file
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def select_file( params )
document = params[:document]
component = params[:component]
max_size = params[:quality]
type = params[:type]
- 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
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def serialize
check_type( graph, rdf_subject, DAMS.ProvenanceCollectionPart )
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 insertDateFields
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def insertDateFields (solr_doc, cid, dates)
date_begin = nil
date_end = nil
date_val = 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 insertFileFields
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def insertFileFields( solr_doc, cid, files )
prefix = (cid != nil) ? "component_#{cid}_" : ""
files.map.sort{ |a,b| a.order <=> b.order }.each { |file|
# basic file info
- 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"