pietervogelaar/chef-cookbook-jenkins-server

View on GitHub
recipes/views.rb

Summary

Maintainability
A
0 mins
Test Coverage

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.

Use meaningful heredoc delimiters.
Open

    EOH
Severity: Minor
Found in recipes/views.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

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

      view.filterQueue = #{!!options['filter_queue']}
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.

Line is too long. [82/80]
Open

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

Use snake_case for variable names.
Open

  node['jenkins-server']['views'].each do |viewName, options|
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.filterExecutors = #{!!options['filter_executors']}
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.

Use meaningful heredoc delimiters.
Open

  EOH
Severity: Minor
Found in recipes/views.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

There are no issues that match your filters.

Category
Status