Showing 4,497 of 4,497 total issues
Prefer Date or Time over DateTime. Open
create(:assignment_due_date, deadline_type: DeadlineType.where(name: 'review').first, due_at: DateTime.now.in_time_zone + 2.days)
- Read upRead up
- Exclude checks
This cop checks for uses of DateTime
that should be replaced by
Date
or Time
.
Example:
# bad - uses `DateTime` for current time
DateTime.now
# good - uses `Time` for current time
Time.now
# bad - uses `DateTime` for modern date
DateTime.iso8601('2016-06-29')
# good - uses `Date` for modern date
Date.iso8601('2016-06-29')
# good - uses `DateTime` with start argument for historical date
DateTime.iso8601('1751-04-23', Date::ENGLAND)
include
is used at the top level. Use inside class
or module
. Open
include InstructorInterfaceHelperSpec
- Read upRead up
- Exclude checks
This cop checks that include
, extend
and prepend
exists at
the top level.
Using these at the top level affects the behavior of Object
.
There will not be using include
, extend
and prepend
at
the top level. Let's use it inside class
or module
.
Example:
# bad
include M
class C
end
# bad
extend M
class C
end
# bad
prepend M
class C
end
# good
class C
include M
end
# good
class C
extend M
end
# good
class C
prepend M
end
Surrounding space missing for operator =>
. Open
expect(compute_reviews_hash(assignment)).to eq({1=>{1=>{1=>50}}, 2=>{1=>{1=>30}}})
- Read upRead up
- Exclude checks
Checks that operators have space around them, except for ** which should not have surrounding space.
Example:
# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b
# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b
Space inside { missing. Open
expect(compute_reviews_hash(assignment)).to eq({1=>{1=>{1=>50}}, 2=>{1=>{1=>30}}})
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
# good
h = { a: { b: 2 }}
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
expect(email.from[0]).to eq("expertiza.development@gmail.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"
Use loc.scan(/\.(to|not_to|to_not)/).count.zero?
instead of loc.scan(/\.(to|not_to|to_not)/).count == 0
. Open
num_of_expectation_without_machers = added_lines_arr.count { |loc| (loc.scan(/^\+\s*expect\s*[\(\{]/).count > 0) && (loc.scan(/\.(to|not_to|to_not)/).count == 0) }
- Read upRead up
- Exclude checks
This cop checks for usage of comparison operators (==
,
>
, <
) to test numbers as zero, positive, or negative.
These can be replaced by their respective predicate methods.
The cop can also be configured to do the reverse.
The cop disregards #nonzero?
as it its value is truthy or falsey,
but not true
and false
, and thus not always interchangeable with
!= 0
.
The cop ignores comparisons to global variables, since they are often
populated with objects which can be compared with integers, but are
not themselves Interger
polymorphic.
Example: EnforcedStyle: predicate (default)
# bad
foo == 0
0 > foo
bar.baz > 0
# good
foo.zero?
foo.negative?
bar.baz.positive?
Example: EnforcedStyle: comparison
# bad
foo.zero?
foo.negative?
bar.baz.positive?
# good
foo == 0
0 > foo
bar.baz > 0
TODO found Open
## TODO: If you have NuGet Package Restore enabled, uncomment this
- Exclude checks
TODO found Open
# TODO: Further test for reputation web service required
- Exclude checks
TODO found Open
if PR_ADDED.include?('TODO') ||
- Exclude checks
TODO found Open
# TODO: test for round 2
- Exclude checks
TODO found Open
# TODO create_approved_user name is misleading. The tests are also wrong for this.
- Exclude checks
TODO found Open
# TODO: change metareview_response_map relationship to belongs_to
- Exclude checks
TODO found Open
# TODO: Remove this permit! and replace it with appropriate strong params after testing.
- Exclude checks
TODO found Open
This pull request contains `TODO` or `FIXME` task(s); please fix them.
- Exclude checks
TODO found Open
# TODO: Create a common definition for both create and update to reduce it to single params method
- Exclude checks
FIXME found Open
PR_ADDED.include?('FIXME') ||
- Exclude checks
FIXME found Open
This pull request contains `TODO` or `FIXME` task(s); please fix them.
- Exclude checks