s2k/limit_detectors

View on GitHub

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
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

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
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

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
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Missing top-level class documentation comment.
Open

class Example
Severity: Minor
Found in example/example.rb by rubocop

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

Line is too long. [81/80]
Open

    expect(Kernel).to receive(:warn).with(/'at_least'.+deprecated.+'at_least\?'/)
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

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.'
Severity: Minor
Found in limit_detectors.gemspec by rubocop

Line is too long. [110/80]
Open

    expect { object.at_most?(1, &:condition?) }.to raise_exception(NoMethodError, /undefined method .inject./)
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

2 trailing blank lines detected.
Open

Severity: Minor
Found in Gemfile by rubocop

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
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [87/80]
Open

    it('counts 3 even numbers')     { expect(subject.occurrences_of(&:even?)).to be 3 }
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [86/80]
Open

  spec.summary       = 'Detect certain conditions of elements of an Enumerable object'
Severity: Minor
Found in limit_detectors.gemspec by rubocop

Line is too long. [114/80]
Open

    expect { subject.at_most?(1) { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [102/80]
Open

        expect(obj.occurrences_of { true }).to be(0), "Expected to count 0, for an empty #{obj.class}"
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [92/80]
Open

    it('counts 7 positive numbers') { expect(subject.occurrences_of { |e| e > 0 }).to be 7 }
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Line is too long. [117/80]
Open

    expect { subject.occurrences_of { raise ArgumentError, 'BoomError' } }.to raise_error(ArgumentError, 'BoomError')
Severity: Minor
Found in spec/limit_detectors_spec.rb by rubocop

Freeze mutable objects assigned to constants.
Open

  VERSION = '1.0.8'
Severity: Minor
Found in lib/limit_detectors/version.rb by rubocop

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

Missing top-level module documentation comment.
Open

module LimitDetectors
Severity: Minor
Found in lib/limit_detectors.rb by rubocop

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