kenjij/darksky-ruby

View on GitHub
bin/darksky

Summary

Maintainability
Test Coverage

Space inside } missing.
Open

api.blocks = {minutely: false, hourly: false, daily: false, alerts: false, flags: false}
Severity: Minor
Found in bin/darksky by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

Use the return of the conditional for variable assignment and comparison.
Open

if opts[:time_given]
  data = api.timemachine(loc: loc, ts: opts[:time])
else 
  data = api.forecast(loc: loc)
end
Severity: Minor
Found in bin/darksky by rubocop

Trailing whitespace detected.
Open

else 
Severity: Minor
Found in bin/darksky by rubocop

Space inside { missing.
Open

api.blocks = {minutely: false, hourly: false, daily: false, alerts: false, flags: false}
Severity: Minor
Found in bin/darksky by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

Line is too long. [88/80]
Open

api.blocks = {minutely: false, hourly: false, daily: false, alerts: false, flags: false}
Severity: Minor
Found in bin/darksky by rubocop

Do not use :: for method calls.
Open

Optimist::die :loc, "is missing" if loc.nil?
Severity: Minor
Found in bin/darksky by rubocop

This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

Do not use :: for method calls.
Open

opts = Optimist::options do
Severity: Minor
Found in bin/darksky by rubocop

This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

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"

There are no issues that match your filters.

Category
Status