Showing 456 of 456 total issues
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Then /^(?:|I )should not see "([^"]*)"$/ do |text|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Unused block argument - tags_table
. You can omit the argument if you don't care about it. Open
Given /^the following tags csv "([^"]*)" exists:$/ do |tags_table|
- 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
Unused block argument - tag
. You can omit the argument if you don't care about it. Open
When(/^I press confirm for tag "([^"]*)"$/) do |tag|
- 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
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Then /^"(.*)" should have (\d) downvotes?$/ do |message, downvotes|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Useless assignment to variable - h2
. Open
h2 = Hint.create!({:content => "hint 2", :tag2wronganswer_id => tag2wa_3.id})
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
end
(...)
interpreted as grouped expression. Open
before (:each) do
- Read upRead up
- Exclude checks
Checks for space between the name of a called method and a left parenthesis.
Example:
# bad
puts (x + y)
Example:
# good
puts(x + y)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Given /^I choose to upload a file with "([^"]*)"$/ do |filename|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Unused block argument - concept
. You can omit all the arguments if you don't care about them. Open
When /^I press "([^"]*)" for concept "([^"]*)" and tag "([^"]*)"$/ do |button, concept, tag|
- 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
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Given /^the following concepts exist:$/ do |concepts_table|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
And /^the following messages exist:$/ do |messages_table|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
(...)
interpreted as grouped expression. Open
before (:each) do
- Read upRead up
- Exclude checks
Checks for space between the name of a called method and a left parenthesis.
Example:
# bad
puts (x + y)
Example:
# good
puts(x + y)
Useless assignment to variable - tag4
. Open
tag4 = Tag.create!({:name => "test_tag 4", :description => "irrelephant", :example => "example_2"})
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
end
Useless assignment to variable - concept4
. Open
concept4 = Concept.create!({:name => "test_concept 4", :description => "irrelevant"})
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
end
Useless assignment to variable - tag3
. Open
tag3 = Tag.create!({:name => "test_tag 3", :description => "irrelephant", :example => "example"})
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
end
Useless assignment to variable - concept3
. Open
concept3 = Concept.create!({:name => "test_concept 3", :description => "irrelevant"})
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
end