kishikawakatsumi/xcjobs

View on GitHub
lib/xcjobs/distribute.rb

Summary

Maintainability
C
1 day
Test Coverage

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

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

          def define
            namespace :distribute do
              desc 'upload IPA to Beta by Crashlytics'
              task :crashlytics do
                @before_action.call if @before_action
    Severity: Minor
    Found in lib/xcjobs/distribute.rb - About 25 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

    There are no issues that match your filters.

    Category
    Status