Showing 19 of 19 total issues
Block has too many lines. [35/25] Open
describe '#at_least' do
it 'is false for an empty Array, if at least one is expected' do
expect(Kernel).to_not receive(:warn)
expect([].at_least?(1) { true }).to be_falsey
end
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [27/25] Open
describe '#at_most' do
it 'is true for an empty Array' do
expect(Kernel).to_not receive(:warn)
expect([].at_most?(5) { true }).to be_truthy
expect([].at_most?(0) { true }).to be_truthy
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Line is too long. [93/80] Open
it 'is true if all elements meet the criterion and the size is the given minimum number' do
- Exclude checks
Missing top-level class documentation comment. Open
class Example
- 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
Line is too long. [86/80] Open
it('counts 4 odd numbers') { expect(subject.occurrences_of(&:odd?)).to be 4 }
- Exclude checks
Line is too long. [81/80] Open
expect(Kernel).to receive(:warn).with(/'at_least'.+deprecated.+'at_least\?'/)
- Exclude checks
Line is too long. [148/80] Open
spec.description = 'Some methods to detect whether an Enumerable object contains a constrained number of elements that match a given condition.'
- Exclude checks
Line is too long. [110/80] Open
expect { object.at_most?(1, &:condition?) }.to raise_exception(NoMethodError, /undefined method .inject./)
- Exclude checks
2 trailing blank lines detected. Open
- Exclude checks
Line is too long. [93/80] Open
it 'is true if all elements meet the criterion and the size is the given maximum number' do
- Exclude checks
Line is too long. [87/80] Open
it('counts 3 even numbers') { expect(subject.occurrences_of(&:even?)).to be 3 }
- Exclude checks
Line is too long. [86/80] Open
spec.summary = 'Detect certain conditions of elements of an Enumerable object'
- Exclude checks
Line is too long. [114/80] Open
expect { subject.at_most?(1) { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
- Exclude checks
Line is too long. [102/80] Open
expect(obj.occurrences_of { true }).to be(0), "Expected to count 0, for an empty #{obj.class}"
- Exclude checks
Line is too long. [92/80] Open
it('counts 7 positive numbers') { expect(subject.occurrences_of { |e| e > 0 }).to be 7 }
- Exclude checks
Line is too long. [117/80] Open
expect { subject.occurrences_of { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
- Exclude checks
Freeze mutable objects assigned to constants. Open
VERSION = '1.0.8'
- Read upRead up
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Example:
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze
Line is too long. [92/80] Open
it('counts no number < 0') { expect(subject.occurrences_of { |e| e < 0 }).to be 0 }
- Exclude checks
Missing top-level module documentation comment. Open
module LimitDetectors
- 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