Showing 1,160 of 1,256 total issues
Color literals like #085036
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
to(#085036)
- Exclude checks
Missing top-level class documentation comment. Open
class Importer::WasteCalendar
- Read upRead up
- Exclude checks
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
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. Open
default from: 'from@example.com'
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Missing magic comment # frozen_string_literal: true
. Open
require 'test_helper'
- Read upRead up
- Exclude checks
This cop is designed to help upgrade to after Ruby 3.0. It will add the
comment # frozen_string_literal: true
to the top of files to
enable frozen string literals. Frozen string literals may be default
after Ruby 3.0. The comment will be added below a shebang and encoding
comment. The frozen string literal comment is only valid in Ruby 2.3+.
Example: EnforcedStyle: always (default)
# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
# ...
end
# good
# frozen_string_literal: true
module Bar
# ...
end
Example: EnforcedStyle: never
# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true
module Baz
# ...
end
# good
module Baz
# ...
end
Missing magic comment # frozen_string_literal: true
. Open
# This file is used by Rack-based servers to start the application.
- Read upRead up
- Exclude checks
This cop is designed to help upgrade to after Ruby 3.0. It will add the
comment # frozen_string_literal: true
to the top of files to
enable frozen string literals. Frozen string literals may be default
after Ruby 3.0. The comment will be added below a shebang and encoding
comment. The frozen string literal comment is only valid in Ruby 2.3+.
Example: EnforcedStyle: always (default)
# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
# ...
end
# good
# frozen_string_literal: true
module Bar
# ...
end
Example: EnforcedStyle: never
# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true
module Baz
# ...
end
# good
module Baz
# ...
end
Line is too long. [116/100] Open
if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
- Exclude checks
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. Open
require 'rails/test_help'
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Unused block argument - worker
. You can omit all the arguments if you don't care about them. Open
after_fork do |server, worker|
- Read upRead up
- Exclude checks
This cop checks for unused block arguments.
Example:
# bad
do_something do |used, unused|
puts used
end
do_something do |bar|
puts :foo
end
define_method(:foo) do |bar|
puts :baz
end
Example:
#good
do_something do |used, _unused|
puts used
end
do_something do
puts :foo
end
define_method(:foo) do |_bar|
puts :baz
end
Color literals like #11223f
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
color: #11223f;
- Exclude checks
Avoid using id selectors Open
#sidebarToggleTop {
- Exclude checks
Missing top-level class documentation comment. Open
class PushNotificationsController < ApplicationController
- Read upRead up
- Exclude checks
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
Use //
comments everywhere Open
/*
- Exclude checks
Selector sidebarToggleTop
should be written in lowercase with hyphens Open
#sidebarToggleTop {
- Exclude checks
Use //
comments everywhere Open
margin-left: 104px; /* NOTE: necessary because of the sidebar */
- Exclude checks
Selector sidebarToggleTop
should be written in lowercase with hyphens Open
#sidebarToggleTop.toggled {
- Exclude checks
Use the return of the conditional for variable assignment and comparison. Open
if results.try(:data).try(:destroy_record).try(:status_code) == 200
flash["notice"] = "Eintrag wurde gelöscht"
else
flash["notice"] = "Fehler: #{results.errors.inspect}"
end
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression. Open
if @event_params["organizer"].present?
- Read upRead up
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression
Example:
# bad
def test
if something
work
end
end
# good
def test
return unless something
work
end
# also good
def test
work if something
end
# bad
if something
raise 'exception'
else
ok
end
# good
raise 'exception' if something
ok
Line is too long. [117/100] Open
query = Converter::Base.new.build_mutation("createWasteTour", waste_tour_params, waste_tour_params.include?(:id))
- Exclude checks
Missing magic comment # frozen_string_literal: true
. Open
require "test_helper"
- Read upRead up
- Exclude checks
This cop is designed to help upgrade to after Ruby 3.0. It will add the
comment # frozen_string_literal: true
to the top of files to
enable frozen string literals. Frozen string literals may be default
after Ruby 3.0. The comment will be added below a shebang and encoding
comment. The frozen string literal comment is only valid in Ruby 2.3+.
Example: EnforcedStyle: always (default)
# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
# ...
end
# good
# frozen_string_literal: true
module Bar
# ...
end
Example: EnforcedStyle: never
# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true
module Baz
# ...
end
# good
module Baz
# ...
end
Color literals like #085036
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
background-image: linear-gradient(180deg, #2d963c 10%, #085036 100%);
- Exclude checks