team-umlaut/umlaut

View on GitHub

Showing 202 of 234 total issues

Function success has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

             success: function(umlaut_response) {
              for (var i = 0; i < myself.section_targets.length; i++) {
                  var section_target = myself.section_targets[i];                                
                 
                  var umlaut_html_section = myself.find_umlaut_response_section(umlaut_response, section_target.umlaut_section_id);
Severity: Minor
Found in app/assets/javascripts/umlaut/update_html.js - About 1 hr to fix

    Method parse_perl_data has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.parse_perl_data(doc)
    
        co = OpenURL::ContextObject.new
        co.referent.set_format('journal') # default
    
    
    Severity: Minor
    Found in app/service_adaptors/sfx.rb - About 1 hr to fix

      Method gen_lamr_request has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def gen_lamr_request(request)
          output = ""
          
          builder = Builder::XmlMarkup.new(:target => output, :indent => 2)
          builder.instruct!(:xml, :encoding => "UTF-8")    
      Severity: Minor
      Found in app/service_adaptors/jcr.rb - About 1 hr to fix

        Method illiad_query_parameters has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def illiad_query_parameters(request)
            metadata = request.referent.metadata
        
            qp = {}
        
        
        Severity: Minor
        Found in app/service_adaptors/illiad.rb - About 1 hr to fix

          Method find_or_create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.find_or_create(params, session, a_rails_request, options = {} )
          
          
          
              # Pull out the http params that are for the context object,
          Severity: Minor
          Found in app/models/request.rb - About 1 hr 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 scopus_search has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def scopus_search(request)
              
              if (doi = get_doi(request.referent))
                return CGI.escape( "DOI(#{phrase(doi)})" )
              elsif (pmid = get_pmid(request.referent))
          Severity: Minor
          Found in app/service_adaptors/scopus.rb - About 1 hr 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 blacklight_keyword_search_url has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def blacklight_keyword_search_url(request, options = {})
              options[:format] ||= "atom"
              options[:content_format] ||= "marc"
              
              clauses = []
          Severity: Minor
          Found in app/service_adaptors/blacklight.rb - About 1 hr 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 scopus_query has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def scopus_query(request)
              
              if (doi = get_doi(request.referent))
                return "DOI(#{phrase(doi)})"
              elsif (pmid = get_pmid(request.referent))
          Severity: Minor
          Found in app/service_adaptors/scopus2.rb - About 1 hr 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 check_holdings has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def check_holdings(holdings, request)      
              return if holdings.empty?
              # These need to moved to services.yml
              electronic_locations = ['INTERNET', 'NETLIBRARY', 'GALILEO']
              holdings.each do | holding | 
          Severity: Minor
          Found in app/service_adaptors/opac.rb - About 1 hr to fix

            Method define_query has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def define_query(rft)
                oclcnum = get_identifier(:info, "oclcnum", rft)
                metadata = rft.metadata
                
                # Do we have enough info to do a query with sufficient precision?
            Severity: Minor
            Found in app/service_adaptors/worldcat_identities.rb - About 1 hr to fix

              Method add_responses has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def add_responses(request, response_xml)
              
                  results = response_xml.at('map[@name ="cite_id"] map[@name="WOS"]')
                  unless (results)
                    error_message = "#{self.id}: "
              Severity: Minor
              Found in app/service_adaptors/isi.rb - About 1 hr to fix

                Method check_proxy_urls has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def check_proxy_urls(urls)
                    url_doc = REXML::Document.new
                    doc_root = url_doc.add_element "proxy_url_request", {"password"=>@proxy_password}
                    urls_elem = doc_root.add_element "urls"
                    urls.each { | link |
                Severity: Minor
                Found in app/service_adaptors/ezproxy.rb - About 1 hr to fix

                  Method create_partial_volume_responses has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def create_partial_volume_responses(request, ht_json)
                      items =  ht_json.values.first["items"]
                      full_ids = items.collect do |i| 
                        i["fromRecord"] if (is_serial_part?(i) && full_view?(i))
                      end.compact.uniq
                  Severity: Minor
                  Found in app/service_adaptors/hathi_trust.rb - About 1 hr to fix

                    Method roll_up_responses has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def roll_up_responses(list, options = {})
                        options = options.reverse_merge(:coverage_sensitive => true)
                    
                        prefixes = @roll_up_prefixes
                    
                    
                    Severity: Minor
                    Found in app/service_adaptors/sfx.rb - About 1 hr to fix

                      Method xml_to_holdings has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def xml_to_holdings(xml)
                       
                          data = {}
                      
                          data[:call_number] = xml_choose_first(xml,
                      Severity: Minor
                      Found in app/mixin_logic/xml_schema_helper.rb - About 1 hr to fix

                        Method create_new_request! has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def self.create_new_request!( args )
                        
                            # all of these are required
                            params = args[:params]
                            session = args[:session]
                        Severity: Minor
                        Found in app/models/request.rb - About 1 hr to fix

                          Method add_holdings has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def add_holdings(holdings_url, options = {})
                              options[:match_reliability] ||= ServiceResponse::MatchExact
                              options[:marc_data] ||= {}
                              
                              atom = Nokogiri::XML( http_fetch(holdings_url).body )
                          Severity: Minor
                          Found in app/service_adaptors/blacklight.rb - About 1 hr to fix

                            Method handle has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def handle(request)
                                
                                unless ( sufficient_metadata?(request.referent))
                                   return request.dispatched(self, true)
                                end
                            Severity: Minor
                            Found in app/service_adaptors/isi.rb - About 1 hr 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 find_by_title has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def find_by_title
                                    ctx = context_object_from_params
                                    search_results = []
                              
                                    sfx_url = umlaut_config.sfx_base_url
                            Severity: Minor
                            Found in app/controllers/search_methods/sfx_api.rb - About 1 hr 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 dispatch_background! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def dispatch_background!
                                # Now we do some crazy magic, start a Thread to run our background
                                # services. We are NOT going to wait for this thread to join,
                                # we're going to let it keep doing it's thing in the background after
                                # we return a response to the browser
                            Severity: Minor
                            Found in app/models/collection.rb - About 1 hr 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