codeclimate/ruby-test-reporter

View on GitHub

Showing 25 of 25 total issues

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

def self.service_data(env = ENV)
if env["TRAVIS"]
{
name: "travis-ci",
branch: env["TRAVIS_BRANCH"],

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

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

    def batch_post_results(files)
    uri = URI.parse("#{host}/test_reports/batch")
    http = http_client(uri)
     
    boundary = SecureRandom.uuid

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

    def message
    parts = []
    parts << "Code Climate encountered an exception: #{exception_class}"
    if http_stubbing_exception
    message = http_stubbing_exception.new

    Cyclomatic complexity for service_data is too high. [13/6]
    Open

    def self.service_data(env = ENV)
    if env["TRAVIS"]
    {
    name: "travis-ci",
    branch: env["TRAVIS_BRANCH"],

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

    def post_results(result)
    uri = URI.parse("#{host}/test_reports")
    http = http_client(uri)
     
    request = Net::HTTP::Post.new(uri.path)

    Perceived complexity for service_data is too high. [14/7]
    Open

    def self.service_data(env = ENV)
    if env["TRAVIS"]
    {
    name: "travis-ci",
    branch: env["TRAVIS_BRANCH"],

    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
     
     

    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

        Empty line detected around arguments.
        Open

        Please visit https://docs.codeclimate.com/v1.0/docs/configuring-test-coverage
        Severity: Minor
        Found in codeclimate-test-reporter.gemspec by rubocop

        Use %q only for strings that contain both single quotes and double quotes.
        Open

        spec.post_install_message = %q(
        Code Climate's codeclimate-test-reporter gem has been deprecated in favor of
        our language-agnostic unified test reporter. The new test reporter is faster,
        distributed as a static binary so dependency conflicts never occur, and
        supports parallelized CI builds & multi-language CI configurations.
        Severity: Minor
        Found in codeclimate-test-reporter.gemspec by rubocop

        Avoid the use of double negation (!!).
        Open

        @run_on_current_branch ||= !!(current_branch =~ /#{configured_branch}/i)
        Severity: Minor
        Found in lib/code_climate/test_reporter.rb by rubocop

        Unnecessary utf-8 encoding comment.
        Open

        # encoding: utf-8

        Avoid the use of double negation (!!).
        Open

        @environment_variable_set = !!ENV["CODECLIMATE_REPO_TOKEN"]
        Severity: Minor
        Found in lib/code_climate/test_reporter.rb by rubocop

        Replace class var @@configuration with a class instance var.
        Open

        @@configuration = nil

        Replace class var @@configuration with a class instance var.
        Open

        @@configuration = Configuration.new
        Severity
        Category
        Status
        Source
        Language