scotdalton/exlibris-aleph

View on GitHub

Showing 6 of 26 total issues

Class Item has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Item
      ON_SHELF_VALUES = ['On Shelf']

      attr_reader :record_id, :id

Severity: Minor
Found in lib/exlibris/aleph/item.rb - About 3 hrs to fix

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

              def all
                rows.map do |row|
                  sub_library = sub_libraries.find do |sub_library|
                    sub_library.code == row.sub_library_code
                  end
    Severity: Minor
    Found in lib/exlibris/aleph/table/reader/patron_circulation_policies.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 all has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

              def all
                rows.map do |row|
                  sub_library = sub_libraries.find do |sub_library|
                    sub_library.code == row.sub_library_code
                  end
    Severity: Minor
    Found in lib/exlibris/aleph/table/reader/item_circulation_policies.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

              def initialize(query={})
                unless query.is_a?(Hash)
                  raise ArgumentError.new("Expecting #{query} to be a Hash")
                end
                view = query[:view]
    Severity: Minor
    Found in lib/exlibris/aleph/api/client/base.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

              def initialize(status, processing_status, sub_library)
                unless status.is_a?(Status)
                  raise ArgumentError.new("Expecting #{status} to be a Item::Status")
                end
                unless processing_status.is_a?(ProcessingStatus)
    Severity: Minor
    Found in lib/exlibris/aleph/item/circulation_policy/identifier.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def initialize(identifier, display, privileges)
              unless identifier.is_a?(Identifier)
                raise ArgumentError.new("Expecting #{identifier} to be a Item::CirculationPolicy::Identifier")
              end
              unless display.is_a?(Display)
    Severity: Minor
    Found in lib/exlibris/aleph/item/circulation_policy.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