fteem/freakonomics

View on GitHub

Showing 171 of 171 total issues

Use nested module/class definitions instead of compact style.
Open

class Freakonomics::Downloader
Severity: Minor
Found in lib/freakonomics/downloader.rb by rubocop

This cop checks the style of children definitions at classes and modules. Basically there are two different styles:

Example: EnforcedStyle: nested (default)

# good
# have each child on its own line
class Foo
  class Bar
  end
end

Example: EnforcedStyle: compact

# good
# combine definitions as much as possible
class Foo::Bar
end

The compact style is only forced for classes/modules with one child.

Missing top-level class documentation comment.
Open

class Freakonomics::Fetcher
Severity: Minor
Found in lib/freakonomics/fetcher.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

Align the parameters of a method call if they span more than one line.
Open

      content_length_proc: proc { |total| 
        progress_bar = ProgressBar.new("Download", total)
      },
      progress_proc: proc { |step|
        progress_bar.set(step)
Severity: Minor
Found in lib/freakonomics/downloader.rb by rubocop

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Extra empty line detected at method body end.
Open


  end
Severity: Minor
Found in lib/freakonomics/downloader.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Unused method argument - path. If it's necessary, use _ or _path as an argument name to indicate that it won't be used.
Open

  def download_episode name, url, path = nil
Severity: Minor
Found in lib/freakonomics/downloader.rb by rubocop

This cop checks for unused method arguments.

Example:

# bad

def some_method(used, unused, _unused_but_allowed)
  puts used
end

Example:

# good

def some_method(used, _unused, _unused_but_allowed)
  puts used
end

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

  FEED_URL = "http://feeds.feedburner.com/freakonomicsradio?format=xml"
Severity: Minor
Found in lib/freakonomics/fetcher.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"

Unused method argument - name. If it's necessary, use _ or _name as an argument name to indicate that it won't be used.
Open

  def download_episode name, url, path = nil
Severity: Minor
Found in lib/freakonomics/downloader.rb by rubocop

This cop checks for unused method arguments.

Example:

# bad

def some_method(used, unused, _unused_but_allowed)
  puts used
end

Example:

# good

def some_method(used, _unused, _unused_but_allowed)
  puts used
end

Use nested module/class definitions instead of compact style.
Open

class Freakonomics::Fetcher
Severity: Minor
Found in lib/freakonomics/fetcher.rb by rubocop

This cop checks the style of children definitions at classes and modules. Basically there are two different styles:

Example: EnforcedStyle: nested (default)

# good
# have each child on its own line
class Foo
  class Bar
  end
end

Example: EnforcedStyle: compact

# good
# combine definitions as much as possible
class Foo::Bar
end

The compact style is only forced for classes/modules with one child.

HACK found
Open

                 (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
Severity: Minor
Found in .rubocop.yml by fixme

FIXME found
Open

                 (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
Severity: Minor
Found in .rubocop.yml by fixme

TODO found
Open

                 (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
Severity: Minor
Found in .rubocop.yml by fixme
Severity
Category
Status
Source
Language