kishikawakatsumi/xcjobs

View on GitHub
lib/xcjobs/xcodebuild.rb

Summary

Maintainability
D
2 days
Test Coverage

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

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 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

    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 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 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 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

        There are no issues that match your filters.

        Category
        Status