QuantumGeordie/dom_glancy

View on GitHub

Showing 7 of 7 total issues

Class DOMElement has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

  class DOMElement
    ## element looks like this in archive.
    # {"id"=>"", "height"=>238, "visible"=>true, "tag"=>"DIV", "width"=>720, "class"=>"grid", "left"=>43, "top"=>14}

    attr_accessor :id
Severity: Minor
Found in lib/dom_glancy/element.rb - About 2 hrs to fix

    Method change_info has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def change_info(anOther)
          info = []
          if same_element?(anOther)
            info << 'left' unless similar_left?(anOther, @similarity)
            info << 'top' unless similar_top?(anOther, @similarity)
    Severity: Minor
    Found in lib/dom_glancy/element.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 page_map_same? has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def page_map_same?(test_root)
          purge_old_files_before_test(test_root)
          fnb = ::DomGlancy::FileNameBuilder.new(test_root)
    
          result, msg = ::DomGlancy::PageMapper.new.run(test_root)
    Severity: Minor
    Found in lib/dom_glancy/dom_glancy.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 extract_changed_elements has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def extract_changed_elements
          @changed_element_pairs = []
    
          @set_current_not_master.each do |item1|           # in current
            element1 = DOMElement.new(item1)
    Severity: Minor
    Found in lib/dom_glancy/analyzer.rb - About 45 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 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def initialize(test_root, set_current_not_master,set_master_not_current, set_changed_master, changed_pairs)
    Severity: Minor
    Found in lib/dom_glancy/analysis_reporter.rb - About 35 mins to fix

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

        def bless
          blessings = []
          params.each_pair { |k, v| blessings << v if k.start_with?('option_') }
      
          blessings.each do |blessing|
      Severity: Minor
      Found in app/controllers/dom_glancy_controller.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 similarity_level has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def similarity_level(anOther)
            level = 0
            if same_element?(anOther) && same_style?(anOther)
              level += 1 if similar_location?(anOther, @similarity) and !same_location?(anOther)
              level += 1 if similar_size?(anOther, @similarity)     and !same_size?(anOther)
      Severity: Minor
      Found in lib/dom_glancy/element.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