pietervogelaar/chef-cookbook-jenkins-server

View on GitHub

Showing 171 of 171 total issues

Line is too long. [85/80]
Open

# Copy home folder skeleton files from /etc/skel, because the Jenkins package install
Severity: Minor
Found in recipes/user.rb by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

gem "kitchen-vagrant"
Severity: Minor
Found in Gemfile by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

source "https://supermarket.chef.io"
Severity: Minor
Found in Berksfile by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Space inside { missing.
Open

  'gravatar' => {'version' => '2.1'},
Severity: Minor
Found in attributes/default.rb by rubocop

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 }}

Line is too long. [81/80]
Open

default['jenkins-server']['security']['chef-vault']['data_bag'] = 'jenkins-users'
Severity: Minor
Found in attributes/default.rb by rubocop

Space inside { missing.
Open

  'checkstyle' => {'version' => '3.42'},
Severity: Minor
Found in attributes/default.rb by rubocop

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 unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
Open

    unless Chef::Config[:solo]
Severity: Minor
Found in recipes/slaves_credentials.rb by rubocop

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?

Space inside } missing.
Open

  'checkstyle' => {'version' => '3.42'},
Severity: Minor
Found in attributes/default.rb by rubocop

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']['git']['install']
Severity: Minor
Found in recipes/default.rb by rubocop

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?

Use meaningful heredoc delimiters.
Open

    EOS
Severity: Minor
Found in recipes/composer.rb 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

Use snake_case for variable names.
Open

    viewClass = options['class'].nil? ? 'hudson.model.ListView' : options['class']
Severity: Minor
Found in recipes/views.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Avoid the use of double negation (!!).
Open

      view.recurse = #{!!options['recurse']}
Severity: Minor
Found in recipes/views.rb by rubocop

This cop checks for uses of double negation (!!) to convert something to a boolean value. As this is both cryptic and usually redundant, it should be avoided.

Example:

# bad
!!something

# good
!something.nil?

Please, note that when something is a boolean value !!something and !something.nil? are not the same thing. As you're unlikely to write code that can accept values of any type this is rarely a problem in practice.

Closing method call brace must be on the same line as the last argument when opening brace is on the same line as the first argument.
Open

  ).each do |item|
Severity: Minor
Found in recipes/slaves.rb by rubocop

This cop checks that the closing brace in a method call is either on the same line as the last method argument, or a new line.

When using the symmetrical (default) style:

If a method call's opening brace is on the same line as the first argument of the call, then the closing brace should be on the same line as the last argument of the call.

If an method call's opening brace is on the line above the first argument of the call, then the closing brace should be on the line below the last argument of the call.

When using the new_line style:

The closing brace of a multi-line method call must be on the line after the last argument of the call.

When using the same_line style:

The closing brace of a multi-line method call must be on the same line as the last argument of the call.

Example:

# symmetrical: bad
  # new_line: good
  # same_line: bad
  foo(a,
    b
  )

  # symmetrical: bad
  # new_line: bad
  # same_line: good
  foo(
    a,
    b)

  # symmetrical: good
  # new_line: bad
  # same_line: good
  foo(a,
    b)

  # symmetrical: good
  # new_line: good
  # same_line: bad
  foo(
    a,
    b
  )

Line is too long. [108/80]
Open

  node.run_state[:jenkins_private_key] = File.read("#{Chef::Config[:file_cache_path]}/jenkins-key") # ~FC001
Severity: Minor
Found in recipes/security.rb by rubocop

Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
Open

      if slave.key?('executors') then executors slave['executors'] end
Severity: Minor
Found in recipes/slaves.rb by rubocop

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. [83/80]
Open

# By default Jenkins allows everybody. Configure "Project Matrix Authorization" and
Severity: Minor
Found in recipes/security.rb by rubocop

Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
Open

      if slave.key?('usage_mode') then usage_mode slave['usage_mode'] end
Severity: Minor
Found in recipes/slaves.rb by rubocop

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. [94/80]
Open

# copy it into your own recipe and name it "configure custom permissions" for example. And set
Severity: Minor
Found in recipes/security.rb by rubocop

Line is too long. [81/80]
Open

  notifies :create, 'ruby_block[set jenkins_security_enabled flag]', :immediately
Severity: Minor
Found in recipes/security.rb by rubocop

Line is too long. [91/80]
Open

# Set the jenkins_security_enabled flag and set run_state to use the configured private key
Severity: Minor
Found in recipes/security.rb by rubocop
Severity
Category
Status
Source
Language