znamenica/dneslov

View on GitHub
app/controllers/admin/places_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Space missing after semicolon.
Open

         model.none ;end;end

Checks for semicolon (;) not followed by some kind of space.

Example:

# bad
x = 1;y = 2

# good
x = 1; y = 2

Do not use space inside reference brackets.
Open

         model.by_token(params[ :t ])

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

Do not use space inside reference brackets.
Open

      elsif params[ :v ] && params[ :value_name ]

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

end at 13, 25 is not aligned with def at 6, 3.
Open

         model.none ;end;end

This cop checks whether the end keywords of method definitions are aligned properly.

Two modes are supported through the EnforcedStyleAlignWith configuration parameter. If it's set to start_of_line (which is the default), the end shall be aligned with the start of the line where the def keyword is. If it's set to def, the end shall be aligned with the def keyword.

Example: EnforcedStyleAlignWith: startofline (default)

# bad

private def foo
            end

# good

private def foo
end

Example: EnforcedStyleAlignWith: def

# bad

private def foo
            end

# good

private def foo
        end

Indent the first line of the right-hand-side of a multi-line assignment.
Open

      if params[ :t ]
         model.by_token(params[ :t ])
      elsif params[ :v ] && params[ :value_name ]
         model.where(params[ :v ] => params[ :v ])
      else

This cop checks the indentation of the first line of the right-hand-side of a multi-line assignment.

Example:

# bad
value =
if foo
  'bar'
end

# good
value =
  if foo
    'bar'
  end

The indentation of the remaining lines can be corrected with other cops such as IndentationConsistency and EndAlignment.

Do not use space inside reference brackets.
Open

         model.where(params[ :v ] => params[ :v ])

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

Space missing after semicolon.
Open

      params.require( :place ).permit() ;end

Checks for semicolon (;) not followed by some kind of space.

Example:

# bad
x = 1;y = 2

# good
x = 1; y = 2

end at 19, 41 is not aligned with def at 18, 3.
Open

      params.require( :place ).permit() ;end

This cop checks whether the end keywords of method definitions are aligned properly.

Two modes are supported through the EnforcedStyleAlignWith configuration parameter. If it's set to start_of_line (which is the default), the end shall be aligned with the start of the line where the def keyword is. If it's set to def, the end shall be aligned with the def keyword.

Example: EnforcedStyleAlignWith: startofline (default)

# bad

private def foo
            end

# good

private def foo
end

Example: EnforcedStyleAlignWith: def

# bad

private def foo
            end

# good

private def foo
        end

Use nested module/class definitions instead of compact style.
Open

class Admin::PlacesController < Admin::CommonController

This cop checks the style of children definitions at classes and modules. Basically there are two different styles:

Example: EnforcedStyle: nested (default)

# good
# have each child on its own line
class Foo
  class Bar
  end
end

Example: EnforcedStyle: compact

# good
# combine definitions as much as possible
class Foo::Bar
end

The compact style is only forced for classes/modules with one child.

Space inside parentheses detected.
Open

      params.require( :place ).permit() ;end

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Do not use space inside reference brackets.
Open

      elsif params[ :v ] && params[ :value_name ]

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

Do not use space inside reference brackets.
Open

         model.where(params[ :v ] => params[ :v ])

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

Do not use space inside reference brackets.
Open

         model.where(params[ :v ] => params[ :v ])

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

end at 13, 21 is not aligned with if at 8, 6.
Open

         model.none ;end;end

This cop checks whether the end keywords are aligned properly.

Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

Example: EnforcedStyleAlignWith: keyword (default)

# bad

variable = if true
    end

# good

variable = if true
           end

Example: EnforcedStyleAlignWith: variable

# bad

variable = if true
    end

# good

variable = if true
end

Example: EnforcedStyleAlignWith: startofline

# bad

variable = if true
    end

# good

puts(if true
end)

Space missing after semicolon.
Open

      Admin::PlacesSerializer ;end;end

Checks for semicolon (;) not followed by some kind of space.

Example:

# bad
x = 1;y = 2

# good
x = 1; y = 2

Missing top-level class documentation comment.
Open

class Admin::PlacesController < Admin::CommonController

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Space found before semicolon.
Open

      Admin::PlacesSerializer ;end;end

Checks for semicolon (;) preceded by space.

Example:

# bad
x = 1 ; y = 2

# good
x = 1; y = 2

Do not use space inside reference brackets.
Open

         model.by_token(params[ :t ])

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

%i-literals should be delimited by [ and ].
Open

   before_action :set_places, only: %i(all)

This cop enforces the consistent usage of %-literal delimiters.

Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

Example:

# Style/PercentLiteralDelimiters:
#   PreferredDelimiters:
#     default: '[]'
#     '%i':    '()'

# good
%w[alpha beta] + %i(gamma delta)

# bad
%W(alpha #{beta})

# bad
%I(alpha beta)

Space missing after semicolon.
Open

      Place ;end

Checks for semicolon (;) not followed by some kind of space.

Example:

# bad
x = 1;y = 2

# good
x = 1; y = 2

Space missing after semicolon.
Open

      Admin::PlaceSerializer ;end

Checks for semicolon (;) not followed by some kind of space.

Example:

# bad
x = 1;y = 2

# good
x = 1; y = 2

Space found before semicolon.
Open

         model.none ;end;end

Checks for semicolon (;) preceded by space.

Example:

# bad
x = 1 ; y = 2

# good
x = 1; y = 2

Do not use space inside reference brackets.
Open

      elsif params[ :v ] && params[ :value_name ]

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

Space missing after semicolon.
Open

         model.none ;end;end

Checks for semicolon (;) not followed by some kind of space.

Example:

# bad
x = 1;y = 2

# good
x = 1; y = 2

Space found before semicolon.
Open

      Place ;end

Checks for semicolon (;) preceded by space.

Example:

# bad
x = 1 ; y = 2

# good
x = 1; y = 2

Space found before semicolon.
Open

      Admin::PlaceSerializer ;end

Checks for semicolon (;) preceded by space.

Example:

# bad
x = 1 ; y = 2

# good
x = 1; y = 2

Do not use space inside reference brackets.
Open

      if params[ :t ]

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

Do not use space inside reference brackets.
Open

      elsif params[ :v ] && params[ :value_name ]

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

end at 25, 31 is not aligned with def at 24, 3.
Open

      Admin::PlacesSerializer ;end;end

This cop checks whether the end keywords of method definitions are aligned properly.

Two modes are supported through the EnforcedStyleAlignWith configuration parameter. If it's set to start_of_line (which is the default), the end shall be aligned with the start of the line where the def keyword is. If it's set to def, the end shall be aligned with the def keyword.

Example: EnforcedStyleAlignWith: startofline (default)

# bad

private def foo
            end

# good

private def foo
end

Example: EnforcedStyleAlignWith: def

# bad

private def foo
            end

# good

private def foo
        end

Space found before semicolon.
Open

      params.require( :place ).permit() ;end

Checks for semicolon (;) preceded by space.

Example:

# bad
x = 1 ; y = 2

# good
x = 1; y = 2

Space inside parentheses detected.
Open

      params.require( :place ).permit() ;end

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

end at 22, 30 is not aligned with def at 21, 3.
Open

      Admin::PlaceSerializer ;end

This cop checks whether the end keywords of method definitions are aligned properly.

Two modes are supported through the EnforcedStyleAlignWith configuration parameter. If it's set to start_of_line (which is the default), the end shall be aligned with the start of the line where the def keyword is. If it's set to def, the end shall be aligned with the def keyword.

Example: EnforcedStyleAlignWith: startofline (default)

# bad

private def foo
            end

# good

private def foo
end

Example: EnforcedStyleAlignWith: def

# bad

private def foo
            end

# good

private def foo
        end

Place the end statement of a multi-line method on its own line.
Open

      Admin::PlacesSerializer ;end;end

This cop checks for trailing code after the method definition.

Example:

# bad
def some_method
do_stuff; end

def do_this(x)
  baz.map { |b| b.this(x) } end

def foo
  block do
    bar
  end end

# good
def some_method
  do_stuff
end

def do_this(x)
  baz.map { |b| b.this(x) }
end

def foo
  block do
    bar
  end
end

Space missing after semicolon.
Open

      Admin::PlacesSerializer ;end;end

Checks for semicolon (;) not followed by some kind of space.

Example:

# bad
x = 1;y = 2

# good
x = 1; y = 2

Do not use space inside reference brackets.
Open

      if params[ :t ]

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

end at 16, 13 is not aligned with def at 15, 3.
Open

      Place ;end

This cop checks whether the end keywords of method definitions are aligned properly.

Two modes are supported through the EnforcedStyleAlignWith configuration parameter. If it's set to start_of_line (which is the default), the end shall be aligned with the start of the line where the def keyword is. If it's set to def, the end shall be aligned with the def keyword.

Example: EnforcedStyleAlignWith: startofline (default)

# bad

private def foo
            end

# good

private def foo
end

Example: EnforcedStyleAlignWith: def

# bad

private def foo
            end

# good

private def foo
        end

Do not use parentheses for method calls with no arguments.
Open

      params.require( :place ).permit() ;end

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Do not use space inside reference brackets.
Open

         model.where(params[ :v ] => params[ :v ])

Checks that reference brackets have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: no_space (default)

# The `no_space` style enforces that reference brackets have
# no surrounding space.

# bad
hash[ :key ]
array[ index ]

# good
hash[:key]
array[index]

Example: EnforcedStyle: space

# The `space` style enforces that reference brackets have
# surrounding space.

# bad
hash[:key]
array[index]

# good
hash[ :key ]
array[ index ]

end at 25, 35 is not aligned with class at 1, 0.
Open

      Admin::PlacesSerializer ;end;end

This cop checks whether the end keywords are aligned properly.

Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

Example: EnforcedStyleAlignWith: keyword (default)

# bad

variable = if true
    end

# good

variable = if true
           end

Example: EnforcedStyleAlignWith: variable

# bad

variable = if true
    end

# good

variable = if true
end

Example: EnforcedStyleAlignWith: startofline

# bad

variable = if true
    end

# good

puts(if true
end)

There are no issues that match your filters.

Category
Status