wycleffsean/haypub

View on GitHub

Showing 6 of 74 total issues

Method has too many lines. [19/10]
Open

  def coerce(val)
    case val
    when :sun, :sunday
      return 1
    when :mon, :monday
Severity: Minor
Found in lib/payhub/attributes.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Cyclomatic complexity for coerce is too high. [9/6]
Open

  def coerce(val)
    case val
    when :sun, :sunday
      return 1
    when :mon, :monday
Severity: Minor
Found in lib/payhub/attributes.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Avoid too many return statements within this method.
Open

      return 7
Severity: Major
Found in lib/payhub/attributes.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return 5
    Severity: Major
    Found in lib/payhub/attributes.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return 6
      Severity: Major
      Found in lib/payhub/attributes.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return val
        Severity: Major
        Found in lib/payhub/attributes.rb - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language