DevelopingCoder/cs61a_hintr

View on GitHub

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|

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|

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|

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|

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})
Severity: Minor
Found in spec/models/past_hints_spec.rb by rubocop

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 

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|

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|

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|

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|

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| 

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

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"})

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"})

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"})

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"})

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
Severity
Category
Status
Source
Language