ManageIQ/manageiq-providers-nuage

View on GitHub

Showing 23 of 23 total issues

Empty block detected.
Open

      with_provider_connection(options) {}

Checks for blocks without a body. Such empty blocks are typically an oversight or we should provide a comment be clearer what we're aiming for.

Empty lambdas and procs are ignored by default.

NOTE: For backwards compatibility, the configuration that allows/disallows empty lambdas and procs is called AllowEmptyLambdas, even though it also applies to procs.

Example:

# bad
items.each { |item| }

# good
items.each { |item| puts item }

Example: AllowComments: true (default)

# good
items.each do |item|
  # TODO: implement later (inner comment)
end

items.each { |item| } # TODO: implement later (inline comment)

Example: AllowComments: false

# bad
items.each do |item|
  # TODO: implement later (inner comment)
end

items.each { |item| } # TODO: implement later (inline comment)

Example: AllowEmptyLambdas: true (default)

# good
allow(subject).to receive(:callable).and_return(-> {})

placeholder = lambda do
end
(callable || placeholder).call

proc { }

Proc.new { }

Example: AllowEmptyLambdas: false

# bad
allow(subject).to receive(:callable).and_return(-> {})

placeholder = lambda do
end
(callable || placeholder).call

proc { }

Proc.new { }

Use filter_map instead.
Open

    refs.map { |ems_ref| security_group(ems_ref) }.compact

metadata['rubygems_mfa_required'] must be set to 'true'.
Open

Gem::Specification.new do |spec|
  spec.name          = "manageiq-providers-nuage"
  spec.version       = ManageIQ::Providers::Nuage::VERSION
  spec.authors       = ["ManageIQ Authors"]

Severity: Minor
Found in manageiq-providers-nuage.gemspec by rubocop

Requires a gemspec to have rubygems_mfa_required metadata set.

This setting tells RubyGems that MFA (Multi-Factor Authentication) is required for accounts to be able perform privileged operations, such as (see RubyGems' documentation for the full list of privileged operations):

  • gem push
  • gem yank
  • gem owner --add/remove
  • adding or removing owners using gem ownership page

This helps make your gem more secure, as users can be more confident that gem updates were pushed by maintainers.

Example:

# bad
Gem::Specification.new do |spec|
  # no `rubygems_mfa_required` metadata specified
end

# good
Gem::Specification.new do |spec|
  spec.metadata = {
    'rubygems_mfa_required' => 'true'
  }
end

# good
Gem::Specification.new do |spec|
  spec.metadata['rubygems_mfa_required'] = 'true'
end

# bad
Gem::Specification.new do |spec|
  spec.metadata = {
    'rubygems_mfa_required' => 'false'
  }
end

# good
Gem::Specification.new do |spec|
  spec.metadata = {
    'rubygems_mfa_required' => 'true'
  }
end

# bad
Gem::Specification.new do |spec|
  spec.metadata['rubygems_mfa_required'] = 'false'
end

# good
Gem::Specification.new do |spec|
  spec.metadata['rubygems_mfa_required'] = 'true'
end
Severity
Category
Status
Source
Language