Showing 509 of 509 total issues
Surrounding space missing for operator =
. (https://github.com/bbatsov/ruby-style-guide#spaces-operators) Open
disk[:uuid]=get_uuid target_dev_part
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that operators have space around them, except for ** which should not have surrounding space.
Example:
# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b
# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b
Space missing to the left of {. Open
IO.popen("blkid -c /dev/null -s UUID -o value #{disk}"){ |f|
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that block braces have or don't have a space before the opening brace depending on configuration.
Example:
# bad
foo.map{ |a|
a.bar.to_s
}
# good
foo.map { |a|
a.bar.to_s
}
Surrounding space missing for operator =
. (https://github.com/bbatsov/ruby-style-guide#spaces-operators) Open
disk[:mount_point]="#{dfs_base_dir}/#{cnt}"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that operators have space around them, except for ** which should not have surrounding space.
Example:
# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b
# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b
Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens) Open
override_attributes()
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for unwanted parentheses in parameterless method calls.
Example:
# bad
object.some_method()
# good
object.some_method
end
at 64, 2 is not aligned with to_use_disks = BarclampLibrary::Barclamp::Inventory::Disk.claimed(node,"Cloudera").map do |d|
at 62, 0. Open
end.sort
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks whether the end keywords are aligned properly for do end blocks.
Three modes are supported through the EnforcedStyleAlignWith
configuration parameter:
start_of_block
: the end
shall be aligned with the
start of the line where the do
appeared.
start_of_line
: the end
shall be aligned with the
start of the line where the expression started.
either
(which is the default) : the end
is allowed to be in either
location. The autofixer will default to start_of_line
.
Example: EnforcedStyleAlignWith: either (default)
# bad
foo.bar
.each do
baz
end
# good
variable = lambda do |i|
i
end
Example: EnforcedStyleAlignWith: startofblock
# bad
foo.bar
.each do
baz
end
# good
foo.bar
.each do
baz
end
Example: EnforcedStyleAlignWith: startofline
# bad
foo.bar
.each do
baz
end
# good
foo.bar
.each do
baz
end
File.exists?
is deprecated in favor of File.exist?
. Open
if not File.exists?(target_dev)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for uses of the deprecated class method usages.
Example:
# bad
File.exists?(some_path)
Example:
# good
File.exist?(some_path)
Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens) Open
default_attributes()
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for unwanted parentheses in parameterless method calls.
Example:
# bad
object.some_method()
# good
object.some_method
Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens) Open
override_attributes()
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for unwanted parentheses in parameterless method calls.
Example:
# bad
object.some_method()
# good
object.some_method
Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens) Open
default_attributes()
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for unwanted parentheses in parameterless method calls.
Example:
# bad
object.some_method()
# good
object.some_method
Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens) Open
override_attributes()
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for unwanted parentheses in parameterless method calls.
Example:
# bad
object.some_method()
# good
object.some_method
Final newline missing. (https://github.com/bbatsov/ruby-style-guide#newline-eof) Open
override_attributes()
- Create a ticketCreate a ticket
- Exclude checks
Useless assignment to variable - env_filter
. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars) Open
env_filter = " AND environment:#{node[:sqoop][:config][:environment]}"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
Avoid more than 3 levels of block nesting. (https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count) Open
Chef::Log.info("HI - disk format failed for #{disk[:name]}") if debug
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for excessive nesting of conditional and looping constructs.
You can configure if blocks are considered using the CountBlocks
option. When set to false
(the default) blocks are not counted
towards the nesting level. Set to true
to count blocks as well.
The maximum level of nesting allowed is configurable.
Avoid using {...}
for multi-line blocks. (https://github.com/bbatsov/ruby-style-guide#single-line-blocks) Open
found_disks.each { |disk|
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Check for uses of braces or do/end around single line or multi-line blocks.
Example: EnforcedStyle: linecountbased (default)
# bad - single line block
items.each do |item| item / 5 end
# good - single line block
items.each { |item| item / 5 }
# bad - multi-line block
things.map { |thing|
something = thing.some_method
process(something)
}
# good - multi-line block
things.map do |thing|
something = thing.some_method
process(something)
end
Example: EnforcedStyle: semantic
# Prefer `do...end` over `{...}` for procedural blocks.
# return value is used/assigned
# bad
foo = map do |x|
x
end
puts (map do |x|
x
end)
# return value is not used out of scope
# good
map do |x|
x
end
# Prefer `{...}` over `do...end` for functional blocks.
# return value is not used out of scope
# bad
each { |x|
x
}
# return value is used/assigned
# good
foo = map { |x|
x
}
map { |x|
x
}.inspect
Example: EnforcedStyle: bracesforchaining
# bad
words.each do |word|
word.flip.flop
end.join("-")
# good
words.each { |word|
word.flip.flop
}.join("-")
The name of this source file (hadoop-slavenode.rb
) should use snake_case. (https://github.com/bbatsov/ruby-style-guide#snake-case-files) Open
#
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.
Example:
# bad
lib/layoutManager.rb
anything/usingCamelCase
# good
lib/layout_manager.rb
anything/using_snake_case.rake
The name of this source file (sqoop-interpreter.rb
) should use snake_case. (https://github.com/bbatsov/ruby-style-guide#snake-case-files) Open
#
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.
Example:
# bad
lib/layoutManager.rb
anything/usingCamelCase
# good
lib/layout_manager.rb
anything/using_snake_case.rake
Line is too long. [103/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength) Open
license "Apache 2.0 License, Copyright (c) 2011 Dell Inc. - http://www.apache.org/licenses/LICENSE-2.0"
- Create a ticketCreate a ticket
- Exclude checks
Surrounding space missing for operator =
. (https://github.com/bbatsov/ruby-style-guide#spaces-operators) Open
disk[:mount_point]="#{dfs_base_dir}/#{cnt}"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that operators have space around them, except for ** which should not have surrounding space.
Example:
# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b
# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b
Carriage return character detected. (https://github.com/bbatsov/ruby-style-guide#crlf) Open
#
# Cookbook: hadoop
- Create a ticketCreate a ticket
- Exclude checks
Final newline missing. (https://github.com/bbatsov/ruby-style-guide#newline-eof) Open
override_attributes()
- Create a ticketCreate a ticket
- Exclude checks