ripta/drydock

View on GitHub

Showing 30 of 240 total issues

Avoid too many return statements within this method.
Open

      return false if self['Cmd'] != other['Cmd']
Severity: Major
Found in lib/drydock/container_config.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return false unless other_vols.key?(my_vol)
    Severity: Major
    Found in lib/drydock/container_config.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return false unless other_ports.key?(my_port)
      Severity: Major
      Found in lib/drydock/container_config.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return false if self['Entrypoint'] != other['Entrypoint']
        Severity: Major
        Found in lib/drydock/container_config.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                return false if my_vols.keys.size != other_vols.keys.size
          Severity: Major
          Found in lib/drydock/container_config.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return false if my_ports.keys.size != other_ports.keys.size
            Severity: Major
            Found in lib/drydock/container_config.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return false if self['User'] != other['User']
              Severity: Major
              Found in lib/drydock/container_config.rb - About 30 mins to fix

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

                    def set(key, value = nil, &blk)
                      key = key.to_sym
                      fail ArgumentError, "unknown option #{key.inspect}" unless build_opts.key?(key)
                      fail ArgumentError, 'one of value or block is required' if value.nil? && blk.nil?
                      fail ArgumentError, 'only one of value or block may be provided' if value && blk
                Severity: Minor
                Found in lib/drydock/project.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 log_step has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def log_step(op, *args)
                      opts   = args.last.is_a?(Hash) ? args.pop : {}
                      optstr = opts.map { |k, v| "#{k}: #{v.inspect}" }.join(', ')
                
                      argstr = args.map(&:inspect).join(', ')
                Severity: Minor
                Found in lib/drydock/project.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 author has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def author(name: nil, email: nil)
                      if (name.nil? || name.empty?) && (email.nil? || name.empty?)
                        fail InvalidInstructionArgumentError, 'at least one of `name:` or `email:` must be provided'
                      end
                
                
                Severity: Minor
                Found in lib/drydock/project.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