crowbar/crowbar-hadoop

View on GitHub

Showing 509 of 509 total issues

Similar blocks of code found in 7 locations. Consider refactoring.
Open

        @hadoop_config[:servernodes].each do |node|
          export << I18n.t(".barclamp.hadoop_infrastructure.nodes.servernodes") + ", #{node.ip}, #{node.name}, #{node.cpu}, #{node.memory}, #{node.number_of_drives}"
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 44..45
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 50..51
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 53..54
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 56..57
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 59..60
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 62..63

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 32.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

        @hadoop_config[:namenodes].each do |node|
          export << I18n.t(".barclamp.hadoop_infrastructure.nodes.namenodes") + ", #{node.ip}, #{node.name}, #{node.cpu}, #{node.memory}, #{node.number_of_drives}"
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 44..45
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 47..48
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 53..54
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 56..57
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 59..60
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 62..63

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 32.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      master << nodes[0][:fqdn] if nodes[0][:fqdn]
      slaves << nodes[1][:fqdn] if nodes[1][:fqdn]
Severity: Minor
Found in crowbar_framework/app/models/hadoop_service.rb and 1 other location - About 20 mins to fix
crowbar_framework/app/models/hadoop_infrastructure_service.rb on lines 104..105

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 27.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      namenodes << nodes[0][:fqdn] if nodes[0][:fqdn]
      namenodes << nodes[1][:fqdn] if nodes[1][:fqdn]
Severity: Minor
Found in crowbar_framework/app/models/hadoop_infrastructure_service.rb and 1 other location - About 20 mins to fix
crowbar_framework/app/models/hadoop_service.rb on lines 66..67

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 27.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  directory path do
    owner hdfs_owner
    group hdfs_group
    mode "0755"
    recursive true
Severity: Minor
Found in chef/cookbooks/hadoop/recipes/slavenode.rb and 1 other location - About 15 mins to fix
chef/cookbooks/hadoop/recipes/slavenode.rb on lines 96..103

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  directory path do
    owner mapred_owner
    group hadoop_group
    mode "0755"
    recursive true
Severity: Minor
Found in chef/cookbooks/hadoop/recipes/slavenode.rb and 1 other location - About 15 mins to fix
chef/cookbooks/hadoop/recipes/slavenode.rb on lines 82..89

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

The name of this source file (zookeeper-server.rb) should use snake_case. (https://github.com/bbatsov/ruby-style-guide#snake-case-files)
Open

#
Severity: Minor
Found in chef/roles/zookeeper-server.rb by rubocop

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

Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens)
Open

default_attributes()

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

The name of this source file (hadoop_infrastructure-datanode.rb) should use snake_case. (https://github.com/bbatsov/ruby-style-guide#snake-case-files)
Open

#

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

Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens)
Open

default_attributes()
Severity: Minor
Found in chef/roles/pig-interpreter.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Use 2 (not 0) spaces for indentation. (https://github.com/bbatsov/ruby-style-guide#spaces-indentation)
Open

  d.device

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens)
Open

default_attributes()

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()

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()

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Carriage return character detected. (https://github.com/bbatsov/ruby-style-guide#crlf)
Open

#
# Cookbook: hadoop_infrastructure

The name of this source file (hadoop_infrastructure-cb-adminnode.rb) should use snake_case. (https://github.com/bbatsov/ruby-style-guide#snake-case-files)
Open

#

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

Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens)
Open

override_attributes()
Severity: Minor
Found in chef/roles/pig-interpreter.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Surrounding space missing for operator =. (https://github.com/bbatsov/ruby-style-guide#spaces-operators)
Open

    disk[:uuid]=get_uuid disk[:name]

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

Use && instead of and. (https://github.com/bbatsov/ruby-style-guide#no-and-or-or)
Open

      if stat and stat.exited? and stat.exitstatus == 0

This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

Example: EnforcedStyle: always (default)

# bad
foo.save and return

# bad
if foo and bar
end

# good
foo.save && return

# good
if foo && bar
end

Example: EnforcedStyle: conditionals

# bad
if foo and bar
end

# good
foo.save && return

# good
foo.save and return

# good
if foo && bar
end

Do not use parentheses for method calls with no arguments. (https://github.com/bbatsov/ruby-style-guide#method-invocation-parens)
Open

override_attributes()
Severity: Minor
Found in chef/roles/hadoop-masternamenode.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method
Severity
Category
Status
Source
Language