codeclimate-community/codeclimate-foodcritic

View on GitHub
lib/cc/engine.rb

Summary

Maintainability
A
0 mins
Test Coverage

Method has too many lines. [15/10]
Open

      def to_json
        {
          "type" => "issue",
          "check_name" => "FoodCritic/#{lint.rule.code}",
          "description" => lint.rule.name,
Severity: Minor
Found in lib/cc/engine.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

There are no issues that match your filters.

Category
Status