jbender/motion-pods

View on GitHub
lib/motion/pods/main.rb

Summary

Maintainability
C
1 day
Test Coverage

Class has too many lines. [270/250]
Open

  class Pods
    PODS_ROOT = 'vendor/Pods'
    TARGET_NAME = 'RubyMotion'
    PUBLIC_HEADERS_ROOT = File.join(PODS_ROOT, 'Headers/Public')
    PODS_ROOT_MATCHER = /(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/
Severity: Minor
Found in lib/motion/pods/main.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class Pods has 30 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Pods
    PODS_ROOT = 'vendor/Pods'
    TARGET_NAME = 'RubyMotion'
    PUBLIC_HEADERS_ROOT = File.join(PODS_ROOT, 'Headers/Public')
    PODS_ROOT_MATCHER = /(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/
Severity: Minor
Found in lib/motion/pods/main.rb - About 3 hrs to fix

    File main.rb has 274 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Motion
      class Pods
        PODS_ROOT = 'vendor/Pods'
        TARGET_NAME = 'RubyMotion'
        PUBLIC_HEADERS_ROOT = File.join(PODS_ROOT, 'Headers/Public')
    Severity: Minor
    Found in lib/motion/pods/main.rb - About 2 hrs to fix

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

          def resources
            resources = []
            resource_path =
              Pathname.new(@config.project_dir) +
              SUPPORT_FILES +
      Severity: Minor
      Found in lib/motion/pods/main.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 framework_search_paths has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def framework_search_paths
            search_paths = xcconfig_hash["FRAMEWORK_SEARCH_PATHS"]
      
            return [] unless search_paths
      
      
      Severity: Minor
      Found in lib/motion/pods/main.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 install_resource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def install_resource(file, resources_dir)
            FileUtils.cp_r(file, resources_dir) if file.exist?
          rescue ArgumentError => exc
            raise unless exc.message =~ /same file/
          end
      Severity: Minor
      Found in lib/motion/pods/main.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

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

          def parsed_library_path(library, lib_search_path_flags)
            lib_name = library[0]
      
            return unless lib_name
      
      
      Severity: Minor
      Found in lib/motion/pods/main.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

      TODO found
      Open

          # TODO: this probably breaks in cases like resource bundles etc, need to test.
      Severity: Minor
      Found in lib/motion/pods/main.rb by fixme

      TODO found
      Open

            # TODO: replace this all once Xcodeproj has the proper xcconfig parser.
      Severity: Minor
      Found in lib/motion/pods/main.rb by fixme

      Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
      Open

            if cocoapods_config.verbose = !!ENV["COCOAPODS_VERBOSE"]
      Severity: Minor
      Found in lib/motion/pods/main.rb by rubocop

      This cop checks for assignments in the conditions of if/while/until.

      Example:

      # bad
      
      if some_var = true
        do_something
      end

      Example:

      # good
      
      if some_var == true
        do_something
      end

      There are no issues that match your filters.

      Category
      Status