aef/weekling

View on GitHub

Showing 7 of 7 total issues

Class Week has 27 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Week
      include Comparable
    
      # Regular expression for week extraction from strings.
      # @private
Severity: Minor
Found in lib/aef/weekling/week.rb - About 3 hrs to fix

    Class WeekDay has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class WeekDay
          include Comparable
        
          # Table to translate symbolic lowercase english day names to day numbers.
          # @private
    Severity: Minor
    Found in lib/aef/weekling/week_day.rb - About 2 hrs to fix

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

          class Year
            include Comparable
      
            # Regular expression for Year extraction from strings.
            # @private
      Severity: Minor
      Found in lib/aef/weekling/year.rb - About 2 hrs to fix

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

              def initialize(*arguments)
                case arguments.count
                when 1
                  object = arguments.first
                  if [:week, :index].all?{|method_name| object.respond_to?(method_name) }
        Severity: Minor
        Found in lib/aef/weekling/week_day.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 initialize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

              def initialize(*arguments)
                case arguments.count
                when 1
                  object = arguments.first
                  if [:year, :index].all?{|method_name| object.respond_to?(method_name) }
        Severity: Minor
        Found in lib/aef/weekling/week.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 initialize has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def initialize(*arguments)
                case arguments.count
                when 1
                  object = arguments.first
                  if [:week, :index].all?{|method_name| object.respond_to?(method_name) }
        Severity: Minor
        Found in lib/aef/weekling/week_day.rb - About 1 hr to fix

          Method initialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def initialize(*arguments)
                  case arguments.count
                  when 1
                    object = arguments.first
                    if [:year, :index].all?{|method_name| object.respond_to?(method_name) }
          Severity: Minor
          Found in lib/aef/weekling/week.rb - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language