Showing 226 of 388 total issues
Method show
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
# load metadata
start = Time.now.to_f
begin
objid = params[:id]
Method setElementValue
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setElementValue(type,val)
if val.class == Array
val = val.first
end
Function processForm_generic
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function processForm_generic(objType) {
var attributesArray =new Array("assembledCollection","provenanceCollection","provenanceCollectionPart","complexSubject","statute","license","copyright","language","unit","rightsHolderPersonal");
fieldId = "";
for (var j in attributesArray) {
- 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 insertRelationshipFields
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def insertRelationshipFields ( solr_doc, prefix, relationships )
facetable = Solrizer::Descriptor.new(:string, :indexed, :multivalued)
# build map: role => [name1,name2]
rels = {}
- 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 insertOtherRightsFields
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def insertOtherRightsFields( solr_doc, prefix, otherRights )
othr = load_otherRights otherRights
if othr != nil
othr_json = {
:id => othr.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
Method events_to_json
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def events_to_json( event )
event_array = []
events = load_events event
if events != nil
n = 0
Function showComponent
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.showComponent = function(componentIndex)
{
var componentID = "#component-" + componentIndex;
var container = componentID + " > [data]";
Function processForm_generic
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processForm_generic(objType) {
var attributesArray =new Array("assembledCollection","provenanceCollection","provenanceCollectionPart","complexSubject","statute","license","copyright","language","unit","rightsHolderPersonal");
fieldId = "";
for (var j in attributesArray) {
Method serialize
has 58 lines of code (exceeds 25 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])
Function getDynamicFields
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDynamicFields(link,type,location,fieldId,typeName,selectedValue,relationship,selectedRole)
{
var q = null;
var fieldName = null;
var typeGet = null;
Method insertRelationship
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def insertRelationship ( solr_doc, prefix, relationships )
# build map: role => [name1,name2]
rels = {}
relationships.map do |relationship|
Method get_simple_subject_id
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_simple_subject_id(object)
id = ""
if !object.temporal[0].nil?
id = object.temporal.to_s.gsub(/.*\//,'')[0..9]
elsif !object.topic[0].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 get_simple_subject_type
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_simple_subject_type(object)
type = ""
if !object.temporal[0].nil?
type = "MadsTemporal"
elsif !object.topic[0].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 get_simple_subject_value
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_simple_subject_value(object)
value = ""
if !object.temporal[0].nil?
value = object.temporal.first.name.first
elsif !object.topic[0].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
Function getTypeaheadFields
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getTypeaheadFields(linkTag,formType,location,fieldId,typeName,selectedValue,selectedLabel)
{
var q = null;
var fieldName = null;
Method serialize
has 51 lines of code (exceeds 25 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])
Method insertDateFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def insertDateFields (solr_doc, cid, dates)
date_begin = nil
date_end = nil
date_val = nil
Function getMultiAutoCompleteList
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getMultiAutoCompleteList(fieldName){
var subjectLocal = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
Method select_file
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def select_file( params )
document = params[:document]
component = params[:component]
max_size = params[:quality]
type = params[:type]
Method get_dams_data
has 48 lines of code (exceeds 25 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')