jain-nikunj/room-reservation-app

View on GitHub
features/support/paths.rb

Summary

Maintainability
A
0 mins
Test Coverage

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

  def path_to(page_name)
    case page_name

    when /^the (RoomReservation )?home\s?page$/ then '/buildings'

Severity: Minor
Found in features/support/paths.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.

Align the operands of an expression spanning multiple lines.
Open

          "Now, go and add a mapping in #{__FILE__}"
Severity: Minor
Found in features/support/paths.rb by rubocop

This cop checks the indentation of the right hand side operand in binary operations that span more than one line.

Example:

# bad
if a +
b
  something
end

# good
if a +
   b
  something
end

Redundant self detected.
Open

        self.send(path_components.push('path').join('_').to_sym)
Severity: Minor
Found in features/support/paths.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Extra blank line detected.
Open


    # Add more mappings here.
Severity: Minor
Found in features/support/paths.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Use \ instead of + or << to concatenate those strings.
Open

        raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
Severity: Minor
Found in features/support/paths.rb by rubocop

This cop checks for string literal concatenation at the end of a line.

Example:

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

Avoid the use of Perl-style backrefs.
Open

        path_components = $1.split(/\s+/)
Severity: Minor
Found in features/support/paths.rb by rubocop

This cop looks for uses of Perl-style regexp match backreferences like $1, $2, etc.

Example:

# bad
puts $1

# good
puts Regexp.last_match(1)

There are no issues that match your filters.

Category
Status