Myoldmopar/decent_ci

View on GitHub

Showing 50 of 71 total issues

Method initialize has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def initialize(client, token, repository, tag_name, commit_sha, branch_name, author, release_url, release_assets, # rubocop:disable Metrics/ParameterLists
                 pull_id, pr_base_repository, pr_base_ref)
    @client = client
    @config = load_configuration(repository, (tag_name.nil? ? commit_sha : tag_name), !release_url.nil?)
    @config.repository_name = github_query(@client) { @client.repo(repository).name }
Severity: Minor
Found in lib/potentialbuild.rb - About 1 hr to fix

    Method clean_up_impl has 12 arguments (exceeds 4 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)
    Severity: Major
    Found in cleanup.rb - About 1 hr to fix

      Method initialize has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def initialize(client, token, repository, tag_name, commit_sha, branch_name, author, release_url, release_assets, # rubocop:disable Metrics/ParameterLists
                       pull_id, pr_base_repository, pr_base_ref)
      Severity: Major
      Found in lib/potentialbuild.rb - About 1 hr to fix

        Method get_limits has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def get_limits(t_options, t_client, t_repo)
        
          limits = lambda {
            trusted_branch = t_options[:trusted_branch]
            $logger.info("Loading decent_ci-limits.yaml from #{trusted_branch}")
        Severity: Minor
        Found in ci.rb - About 1 hr to fix

          Method processor_count has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          def processor_count
            os_name = RbConfig::CONFIG['target_os']
            if os_name.match(/mingw|mswin/)
              require 'win32ole'
              result = WIN32OLE.connect('winmgmts://').ExecQuery('select NumberOfLogicalProcessors from Win32_Processor')
          Severity: Minor
          Found in lib/processor.rb - About 1 hr 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_lcov_results has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def process_lcov_results(out)
              # Overall coverage rate:
              #  lines......: 67.9% (173188 of 255018 lines)
              #  functions..: 83.8% (6228 of 7433 functions)
          
          
          Severity: Minor
          Found in lib/resultsprocessor.rb - About 1 hr 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 load_configuration has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def load_configuration(location, ref, is_release)
              # first get a list of all decent_ci files found at the root of the repo, and raise if none were found
              fileset = Set.new
              @client.content(location, :path => '.', :ref => ref).each do |path|
                fileset << path.name if path.name =~ /\.decent_ci.*/
          Severity: Minor
          Found in lib/configuration.rb - About 1 hr 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 processor_count has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def processor_count
            os_name = RbConfig::CONFIG['target_os']
            if os_name.match(/mingw|mswin/)
              require 'win32ole'
              result = WIN32OLE.connect('winmgmts://').ExecQuery('select NumberOfLogicalProcessors from Win32_Processor')
          Severity: Minor
          Found in lib/processor.rb - About 1 hr to fix

            Method parse_msvc_line has 28 lines of code (exceeds 25 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 1 hr to fix

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

              def get_limits(t_options, t_client, t_repo)
              
                limits = lambda {
                  trusted_branch = t_options[:trusted_branch]
                  $logger.info("Loading decent_ci-limits.yaml from #{trusted_branch}")
              Severity: Minor
              Found in ci.rb - About 1 hr 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 load_configuration has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def load_configuration(location, ref, is_release)
                  # first get a list of all decent_ci files found at the root of the repo, and raise if none were found
                  fileset = Set.new
                  @client.content(location, :path => '.', :ref => ref).each do |path|
                    fileset << path.name if path.name =~ /\.decent_ci.*/
              Severity: Minor
              Found in lib/configuration.rb - About 1 hr to fix

                Method parse_gcc_line has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def parse_gcc_line(src_path, build_path, line)
                    # 'Something.cc:32:4: multiple definition of variable'
                    /(?<filename>.*):(?<line_number>[0-9]+):(?<column_number>[0-9]+): (?<message_type>.+?): (?<message>.*)/ =~ line
                    pattern_found = !filename.nil? && !message_type.nil?
                    message_is_error = !(%w[info note].include? message_type)
                Severity: Minor
                Found in lib/resultsprocessor.rb - About 55 mins 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_gcc_results has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def process_gcc_results(src_path, build_path, stderr, gcc_exit_code)
                    results = []
                    linker_msg = nil
                
                    stderr.encode('UTF-8', :invalid => :replace).split("\n").each do |line|
                Severity: Minor
                Found in lib/resultsprocessor.rb - About 55 mins 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 cmake_build has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def cmake_build(compiler, src_dir, build_dir, regression_dir, regression_baseline, cmake_build_args)
                Severity: Minor
                Found in lib/cmake.rb - About 45 mins to fix

                  Method clean_up has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def clean_up(client, repository, results_repository, results_path, age_limit, limits)
                  Severity: Minor
                  Found in cleanup.rb - About 45 mins to fix

                    Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def initialize(name, status, time, output, parsed_errors, failure_type)
                    Severity: Minor
                    Found in lib/testresult.rb - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  if pr.number.to_s == file_data["pull_request_issue_id"].to_s
                                    # matching open pr found
                                    pr_found = true
                                    break
                                  end
                      Severity: Major
                      Found in cleanup.rb - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                elsif !branch_name.nil? && branch_name != "" && (file_data["pull_request_issue_id"].nil? || file_data["pull_request_issue_id"] == "")
                                  logger.debug("Examining branch #{branch_name} commit #{file_data["commit_sha"]}")
                        
                                  file_key = {:device_id => file_data["device_id"], :branch_name => branch_name}
                                  file_data = {:date => file_data["date"], :file => file}
                        Severity: Major
                        Found in cleanup.rb - About 45 mins to fix

                          Method github_query has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def github_query(client, num_retries = 2)
                            count = 0
                            loop do
                              begin
                                return yield
                          Severity: Minor
                          Found in lib/github.rb - About 45 mins 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_python_results has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            def process_python_results(src_dir, build_dir, stdout, stderr, python_exit_code)
                          Severity: Minor
                          Found in lib/resultsprocessor.rb - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language