Showing 171 of 171 total issues
Block has too many lines. [54/25] Open
jenkins_script 'configure crowd permissions' do
if node['jenkins-server']['plugins']['crowd2']
# Give all groups that are allowed to authenticate the overall read permission
strategies = []
node['jenkins-server']['plugins']['crowd2']['group'].split(',').each do |group|
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [34/25] Open
node['jenkins-server']['plugins'].each do |plugin, options|
if options
jenkins_plugin plugin do
version options['version']
end
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Indent the first line of the right-hand-side of a multi-line assignment. Open
'-----BEGIN RSA PRIVATE KEY-----
MIIJJwIBAAKCAgEA59t0+NWVEuT1YZJ7OPpH9JxaB9lKMR5aXOTt8wBTrLAUW1XH
xlXUJPTGEgPLqXlUK9ad3HIDnQ4r6WMfgoNqEwE50ByQh4oc7njMbCMZlTpu2+/D
BfCFiF1s3cbGTG4yJ4UxbhAuCNsFoNQQsaLbVs6oAy2Le+dynVtfg+4uzGiSAQeL
CfTy8dzIB57E4gAeQQyFbZCVDNqt1E7M1d0TGvIG29EJAo2pk8qSqHk4zP600ECy
- Read upRead up
- Exclude checks
This cop checks the indentation of the first line of the right-hand-side of a multi-line assignment.
Example:
# bad
value =
if foo
'bar'
end
# good
value =
if foo
'bar'
end
The indentation of the remaining lines can be corrected with
other cops such as IndentationConsistency
and EndAlignment
.
Space inside } missing. Open
'greenballs' => {'version' => '1.14'},
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
# good
h = { a: { b: 2 }}
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if node['jenkins-server']['ant']['install']
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Line is too long. [85/80] Open
'private_key' => node['jenkins-server']['dev_mode']['security']['private_key'],
- Exclude checks
Line is too long. [93/80] Open
notifies :execute, node['jenkins-server']['security']['notifies']['resource'], :immediately
- Exclude checks
Line is too long. [115/80] Open
# to further customize this resource, copy it into your own recipe and name it "configure custom crowd permissions"
- Exclude checks
Use meaningful heredoc delimiters. Open
EOH
- Read upRead up
- Exclude checks
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
Space inside { missing. Open
'ws-cleanup' => {'version' => '0.26'},
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
# good
h = { a: { b: 2 }}
Final newline missing. Open
end
- Exclude checks
Use meaningful heredoc delimiters. Open
EOS
- Read upRead up
- Exclude checks
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
Use meaningful heredoc delimiters. Open
EOH
- Read upRead up
- Exclude checks
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
Favor modifier unless
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
unless Chef::Config[:solo]
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Line is too long. [103/80] Open
default['jenkins-server']['security']['notifies']['resource'] = 'jenkins_script[configure permissions]'
- Exclude checks
Line is too long. [139/80] Open
default['jenkins-server']['settings']['slave_agent_port'] = 0 # Port | 0 to indicate random available TCP port | -1 to disable this service
- Exclude checks
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if node['jenkins-server']['java']['install']
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Line is too long. [86/80] Open
# Set a Jenkins slave attribute that the Jenkins master server will find with a search
- Exclude checks
Line is too long. [105/80] Open
node['jenkins-server']['slaves']['search_key'] => [node['jenkins-server']['slaves']['search_key']],
- Exclude checks
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if slave.key?('availability') then availability slave['availability'] end
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?