kenjij/darksky-ruby

View on GitHub

Showing 69 of 69 total issues

Pass &:to_sym as an argument to map instead of a block.
Open

    exc = (exc.nil? ? [] : exc.split(',').map { |n| n.to_sym })
Severity: Minor
Found in lib/darksky-ruby/api.rb by rubocop

Use symbols as procs when possible.

Example:

# bad
something.map { |s| s.upcase }

# good
something.map(&:upcase)

Line is too long. [90/80]
Open

        data = new_http.public_send(method, uri, params: params, body: body, query: query)
Severity: Minor
Found in lib/darksky-ruby/http.rb by rubocop

Line is too long. [90/80]
Open

  s.description   = %q{Dark Sky gem written in pure Ruby without any external dependency.}
Severity: Minor
Found in darksky-ruby.gemspec by rubocop

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

Optimist::die :loc, "is missing" if loc.nil?
Severity: Minor
Found in bin/darksky 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"

Do not use parentheses for method calls with no arguments.
Open

    @logger ||= NullLogger.new()
Severity: Minor
Found in lib/darksky-ruby/http.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Redundant return detected.
Open

      return operate(__method__, path: path, params: params, body: body, query: query)
Severity: Minor
Found in lib/darksky-ruby/http.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Redundant return detected.
Open

      return operate(__method__, path: path, params: params, query: query)
Severity: Minor
Found in lib/darksky-ruby/http.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Redundant return detected.
Open

      return uri
Severity: Minor
Found in lib/darksky-ruby/http.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Use %i or %I for an array of symbols.
Open

  DARKSKY_BLOCK_NAMES = [
    :currently, :minutely, :hourly, :daily, :alerts, :flags
  ]
Severity: Minor
Found in lib/darksky-ruby/api.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]
Severity
Category
Status
Source
Language