team-umlaut/umlaut

View on GitHub

Showing 202 of 234 total issues

Method check_proxy_urls has a Cognitive Complexity of 11 (exceeds 5 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

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 add_responses has a Cognitive Complexity of 11 (exceeds 5 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

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 raw_search_title has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  def raw_search_title(rft)
    # Just make one call to create metadata hash
    metadata = rft.metadata
    title = nil
    if rft.format == 'journal' && metadata['atitle']
Severity: Minor
Found in app/mixin_logic/metadata_helper.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 journal_search has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  def journal_search
    @batch_size = batch_size
    @start_result_num = (page * batch_size) - (batch_size - 1)
    @search_context_object = context_object_from_params
    if (! params["rft.object_id"].blank? ||
Severity: Minor
Found in app/controllers/search_controller.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 create_new_request! has a Cognitive Complexity of 11 (exceeds 5 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

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 roll_up_responses has a Cognitive Complexity of 11 (exceeds 5 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

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_fulltext_service_response has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  def create_fulltext_service_response(request, items)
    return nil if items.empty?
    
    count = 0
    
Severity: Minor
Found in app/service_adaptors/hathi_trust.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 do_web_links has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def do_web_links(request, data)

    # some noview items will have a snippet view, but we have no way to tell
    info_views = find_entries(data, ViewPartialValue)
    viewability = ViewPartialValue
Severity: Minor
Found in app/service_adaptors/google_book_search.rb - About 1 hr to fix

    Method edition_statement has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def edition_statement(marc, options = {})
        options[:include_repro_info] ||= true
        options[:exclude_533_fields] = ['7','f','b', 'e']
    
        parts = Array.new
    Severity: Minor
    Found in app/mixin_logic/marc_helper.rb - About 1 hr to fix

      Method nature_of_contents has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def nature_of_contents(marc)
          types = {'m'=>'dissertation','t'=>'report','j'=>'patent'}
          idx = nil
          if self.record_type(marc) == 'BKS'
            idx = 24
      Severity: Minor
      Found in app/service_adaptors/opac.rb - About 1 hr to fix

        Method handle has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def handle(request)
            ids = {
              :isbn => request.referent.isbn,
              :oclc => request.referent.oclcnum,
              :lccn => request.referent.lccn
        Severity: Minor
        Found in app/service_adaptors/open_library_cover.rb - About 1 hr to fix

          Method preempted_by has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

           def preempted_by(uml_request, for_type_generated=nil)
             preempted_by = @preempted_by
             return false if preempted_by.nil?
             preempted_by = [preempted_by] unless preempted_by.kind_of?(Array)
             preemption = nil
          Severity: Minor
          Found in app/service_adaptors/service.rb - About 1 hr to fix

            Method determine_coverage_boundaries has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def determine_coverage_boundaries(target)
                # machine actionable coverage elements, used for collapsing
                if (in_node = target.at_xpath("./coverage/in"))
                    year = in_node.at_xpath("year").try(:text).try(:to_i)
                    if year && year != 0
            Severity: Minor
            Found in app/service_adaptors/sfx.rb - About 1 hr to fix

              Method journal_search has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def journal_search
                  @batch_size = batch_size
                  @start_result_num = (page * batch_size) - (batch_size - 1)
                  @search_context_object = context_object_from_params
                  if (! params["rft.object_id"].blank? ||
              Severity: Minor
              Found in app/controllers/search_controller.rb - About 1 hr to fix

                Method handle has 28 lines of code (exceeds 25 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

                  Method list_with_limit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def list_with_limit(id, list, options = {}, &block)
                      # backwards compatible to when third argument was just a number
                      # for limit.
                      options = {:limit => options} unless options.kind_of?(Hash)
                      options[:limit] ||= 5
                  Severity: Minor
                  Found in app/helpers/resolve_helper.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 sfx4_db_to_ctxobj has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def sfx4_db_to_ctxobj(title_rows)
                        title_rows.collect do |sfx_obj|
                          ctx = OpenURL::ContextObject.new
                          # Start out wtih everything in search, to preserve date/vol/etc
                          ctx.import_context_object( context_object_from_params )        
                  Severity: Minor
                  Found in app/controllers/search_methods/sfx4.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 filter has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def filter(referent)
                      issn = get_identifier(:urn, "issn", referent)
                      return unless issn
                  
                      # normalize removing hyphen
                  Severity: Minor
                  Found in app/referent_filters/dissertation_catch.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 should_skip_menu has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def should_skip_menu
                      # From usabilty test, do NOT skip if coming from A-Z list/journal lookup.
                      # First, is it over-ridden in url?
                      if ( params['umlaut.skip_resolve_menu'] == 'false')
                        return nil
                  Severity: Minor
                  Found in app/controllers/resolve_controller.rb - About 1 hr to fix

                    Method brief_citation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def brief_citation(request, options = {})
                        options[:include_labels] ||= false
                        rv =""
                        cite = request.referent.to_citation
                        title = truncate(cite[:title].strip, :length => 70,  :separator => ' ')
                    Severity: Minor
                    Found in app/helpers/emailer_helper.rb - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language