Showing 661 of 695 total issues
Name your test subject if you need to reference it explicitly. Open
expect(subject.content).to eq '{"name":"YYY"}'
- Create a ticketCreate a ticket
- Exclude checks
Missing top-level module documentation comment. Open
module ClassMethods
- Read upRead up
- Create a ticketCreate a ticket
- 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 let
instead of an instance variable. Open
expect(@hat.type_code).to eq(nil)
- Create a ticketCreate a ticket
- Exclude checks
Variable Cache
used in void context. Open
Card::Cache # trigger autoload
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for operators, variables and literals used in void context.
Example:
# bad
def some_method
some_num * 10
do_something
end
Example:
# bad
def some_method(some_var)
some_var
do_something
end
Example:
# good
def some_method
do_something
some_num * 10
end
Example:
# good
def some_method(some_var)
do_something
some_var
end
Variable Chunk
used in void context. Open
Chunk # trigger autoload
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for operators, variables and literals used in void context.
Example:
# bad
def some_method
some_num * 10
do_something
end
Example:
# bad
def some_method(some_var)
some_var
do_something
end
Example:
# good
def some_method
do_something
some_num * 10
end
Example:
# good
def some_method(some_var)
do_something
some_var
end
Use let
instead of an instance variable. Open
expect(@a.format._render(:raw)).to eq("{{A}}")
- Create a ticketCreate a ticket
- Exclude checks
Empty example group detected. Open
describe Card::Format::FileFormat do
- Create a ticketCreate a ticket
- Exclude checks
Missing top-level module documentation comment. Open
module BasicTags
- Read upRead up
- Create a ticketCreate a ticket
- 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
Missing top-level class documentation comment. Open
class BuilderTest < Card::Bootstrap::Component
- Read upRead up
- Create a ticketCreate a ticket
- 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
Name your test subject if you need to reference it explicitly. Open
subject.bs_form do
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
Card::Content.new(@content, Card.new(type: "Search")).find_chunks(:QueryReference)
- Create a ticketCreate a ticket
- Exclude checks
Use let
instead of an instance variable. Open
@bt.content = "Tomorrow"
- Create a ticketCreate a ticket
- Exclude checks
Empty example group detected. Open
RSpec.describe Card::Set::Self::Recent do
- Create a ticketCreate a ticket
- Exclude checks
Add an empty line after magic comments. Open
require_relative "card/lib/cardio/version"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for a newline after the final magic comment.
Example:
# good
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
Missing top-level class documentation comment. Open
class XmlFormat < DataFormat
- Read upRead up
- Create a ticketCreate a ticket
- 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
Empty example group detected. Open
describe Card::Format::RssFormat do
- Create a ticketCreate a ticket
- Exclude checks
Missing top-level class documentation comment. Open
class Form < Component
- Read upRead up
- Create a ticketCreate a ticket
- 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
Missing top-level class documentation comment. Open
class ViewStub < Abstract
- Read upRead up
- Create a ticketCreate a ticket
- 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 let
instead of an instance variable. Open
jb = @jb.refresh true
- Create a ticketCreate a ticket
- Exclude checks
Pass __FILE__
and __LINE__
to eval
method, as they are used by backtraces. Open
eval "#{set_module}.module_eval ::File.read('#{abs_path}'), '#{abs_path}'",
module_path_binding(set_module)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks eval
method usage. eval
can receive source location
metadata, that are filename and line number. The metadata is used by
backtraces. This cop recommends to pass the metadata to eval
method.
Example:
# bad
eval <<-RUBY
def do_something
end
RUBY
# bad
C.class_eval <<-RUBY
def do_something
end
RUBY
# good
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
def do_something
end
RUBY
# good
C.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def do_something
end
RUBY