pietervogelaar/chef-cookbook-jenkins-server

View on GitHub
recipes/jenkins_slave.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use tr instead of gsub.
Open

slave_id = node['fqdn'].gsub(/\./, '_')
Severity: Minor
Found in recipes/jenkins_slave.rb by rubocop

This cop identifies places where gsub can be replaced by tr or delete.

Example:

# bad
'abc'.gsub('b', 'd')
'abc'.gsub('a', '')
'abc'.gsub(/a/, 'd')
'abc'.gsub!('a', 'd')

# good
'abc'.gsub(/.*/, 'a')
'abc'.gsub(/a+/, 'd')
'abc'.tr('b', 'd')
'a b c'.delete(' ')

Line is too long. [86/80]
Open

# Set a Jenkins slave attribute that the Jenkins master server will find with a search
Severity: Minor
Found in recipes/jenkins_slave.rb by rubocop

Line is too long. [86/80]
Open

environment = node.chef_environment == 'production' ? '' : ".#{node.chef_environment}"
Severity: Minor
Found in recipes/jenkins_slave.rb by rubocop

There are no issues that match your filters.

Category
Status