zeisler/active_mocker

View on GitHub
lib/active_mocker/loaded_mocks.rb

Summary

Maintainability
A
0 mins
Test Coverage

Avoid multi-line chains of blocks. (https://github.com/bbatsov/ruby-style-guide#single-line-blocks)
Open

          end.any? { |a| a }
Severity: Minor
Found in lib/active_mocker/loaded_mocks.rb by rubocop

This cop checks for chaining of a block after another block that spans multiple lines.

Example:

Thread.list.find_all do |t|
  t.alive?
end.map do |t|
  t.object_id
end

Method ActiveMocker::LoadedMocks.mocks is defined at both lib/active_mocker/loaded_mocks.rb:17 and lib/active_mocker/loaded_mocks.rb:77.
Open

        def mocks
Severity: Minor
Found in lib/active_mocker/loaded_mocks.rb by rubocop

This cop checks for duplicated instance (or singleton) method definitions.

Example:

# bad

def duplicated
  1
end

def duplicated
  2
end

Example:

# bad

def duplicated
  1
end

alias duplicated other_duplicated

Example:

# good

def duplicated
  1
end

def other_duplicated
  2
end

Use %i or %I for an array of symbols. (https://github.com/bbatsov/ruby-style-guide#percent-i)
Open

            if [:to_str, :to_sym].any? { |i| e.respond_to? i }
Severity: Minor
Found in lib/active_mocker/loaded_mocks.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

Line is too long. [123/120] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

        # Input ActiveRecord Model Name as String or Symbol and it returns everything but that ActiveMock equivalent class.
Severity: Minor
Found in lib/active_mocker/loaded_mocks.rb by rubocop

Line is too long. [124/120] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

        # @param [Array<Symbol, String, ActiveMocker::Mock>] args an array of ActiveRecord Model Names as Strings or Symbols
Severity: Minor
Found in lib/active_mocker/loaded_mocks.rb by rubocop

There are no issues that match your filters.

Category
Status