Cimpress-MCP/zanzibar

View on GitHub
lib/zanzibar/actions/bundle.rb

Summary

Maintainability
A
35 mins
Test Coverage

Method download_one_secret has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def download_one_secret(scrt_id, label, path, args, name = nil)
Severity: Minor
Found in lib/zanzibar/actions/bundle.rb - About 35 mins to fix

    Use the return of the conditional for variable assignment and comparison.
    Open

            if label == 'Password'
              path = zanzibar(args).get_username_and_password_and_save(scrt_id, path, name)
            else
              path = zanzibar(args).download_secret_file(scrt_id: scrt_id,
                                                         type: label,
    Severity: Minor
    Found in lib/zanzibar/actions/bundle.rb by rubocop

    Use a guard clause instead of wrapping the code inside a conditional expression.
    Open

            if @settings['secret_dir']
    Severity: Minor
    Found in lib/zanzibar/actions/bundle.rb by rubocop

    Use a guard clause instead of wrapping the code inside a conditional expression

    Example:

    # bad
    def test
      if something
        work
      end
    end
    
    # good
    def test
      return unless something
      work
    end
    
    # also good
    def test
      work if something
    end
    
    # bad
    if something
      raise 'exception'
    else
      ok
    end
    
    # good
    raise 'exception' if something
    ok

    Method Zanzibar::Actions::Bundle#zanzibar is defined at both lib/zanzibar/actions/bundle.rb:27 and lib/zanzibar/actions/bundle.rb:147.
    Open

          def zanzibar(args)
    Severity: Minor
    Found in lib/zanzibar/actions/bundle.rb by rubocop

    This cop checks for duplicated instance (or singleton) method definitions.

    Example:

    # bad
    
    def duplicated
      1
    end
    
    def duplicated
      2
    end

    Example:

    # bad
    
    def duplicated
      1
    end
    
    alias duplicated other_duplicated

    Example:

    # good
    
    def duplicated
      1
    end
    
    def other_duplicated
      2
    end

    There are no issues that match your filters.

    Category
    Status