codeclimate/ruby-test-reporter

View on GitHub
lib/code_climate/test_reporter/formatter.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method has too many lines. [38/10]
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

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

      def format(results)
        simplecov_results = results.map do |command_name, data|
          SimpleCov::Result.from_hash(command_name => data)
        end

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

      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
Severity: Minor
Found in lib/code_climate/test_reporter/formatter.rb - About 1 hr to fix

    Unnecessary utf-8 encoding comment.
    Open

    # encoding: utf-8

    Avoid using rescue in its modifier form.
    Open

                rails_root:     (Rails.root.to_s rescue nil),

    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

    There are no issues that match your filters.

    Category
    Status