guidomb/carthage_cache

View on GitHub

Showing 5 of 5 total issues

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

      def remove_nil_keys(hash)
        hash.inject({}) do |new_hash, (k,v)|
          unless v.nil? || (v.respond_to?(:empty?) && v.empty?)
            if v.class == Hash
              cleaned_hashed = remove_nil_keys(v)
Severity: Minor
Found in lib/carthage_cache/configurator.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(project_path, cache_dir_name, archive_base_path, terminal, tmpdir, swift_version_resolver = SwiftVersionResolver.new)
Severity: Minor
Found in lib/carthage_cache/project.rb - About 45 mins to fix

    Method create_archive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_archive(force = false, prune = nil, prune_white_list = nil, platforms = nil)
          prune ||= config.prune_on_publish
          platforms ||= config.platforms
          prune_white_list ||= config.prune_white_list
    
    
    Severity: Minor
    Found in lib/carthage_cache/application.rb - About 35 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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def validate
          return missing_bucket_name unless has_bucket_name?
          return missing_aws_region unless has_aws_region?
    
          return missing_aws_access_key_id if is_missing_aws_access_key_id?
    Severity: Minor
    Found in lib/carthage_cache/configuration_validator.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 delete_framework_files has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def delete_framework_files(framework_path)
            framework_dsym_path = "#{framework_path}.dSYM"
            terminal.vputs "Deleting #{framework_name(framework_path)} files because they are no longer needed ..."
    
            # Deletes .framework file
    Severity: Minor
    Found in lib/carthage_cache/build_collector.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

    Severity
    Category
    Status
    Source
    Language