codeclimate-community/codeclimate-foodcritic

View on GitHub

Showing 27 of 27 total issues

Freeze mutable objects assigned to constants.
Open

      DEFAULT_TAGS = ["~FC011", "~FC033"]
Severity: Minor
Found in lib/cc/engine.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

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

        if File.exist?(path)
          @config = JSON.parse(File.read(path))
        else
          @config = {}
        end
Severity: Minor
Found in lib/cc/engine.rb by rubocop

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

        if File.exist?(path)
          @config = YAML.load_file(path)
        else
          @config = {}
        end
Severity: Minor
Found in lib/cc/engine.rb by rubocop

Use warn instead of $stderr.puts to allow such output to be disabled.
Open

      $stderr.puts "foodcritic options: #{options.inspect}"
Severity: Minor
Found in lib/cc/engine.rb by rubocop

This cop identifies places where $stderr.puts can be replaced by warn. The latter has the advantage of easily being disabled by, e.g. the -W0 interpreter flag, or setting $VERBOSE to nil.

Example:

# bad
$stderr.puts('hello')

# good
warn('hello')

Put a comma after the last item of a multiline hash.
Open

            }
Severity: Minor
Found in lib/cc/engine.rb by rubocop

This cop checks for trailing comma in array and hash literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

Freeze mutable objects assigned to constants.
Open

      DEFAULT_INCLUDE_PATHS = ["./"]
Severity: Minor
Found in lib/cc/engine.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Use warn instead of $stderr.puts to allow such output to be disabled.
Open

    $stderr.puts "Omitting issue for non-existent file: #{issue.filename}"
Severity: Minor
Found in bin/codeclimate-foodcritic by rubocop

This cop identifies places where $stderr.puts can be replaced by warn. The latter has the advantage of easily being disabled by, e.g. the -W0 interpreter flag, or setting $VERBOSE to nil.

Example:

# bad
$stderr.puts('hello')

# good
warn('hello')
Severity
Category
Status
Source
Language