theodi/coopy-ruby

View on GitHub

Showing 53 of 53 total issues

Method hilite has a Cognitive Complexity of 402 (exceeds 5 allowed). Consider refactoring.
Open

    def hilite(output)  
      return false if (!output.is_resizable?)
      output.resize(0,0)
      output.clear

Severity: Minor
Found in lib/coopy/table_diff.rb - About 1 wk 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 hilite has 438 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def hilite(output)  
      return false if (!output.is_resizable?)
      output.resize(0,0)
      output.clear

Severity: Major
Found in lib/coopy/table_diff.rb - About 2 days to fix

    Method to_order_3 has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
    Open

        def to_order_3
          ref = @reference
          if ref.nil?
            ref = Coopy::Alignment.new
            ref.range(@ha,@ha)
    Severity: Minor
    Found in lib/coopy/alignment.rb - About 1 day 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

    File table_diff.rb has 576 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Coopy
      class TableDiff 
    
        def initialize(align, flags) 
          @align = align # Alignment
    Severity: Major
    Found in lib/coopy/table_diff.rb - About 1 day to fix

      Method examine_cell has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.examine_cell(x, y, value, vcol, vrow, vcorner, cell)  
              cell.category = ""
              cell.category_given_tr = ""
              cell.separator = ""
              cell.conflicted = false
      Severity: Minor
      Found in lib/coopy/diff_render.rb - About 7 hrs 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 to_order_3 has 148 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def to_order_3
            ref = @reference
            if ref.nil?
              ref = Coopy::Alignment.new
              ref.range(@ha,@ha)
      Severity: Major
      Found in lib/coopy/alignment.rb - About 5 hrs to fix

        Method align_core_2 has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
        Open

            def align_core_2(align, a, b) 
              if (align.meta.nil?) 
                align.meta = Coopy::Alignment.new
              end
              align_columns(align.meta,a,b)
        Severity: Minor
        Found in lib/coopy/compare_table.rb - About 5 hrs 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 align_columns has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

            def align_columns(align, a, b) 
              align.range(a.width,b.width)
              align.tables(a,b)
              align.set_rowlike(false)
                
        Severity: Minor
        Found in lib/coopy/compare_table.rb - About 5 hrs 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 spread_context has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            def spread_context(units, del, active) 
              if (del>0 && active != nil) 
                # forward
                mark = -del-1
                skips = 0
        Severity: Minor
        Found in lib/coopy/table_diff.rb - About 4 hrs 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 align_core_2 has 103 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def align_core_2(align, a, b) 
              if (align.meta.nil?) 
                align.meta = Coopy::Alignment.new
              end
              align_columns(align.meta,a,b)
        Severity: Major
        Found in lib/coopy/compare_table.rb - About 4 hrs to fix

          Method trim_blank has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

              def trim_blank
                return true if (h==0)
                h_test = @height
                h_test = 3 if (h_test>=3)
                view = get_cell_view
          Severity: Minor
          Found in lib/coopy/simple_table.rb - About 3 hrs 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 align_columns has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def align_columns(align, a, b) 
                align.range(a.width,b.width)
                align.tables(a,b)
                align.set_rowlike(false)
                  
          Severity: Major
          Found in lib/coopy/compare_table.rb - About 3 hrs to fix

            File compare_table.rb has 289 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module Coopy
              class CompareTable
            
                def attach(comp)
                  @comp = comp # TableComparisonState
            Severity: Minor
            Found in lib/coopy/compare_table.rb - About 2 hrs to fix

              Method examine_cell has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def self.examine_cell(x, y, value, vcol, vrow, vcorner, cell)  
                      cell.category = ""
                      cell.category_given_tr = ""
                      cell.separator = ""
                      cell.conflicted = false
              Severity: Major
              Found in lib/coopy/diff_render.rb - About 2 hrs to fix

                Method render has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    def render(rows) 
                        return if (rows.width==0||rows.height==0)
                        render = self
                        render.begin_table()
                        change_row = -1
                Severity: Minor
                Found in lib/coopy/diff_render.rb - About 2 hrs 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

                File diff_render.rb has 271 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module Coopy
                  class DiffRender 
                
                    def initialize  
                        @text_to_insert = []
                Severity: Minor
                Found in lib/coopy/diff_render.rb - About 2 hrs to fix

                  Method move_without_extras has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def self.move_without_extras(src, dest)
                        return nil if (src.length!=dest.length) 
                        return [] if (src.length<=1)
                        
                        len = src.length
                  Severity: Major
                  Found in lib/coopy/mover.rb - About 2 hrs to fix

                    Method get_separator has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def get_separator(t, t2, root)
                          sep = root
                          w = t.width
                          h = t.height
                          view = t.get_cell_view
                    Severity: Minor
                    Found in lib/coopy/table_diff.rb - About 2 hrs 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_reordered has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def is_reordered(m, ct) 
                          reordered = false
                          l = -1
                          r = -1
                          (0..ct-1).each do |i|
                    Severity: Minor
                    Found in lib/coopy/table_diff.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 sample_css has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def sample_css() 
                            return ".highlighter .add  
                      background-color: #7fff7f
                    end
                    
                    
                    Severity: Minor
                    Found in lib/coopy/diff_render.rb - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language