revolter/fastlane-plugin-icon_versioning

View on GitHub

Showing 5 of 44 total issues

Method available_options has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(
            key: :appiconset_path,
            env_name: 'VERSION_ICON_APPICONSET_PATH',
Severity: Minor
Found in lib/fastlane/plugin/icon_versioning/actions/version_icon_action.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 available_options has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(
            key: :appiconset_path,
            env_name: 'VERSION_ICON_APPICONSET_PATH',
Severity: Major
Found in lib/fastlane/plugin/icon_versioning/actions/version_icon_action.rb - About 3 hrs to fix

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

          def version_icon(original_icon_path, versioned_icon_path)
            image = MiniMagick::Image.open(original_icon_path)
    
            image_width = image[:width]
            image_height = image[:height]
    Severity: Major
    Found in lib/fastlane/plugin/icon_versioning/helper/version_icon_helper.rb - About 2 hrs to fix

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

            def run()
              versioned_appiconset_path = self.class.get_versioned_path(@appiconset_path, @versioned_appiconset_suffix)
      
              Dir.mkdir(versioned_appiconset_path) unless Dir.exist?(versioned_appiconset_path)
      
      
      Severity: Minor
      Found in lib/fastlane/plugin/icon_versioning/helper/version_icon_helper.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 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def run()
              versioned_appiconset_path = self.class.get_versioned_path(@appiconset_path, @versioned_appiconset_suffix)
      
              Dir.mkdir(versioned_appiconset_path) unless Dir.exist?(versioned_appiconset_path)
      
      
      Severity: Minor
      Found in lib/fastlane/plugin/icon_versioning/helper/version_icon_helper.rb - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language