houston/houston-core

View on GitHub

Showing 1,937 of 1,937 total issues

Prefer $ERROR_INFO from the stdlib 'English' module (don't forget to require it) over $!.
Open

            $!.additional_information[:event] = event
Severity: Minor
Found in lib/houston/boot/observer.rb by rubocop

Line is too long. [106/80]
Open

          rescue Exception # rescues StandardError by default; but we want to rescue and report all errors
Severity: Minor
Found in lib/houston/boot/observer.rb by rubocop

Use Integer instead of Fixnum.
Open

    options = { max_tries: options } if options.is_a?(Fixnum)
Severity: Minor
Found in lib/houston/try.rb by rubocop

This cop checks for using Fixnum or Bignum constant.

Example:

# bad

1.is_a?(Fixnum)
1.is_a?(Bignum)

Example:

# good

1.is_a?(Integer)

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

      super(string || "{}")
Severity: Minor
Found in lib/houston/params_serializer.rb by rubocop

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"

Line is too long. [82/80]
Open

      Rails.logger.warn "\e[31m[try] \e[1m#{$!.class}\e[0;31m: #{$!.message}\e[0m"
Severity: Minor
Found in lib/houston/try.rb by rubocop

Extra empty line detected at module body end.
Open


end
Severity: Minor
Found in lib/houston/try.rb by rubocop

This cops checks if empty lines around the bodies of modules match the configuration.

Example: EnforcedStyle: empty_lines

# good

module Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

module Foo
  module Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
module Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

module Foo
  def bar
    # ...
  end
end

Trailing whitespace detected.
Open

# 
Severity: Minor
Found in lib/tasks/specific_tests.rake by rubocop

Line is too long. [85/80]
Open

      raise UnregisteredEventError, "#{event_name.inspect} is not a registered event"
Severity: Minor
Found in lib/houston/boot/observer.rb by rubocop

Trailing whitespace detected.
Open

    
Severity: Minor
Found in lib/tasks/specific_tests.rake by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

      if unregistered_params.any?
Severity: Minor
Found in lib/houston/boot/observer.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

Line is too long. [86/80]
Open

    longest_params = Houston.events.map { |event| event.params.join(", ").length }.max
Severity: Minor
Found in lib/tasks/events.rake by rubocop

Prefer to_s over string interpolation.
Open

      params = "#{event.params.join(", ")}" if event.params.any?
Severity: Minor
Found in lib/tasks/events.rake by rubocop

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Line is too long. [105/80]
Open

      raise ArgumentError, "params must be a Hash, but it is a #{object.class}" unless object.is_a?(Hash)
Severity: Minor
Found in lib/houston/params_serializer.rb by rubocop

Line is too long. [109/80]
Open

      puts "  \e[36m#{action.name.ljust(longest_name)}\e[0m  \e[96m#{params.to_s.ljust(longest_params)}\e[0m"
Severity: Minor
Found in lib/tasks/actions.rake by rubocop

Prefer single-quoted strings inside interpolations.
Open

      params = "#{event.params.join(", ")}" if event.params.any?
Severity: Minor
Found in lib/tasks/events.rake by rubocop

This cop checks that quotes inside the string interpolation match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
result = "Tests #{success ? "PASS" : "FAIL"}"

# good
result = "Tests #{success ? 'PASS' : 'FAIL'}"

Example: EnforcedStyle: double_quotes

# bad
result = "Tests #{success ? 'PASS' : 'FAIL'}"

# good
result = "Tests #{success ? "PASS" : "FAIL"}"

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    longest_params = Houston.events.map { |event| event.params.join(", ").length }.max
Severity: Minor
Found in lib/tasks/events.rake by rubocop

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"

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  gem "pry"
Severity: Minor
Found in Gemfile by rubocop

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"

Line is too long. [90/80]
Open

    longest_params = actions.map { |action| action.required_params.join(", ").length }.max
Severity: Minor
Found in lib/tasks/actions.rake by rubocop

Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem rr should appear before timecop.
Open

  gem "rr"
Severity: Minor
Found in Gemfile by rubocop

Gems should be alphabetically sorted within groups.

Example:

# bad
gem 'rubocop'
gem 'rspec'

# good
gem 'rspec'
gem 'rubocop'

# good
gem 'rubocop'

gem 'rspec'

# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  gem "factory_girl_rails", "4.9.0"
Severity: Minor
Found in Gemfile by rubocop

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