codeclimate/ruby-test-reporter

View on GitHub

Showing 5 of 25 total issues

Method service_data has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def self.service_data(env = ENV)
if env["TRAVIS"]
{
name: "travis-ci",
branch: env["TRAVIS_BRANCH"],
Severity: Major
Found in lib/code_climate/test_reporter/ci.rb - About 3 hrs to fix

    Method service_data has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def self.service_data(env = ENV)
    if env["TRAVIS"]
    {
    name: "travis-ci",
    branch: env["TRAVIS_BRANCH"],
    Severity: Minor
    Found in lib/code_climate/test_reporter/ci.rb - About 1 hr to fix

    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

      Method validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def validate
      raise InvalidPayload, "A git commit sha was not found in the test report payload" unless commit_sha
      raise InvalidPayload, "A git commit timestamp was not found in the test report payload" unless committed_at
      raise InvalidPayload, "A run at timestamp was not found in the test report payload" unless run_at
      raise InvalidPayload, "No source files were found in the test report payload" unless source_files?
      Severity: Minor
      Found in lib/code_climate/test_reporter/payload_validator.rb - About 1 hr to fix

      Method batch_post_results has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def batch_post_results(files)
      uri = URI.parse("#{host}/test_reports/batch")
      http = http_client(uri)
       
      boundary = SecureRandom.uuid
      Severity: Minor
      Found in lib/code_climate/test_reporter/client.rb - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language