kishikawakatsumi/xcjobs

View on GitHub

Showing 23 of 23 total issues

Method collect has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

      def collect(base_dir)
        report = {}
        report['repo_token'] = repo_token if repo_token
        report['service_name'] = service_name if service_name
        report['service_job_id'] = service_job_id if service_job_id
Severity: Minor
Found in lib/xcjobs/coverage.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 run has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def run(cmd)
      @before_action.call if @before_action

      if @formatter
        puts (cmd + ['|', @formatter]).join(" ")
Severity: Minor
Found in lib/xcjobs/xcodebuild.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 form_data has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

      def form_data
        {}.tap do |fields|
          fields[:ipa] = "@#{file}" if file
          fields[:dsym] = "@#{dsym}" if dsym
          fields[:notes] = notes if notes
Severity: Minor
Found in lib/xcjobs/distribute.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

File xcodebuild.rb has 318 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'rake/tasklib'
require 'rake/clean'
require 'open3'
require 'shellwords'
require 'securerandom'
Severity: Minor
Found in lib/xcjobs/xcodebuild.rb - About 3 hrs to fix

    Method collect has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def collect(base_dir)
            report = {}
            report['repo_token'] = repo_token if repo_token
            report['service_name'] = service_name if service_name
            report['service_job_id'] = service_job_id if service_job_id
    Severity: Major
    Found in lib/xcjobs/coverage.rb - About 2 hrs to fix

      Method options has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def options
            [].tap do |opts|
              opts.concat(['-project', project]) if project
              opts.concat(['-target', target]) if target
              opts.concat(['-workspace', workspace]) if workspace
      Severity: Minor
      Found in lib/xcjobs/xcodebuild.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 define has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def define
            raise 'archive action requires specifying a scheme' unless scheme
            raise 'cannot specify both a scheme and targets' if scheme && target
      
            if build_dir
      Severity: Minor
      Found in lib/xcjobs/xcodebuild.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 distribute.rb has 257 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'rake/tasklib'
      require 'open3'
      
      module XCJobs
        module Distribute
      Severity: Minor
      Found in lib/xcjobs/distribute.rb - About 2 hrs to fix

        Method options has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def options
              [].tap do |opts|
                opts.concat(['-exportOptionsPlist', options_plist]) if options_plist
                opts.concat(['-archivePath', archive_path]) if archive_path
                opts.concat(['-exportFormat', export_format])  if export_format
        Severity: Minor
        Found in lib/xcjobs/xcodebuild.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 form_data has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

              def form_data
                {}.tap do |fields|
                  fields[:file] = "@#{file}" if file
                  fields[:api_token] = api_token if api_token
                  fields[:team_token] = team_token if team_token
        Severity: Minor
        Found in lib/xcjobs/distribute.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 form_data has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

              def form_data
                {}.tap do |fields|
                  fields[:token] = token if token
                  fields[:file] = "@#{file}" if file
                  fields[:message] = message if message
        Severity: Minor
        Found in lib/xcjobs/distribute.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 options has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

              def options
                [].tap do |opts|
                  opts << api_key
                  opts << build_secret
                  opts.concat(['-ipaPath', file]) if file
        Severity: Minor
        Found in lib/xcjobs/distribute.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 run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def run(cmd)
              @before_action.call if @before_action
        
              if @formatter
                puts (cmd + ['|', @formatter]).join(" ")
        Severity: Minor
        Found in lib/xcjobs/xcodebuild.rb - About 1 hr to fix

          Method define has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def define
                  namespace :version do
                    desc 'Print the current version'
                    task :current do
                      puts InfoPlist.marketing_and_build_version
          Severity: Minor
          Found in lib/xcjobs/info_plist.rb - About 1 hr to fix

            Method define has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def define
                  raise 'the scheme is required when specifying build_dir' if build_dir && !scheme
                  raise 'cannot specify both a scheme and targets' if scheme && target
            
                  CLEAN.include(build_dir) if build_dir
            Severity: Minor
            Found in lib/xcjobs/xcodebuild.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 is_excluded_path has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                  def is_excluded_path(filepath)
                    if filepath.start_with?('..')
                      return true
                    end
                    @excludes.each do |exclude|
            Severity: Minor
            Found in lib/xcjobs/coverage.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 extract_provisioning_profile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def self.extract_provisioning_profile(provisioning_profile)
                  if File.file?(provisioning_profile)
                    provisioning_profile_path = provisioning_profile
                  else
                    path = File.join("#{Dir.home}/Library/MobileDevice/Provisioning Profiles/", provisioning_profile)
            Severity: Minor
            Found in lib/xcjobs/helper.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 define has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def define
                  namespace :certificates do
                    desc 'install certificates'
                    task :install do
                      sh %[security create-keychain -p "" "#{keychain_name}"]
            Severity: Minor
            Found in lib/xcjobs/certificate.rb - About 1 hr to fix

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

                  def options
                    [].tap do |opts|
                      opts.concat(['-project', project]) if project
                      opts.concat(['-target', target]) if target
                      opts.concat(['-workspace', workspace]) if workspace
              Severity: Minor
              Found in lib/xcjobs/xcodebuild.rb - About 1 hr to fix

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

                    def upload(url, form_data = {}, header = {})
                      @before_action.call if @before_action
                
                      curl_options = ['curl', '-sSf', "#{url}"]
                      form_fields = form_data.flat_map { |k, v| ['-F', "#{k}=#{v}"] }
                Severity: Minor
                Found in lib/xcjobs/distribute.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

                Severity
                Category
                Status
                Source
                Language