Myoldmopar/decent_ci

View on GitHub

Showing 50 of 71 total issues

Method post_results has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
Open

  def post_results(compiler, pending)
    @dateprefix = DateTime.now.utc.strftime('%F') if @dateprefix.nil?

    test_results_data = []

Severity: Minor
Found in lib/potentialbuild.rb - About 2 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File potentialbuild.rb has 798 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'octokit'
require 'json'
require 'open3'
require 'pathname'
require 'active_support/core_ext/hash'
Severity: Major
Found in lib/potentialbuild.rb - About 1 day to fix

    Method post_results has 334 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def post_results(compiler, pending)
        @dateprefix = DateTime.now.utc.strftime('%F') if @dateprefix.nil?
    
        test_results_data = []
    
    
    Severity: Major
    Found in lib/potentialbuild.rb - About 1 day to fix

      Method clean_up_impl has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
      Open

      def clean_up_impl(client, repository, results_repository, results_path, age_limit,
                       limit_reached, long_running_branches, feature_branch_limit, long_running_branch_limit, branches, releases, pull_requests)
        if $logger.nil?
          logger = Logger.new(STDOUT)
        else
      Severity: Minor
      Found in cleanup.rb - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method process_ctest_results has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
      Open

        def process_ctest_results(src_dir, build_dir, test_dir)
          unless File.directory?(test_dir)
            $logger.error("Error: test_dir #{test_dir} does not exist, cannot parse test results")
            return nil, []
          end
      Severity: Minor
      Found in lib/resultsprocessor.rb - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method parse_callgrind has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

        def parse_callgrind(build_dir, file)
          object_files = {}
          source_files = {}
          functions = {}
          props = {}
      Severity: Minor
      Found in lib/potentialbuild.rb - About 7 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method process_cmake_results has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

        def process_cmake_results(src_dir, build_dir, stderr, cmake_exit_code, is_package)
          results = []
      
          file = nil
          line = nil
      Severity: Minor
      Found in lib/resultsprocessor.rb - About 7 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method clean_up_impl has 139 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def clean_up_impl(client, repository, results_repository, results_path, age_limit,
                       limit_reached, long_running_branches, feature_branch_limit, long_running_branch_limit, branches, releases, pull_requests)
        if $logger.nil?
          logger = Logger.new(STDOUT)
        else
      Severity: Major
      Found in cleanup.rb - About 5 hrs to fix

        Class PotentialBuild has 37 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class PotentialBuild
          include CMake
          include Configuration
          include ResultsProcessor
          include Lcov
        Severity: Minor
        Found in lib/potentialbuild.rb - About 4 hrs to fix

          File resultsprocessor.rb has 341 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'active_support/all'
          require 'find'
          
          require_relative 'codemessage'
          require_relative 'testresult'
          Severity: Minor
          Found in lib/resultsprocessor.rb - About 4 hrs to fix

            Method query_branches has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

              def query_branches
                # TODO: properly handle paginated results from github
                branches = github_query(@client) { @client.branches(@repository, :per_page => 100) }
            
                branches.each do |b|
            Severity: Minor
            Found in lib/build.rb - About 3 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method process_ctest_results has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def process_ctest_results(src_dir, build_dir, test_dir)
                unless File.directory?(test_dir)
                  $logger.error("Error: test_dir #{test_dir} does not exist, cannot parse test results")
                  return nil, []
                end
            Severity: Major
            Found in lib/resultsprocessor.rb - About 3 hrs to fix

              Method parse_callgrind has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def parse_callgrind(build_dir, file)
                  object_files = {}
                  source_files = {}
                  functions = {}
                  props = {}
              Severity: Major
              Found in lib/potentialbuild.rb - About 3 hrs to fix

                Method parse_msvc_line has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                  def parse_msvc_line(src_dir, build_dir, line)
                    return nil if line.nil?
                
                    /(?<filename>.+)\((?<line_number>[0-9]+)\): (?<message_type>.+?) (?<message_code>\S+): (?<message>.*) \[.*\]?/ =~ line
                    pattern_found = !filename.nil? && !message_type.nil?
                Severity: Minor
                Found in lib/resultsprocessor.rb - About 2 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method query_pull_requests has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                  def query_pull_requests
                    # This line is where we want to add :accept => 'application/vnd.github.shadow-cat-preview+json' for draft PRs
                    pull_requests = github_query(@client) { @client.pull_requests(@repository, :state => 'open', :per_page => 50) }
                
                    @pull_request_details = []
                Severity: Minor
                Found in lib/build.rb - About 2 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method process_cmake_results has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def process_cmake_results(src_dir, build_dir, stderr, cmake_exit_code, is_package)
                    results = []
                
                    file = nil
                    line = nil
                Severity: Major
                Found in lib/resultsprocessor.rb - About 2 hrs to fix

                  Method cmake_build has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def cmake_build(compiler, src_dir, build_dir, regression_dir, regression_baseline, cmake_build_args)
                      FileUtils.mkdir_p build_dir
                  
                      cmake_flags = "#{compiler[:cmake_extra_flags]} -DDEVICE_ID:STRING=\"#{cmake_build_args.this_device_id}\""
                  
                  
                  Severity: Major
                  Found in lib/cmake.rb - About 2 hrs to fix

                    Method cmake_build has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def cmake_build(compiler, src_dir, build_dir, regression_dir, regression_baseline, cmake_build_args)
                        FileUtils.mkdir_p build_dir
                    
                        cmake_flags = "#{compiler[:cmake_extra_flags]} -DDEVICE_ID:STRING=\"#{cmake_build_args.this_device_id}\""
                    
                    
                    Severity: Minor
                    Found in lib/cmake.rb - About 2 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    File ci.rb has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'fileutils'
                    require 'logger'
                    require_relative 'lib/build'
                    require_relative 'cleanup.rb'
                    require 'optparse'
                    Severity: Minor
                    Found in ci.rb - About 2 hrs to fix

                      Method query_pull_requests has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def query_pull_requests
                          # This line is where we want to add :accept => 'application/vnd.github.shadow-cat-preview+json' for draft PRs
                          pull_requests = github_query(@client) { @client.pull_requests(@repository, :state => 'open', :per_page => 50) }
                      
                          @pull_request_details = []
                      Severity: Minor
                      Found in lib/build.rb - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language