team-umlaut/umlaut

View on GitHub

Showing 202 of 234 total issues

Method sort_boosted_responses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def sort_boosted_responses(list)
    return list unless @boost_targets.present?

    preferred = []
    other_targets = list
Severity: Minor
Found in app/service_adaptors/sfx.rb - About 35 mins 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 parse_for_fulltext_links has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def parse_for_fulltext_links(marc, request)    
    eight_fifty_sixes = []    
    marc.find_all { | f| '856' === f.tag}.each do | link |
      eight_fifty_sixes << link
    end    
Severity: Minor
Found in app/service_adaptors/opac.rb - About 35 mins 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 section_title has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def section_title
    section_title = nil

    if @options.has_key? :section_title
      # deprecation warning? Not sure the right way to do that. 
Severity: Minor
Found in app/presentation/section_renderer.rb - About 35 mins 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_truncate_to_db_limit! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def do_truncate_to_db_limit!
    
    
    self.class._truncate_to_db_limit_attributes.each do |attribute_name|

Severity: Minor
Found in lib/truncate_to_db_limit.rb - About 35 mins 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 sort_sunk_responses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def sort_sunk_responses(list)
    return list unless @sink_targets.present?
    
    sunk = []
    other_targets = list
Severity: Minor
Found in app/service_adaptors/sfx.rb - About 35 mins 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 is_conference? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def is_conference?(marc)
    # Check the leader/008 for books and serials
    return true if marc['008'].value[29,1] == '1' && marc.leader[6,1].match(/[at]/) && marc.leader[7,1].match(/[abcdms]/)      
    # Check the leader/008 for scores and recordings
    return true if marc['008'].value[30,2] == 'c' && marc.leader[6,1].match(/[cdij]/) && marc.leader[7,1].match(/[abcdms]/)
Severity: Minor
Found in app/service_adaptors/opac.rb - About 35 mins 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

Avoid too many return statements within this method.
Open

    return nil
Severity: Major
Found in app/service_adaptors/worldcat_identities.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return request.dispatched(self, DispatchedService::FailedFatal, e)
    Severity: Major
    Found in app/service_adaptors/amazon.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

          return request.dispatched(self, true)
      Severity: Major
      Found in app/service_adaptors/amazon.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return false
        Severity: Major
        Found in app/service_adaptors/ezproxy.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                return options[:default_service_type]
          Severity: Major
          Found in app/mixin_logic/marc_helper.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return request.dispatched(self, true)
            Severity: Major
            Found in app/service_adaptors/worldcat.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return "highlighted_link"
              Severity: Major
              Found in app/mixin_logic/marc_helper.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                    return request.dispatched(self, true)
                Severity: Major
                Found in app/service_adaptors/worldcat.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                      return request.dispatched(self, true)
                  Severity: Major
                  Found in app/service_adaptors/scopus2.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return request.dispatched(self, DispatchedService::FailedFatal, e)
                    Severity: Major
                    Found in app/service_adaptors/scopus2.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                          return nil
                      Severity: Major
                      Found in app/service_adaptors/scopus2.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                            return false  
                        Severity: Major
                        Found in app/service_adaptors/opac.rb - About 30 mins to fix

                          Method get_identifiers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def get_identifiers(rft)
                              isbn = get_identifier(:urn, "isbn", rft)
                              oclcnum = get_identifier(:info, "oclcnum", rft)
                              lccn = get_identifier(:info, "lccn", rft)
                              
                          Severity: Minor
                          Found in app/service_adaptors/open_library.rb - About 25 mins 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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def get(path, headers=nil, &block)
                                limit = 6
                                tries = 0
                                response = nil
                          
                          
                          Severity: Minor
                          Found in app/models/hip3/bib_searcher.rb - About 25 mins 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