cloudamatic/mu

View on GitHub
bin/mu-gcp-setup

Summary

Maintainability
Test Coverage

Use =~ in places where the MatchData returned by #match will not be used.
Open

      if e.message.match(/notFound:/)
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

Example:

# bad
do_something if str.match(/regex/)
while regex.match('str')
  do_something
end

# good
method(str =~ /regex/)
return value unless regex =~ 'str'

Use =~ in places where the MatchData returned by #match will not be used.
Open

      if e.message.match(/notFound:/)
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop identifies the use of Regexp#match or String#match, which returns #<MatchData>/nil. The return value of =~ is an integral index/nil and is more performant.

Example:

# bad
do_something if str.match(/regex/)
while regex.match('str')
  do_something
end

# good
method(str =~ /regex/)
return value unless regex =~ 'str'

File.exists? is deprecated in favor of File.exist?.
Open

  if !File.exists?("/sbin/mkfs.xfs")
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for uses of the deprecated class method usages.

Example:

# bad

File.exists?(some_path)

Example:

# good

File.exist?(some_path)

Useless assignment to variable - ebs_key.
Open

    ebs_key = nil
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

Useless assignment to variable - my_instance_id.
Open

my_instance_id = MU::Cloud::AWS.getAWSMetaData("instance-id")
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

Useless assignment to variable - bucket. Did you mean bucketobj?
Open

        bucket = MU::Cloud::Google.storage(credentials: credset).insert_bucket(
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

Useless assignment to variable - ebs_key.
Open

        ebs_key = MU::Cloud::Google.storage(credentials: credset).insert_object(
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

Useless assignment to variable - exists.
Open

    exists = false
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

Useless assignment to variable - bucket. Did you mean bucketobj?
Open

    bucket = nil
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

Useless assignment to variable - ebs_key.
Open

      ebs_key = MU::Cloud::Google.storage(credentials: credset).get_object(bucketname, "log_vol_ebs_key")
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

File.exists? is deprecated in favor of File.exist?.
Open

  if File.exists?("/opt/opscode/bin/chef-server-ctl")
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for uses of the deprecated class method usages.

Example:

# bad

File.exists?(some_path)

Example:

# good

File.exist?(some_path)

Useless assignment to variable - bucket. Did you mean bucketobj?
Open

      bucket = MU::Cloud::Google.storage(credentials: credset).get_bucket(bucketname)
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

File.exists? is deprecated in favor of File.exist?.
Open

  if File.exists?("/opt/opscode/bin/chef-server-ctl")
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for uses of the deprecated class method usages.

Example:

# bad

File.exists?(some_path)

Example:

# good

File.exist?(some_path)

Use meaningful heredoc delimiters.
Open

  EOS
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks that your heredocs are using meaningful delimiters. By default it disallows END and EO*, and can be configured through blacklisting additional delimiters.

Example:

# good
<<-SQL
  SELECT * FROM foo
SQL

# bad
<<-END
  SELECT * FROM foo
END

# bad
<<-EOS
  SELECT * FROM foo
EOS

Useless assignment to variable - instance.
Open

    instance = MU.myCloudDescriptor
Severity: Minor
Found in bin/mu-gcp-setup by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

There are no issues that match your filters.

Category
Status