ucsdlib/damspas

View on GitHub

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)
Severity: Major
Found in lib/dams/controller_helper.rb - About 2 days to fix

    File dams_helper.rb has 752 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'active_support/inflector'
    
    module Dams
        module DamsHelper
            
    Severity: Major
    Found in lib/dams/dams_helper.rb - About 1 day to fix

      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|
      Severity: Major
      Found in app/models/datastreams/dams_resource_datastream.rb - About 1 day to fix

        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
        Severity: Major
        Found in app/models/datastreams/dams_resource_datastream.rb - About 1 day to fix

          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
          Severity: Major
          Found in lib/dams/dams_object.rb - About 1 day to fix

            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';
            Severity: Major
            Found in app/assets/javascripts/edit.js - About 1 day to fix

              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
              Severity: Major
              Found in app/helpers/dams_objects_helper.rb - About 1 day to fix

                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)
                Severity: Minor
                Found in lib/dams/dams_object.rb - About 7 hrs to fix

                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)
                Severity: Major
                Found in lib/dams/dams_object.rb - About 6 hrs to fix

                  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"
                  Severity: Minor
                  Found in app/controllers/dams_resource_controller.rb - About 6 hrs to fix

                  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
                  Severity: Minor
                  Found in app/models/datastreams/dams_resource_datastream.rb - About 6 hrs to fix

                  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|
                  Severity: Minor
                  Found in lib/dams/dams_other_right.rb - About 6 hrs to fix

                  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?
                  Severity: Minor
                  Found in lib/dams/dams_object.rb - About 5 hrs to fix

                  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])
                  Severity: Minor
                  Found in lib/dams/provenance_collection.rb - About 5 hrs to fix

                  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']
                  Severity: Minor
                  Found in app/helpers/application_helper.rb - About 5 hrs to fix

                  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)
                  Severity: Minor
                  Found in app/models/datastreams/dams_resource_datastream.rb - About 4 hrs to fix

                  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]
                  Severity: Minor
                  Found in app/helpers/dams_objects_helper.rb - About 4 hrs to fix

                  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])
                  Severity: Minor
                  Found in lib/dams/provenance_collection_part.rb - About 4 hrs to fix

                  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
                  
                  
                  Severity: Minor
                  Found in app/models/datastreams/dams_resource_datastream.rb - About 4 hrs to fix

                  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
                  Severity: Minor
                  Found in lib/dams/dams_object.rb - About 4 hrs to fix

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language