CocoaPods/cocoapods-downloader

View on GitHub

Showing 4 of 6 total issues

Method extract_with_type has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def extract_with_type(full_filename, type = :zip)
        unpack_from = full_filename
        unpack_to = @target_path

        case type
Severity: Minor
Found in lib/cocoapods-downloader/remote_file.rb - About 1 hr to fix

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

          def clone(force_head = false, shallow_clone = true)
            ui_sub_action('Git download') do
              begin
                git! clone_arguments(force_head, shallow_clone)
                update_submodules
    Severity: Minor
    Found in lib/cocoapods-downloader/git.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 extract_with_type has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def extract_with_type(full_filename, type = :zip)
            unpack_from = full_filename
            unpack_to = @target_path
    
            case type
    Severity: Minor
    Found in lib/cocoapods-downloader/remote_file.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 expose_api has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def expose_api(mod = nil, &block)
            if mod.nil?
              if block.nil?
                raise "Either a module or a block that's used to create a module is required."
              else
    Severity: Minor
    Found in lib/cocoapods-downloader/api_exposable.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