lib/code_climate/test_reporter/formatter.rb
Method has too many lines. [38/10] Open
Open
def to_payload(result)
totals = Hash.new(0)
source_files = result.files.map do |file|
totals[:total] += file.lines.count
totals[:covered] += file.covered_lines.count
- Read upRead up
- Exclude checks
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.
Method has too many lines. [12/10] Open
Open
def format(results)
simplecov_results = results.map do |command_name, data|
SimpleCov::Result.from_hash(command_name => data)
end
- Read upRead up
- Exclude checks
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.
Method to_payload
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def to_payload(result)
totals = Hash.new(0)
source_files = result.files.map do |file|
totals[:total] += file.lines.count
totals[:covered] += file.covered_lines.count
Unnecessary utf-8 encoding comment. Open
Open
# encoding: utf-8
- Exclude checks
Avoid using rescue
in its modifier form. Open
Open
rails_root: (Rails.root.to_s rescue nil),
- Read upRead up
- Exclude checks
This cop checks for uses of rescue in its modifier form.
Example:
# bad
some_method rescue handle_error
# good
begin
some_method
rescue
handle_error
end