backlogs/redmine_backlogs

View on GitHub
lib/backlogs_spreadsheet.rb

Summary

Maintainability
D
1 day
Test Coverage

Method []= has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def []=(row, col, c)
      @row = row
      @col = col + 1

      if c
Severity: Minor
Found in lib/backlogs_spreadsheet.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 load has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def load(data)
      @worksheets = []
      @stylemanager = StyleManager.new

      if data.is_a?(String)
Severity: Minor
Found in lib/backlogs_spreadsheet.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

File backlogs_spreadsheet.rb has 273 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'rubygems'
require 'nokogiri'
require 'time'
require 'date'
require 'delegate'
Severity: Minor
Found in lib/backlogs_spreadsheet.rb - About 2 hrs to fix

    Method load has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def load(data)
          @worksheets = []
          @stylemanager = StyleManager.new
    
          if data.is_a?(String)
    Severity: Minor
    Found in lib/backlogs_spreadsheet.rb - About 1 hr to fix

      Method []= has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def []=(row, col, c)
            @row = row
            @col = col + 1
      
            if c
      Severity: Minor
      Found in lib/backlogs_spreadsheet.rb - About 1 hr to fix

        Method initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def initialize(options)
              # make a deep clone to avoid other people messing with our data
              options = Marshal.load( Marshal.dump( options ) )
        
              @id = options.delete(:id)
        Severity: Minor
        Found in lib/backlogs_spreadsheet.rb - About 55 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

        Consider simplifying this complex logical expression.
        Open

              if options[:font] && options[:font].size > 0
                @font = {
                  'ss:FontName' => options[:font][:name] || 'Calibri',
                  'x:Family' => options[:font][:name] || 'Swiss',
                  'ss:Size' => options[:font][:size] || 11,
        Severity: Major
        Found in lib/backlogs_spreadsheet.rb - About 40 mins to fix

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

              def add(s)
                ns = Style.new(s)
                @styles.each {|s|
                  next unless s == ns
                  return s if s.id == ns.id || ns.auto
          Severity: Minor
          Found in lib/backlogs_spreadsheet.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

          There are no issues that match your filters.

          Category
          Status