crowbar/crowbar-hadoop

View on GitHub

Showing 509 of 509 total issues

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

if not File.exists?(shared_edits_directory)
  Chef::Log.info("HI - Creating HA export directory [#{shared_edits_directory}]") if debug
  directory shared_edits_directory do
    owner "hdfs"
    group "hadoop"
chef/cookbooks/hadoop_infrastructure/recipes/cm-ha-filer-mount.rb on lines 49..58

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 36.

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

if secondary_name_nodes.length == 0
  Chef::Log.info("HADOOP : WARNING - Cannot find Hadoop secondary name node")
  node[:hadoop][:cluster][:valid_config] = false
elsif secondary_name_nodes.length > 1
  Chef::Log.info("HADOOP : WARNING - More than one secondary name node found}")
Severity: Minor
Found in chef/cookbooks/hadoop/recipes/default.rb and 1 other location - About 35 mins to fix
chef/cookbooks/hadoop/recipes/default.rb on lines 68..74

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 36.

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 6 locations. Consider refactoring.
Open

if node[:hadoop_infrastructure][:cluster][:cmservernodes]
  node[:hadoop_infrastructure][:cluster][:cmservernodes].each do |n|
    name = n[:name]
    key = n[:ssh_key] rescue nil
    keys[name] = key
Severity: Major
Found in chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb and 5 other locations - About 35 mins to fix
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 122..126
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 133..137
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 144..148
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 166..170
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 177..181

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 35.

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 6 locations. Consider refactoring.
Open

if node[:hadoop_infrastructure][:cluster][:namenodes]
  node[:hadoop_infrastructure][:cluster][:namenodes].each do |n|
    name = n[:name]
    key = n[:ssh_key] rescue nil
    keys[name] = key
Severity: Major
Found in chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb and 5 other locations - About 35 mins to fix
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 133..137
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 144..148
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 155..159
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 166..170
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 177..181

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 35.

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 6 locations. Consider refactoring.
Open

if node[:hadoop_infrastructure][:cluster][:hafilernodes]
  node[:hadoop_infrastructure][:cluster][:hafilernodes].each do |n|
    name = n[:name]
    key = n[:ssh_key] rescue nil
    keys[name] = key
Severity: Major
Found in chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb and 5 other locations - About 35 mins to fix
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 122..126
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 133..137
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 144..148
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 155..159
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 177..181

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 35.

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 6 locations. Consider refactoring.
Open

if node[:hadoop_infrastructure][:cluster][:datanodes]
  node[:hadoop_infrastructure][:cluster][:datanodes].each do |n|
    name = n[:name]
    key = n[:ssh_key] rescue nil
    keys[name] = key
Severity: Major
Found in chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb and 5 other locations - About 35 mins to fix
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 122..126
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 144..148
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 155..159
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 166..170
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 177..181

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 35.

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 6 locations. Consider refactoring.
Open

if node[:hadoop_infrastructure][:cluster][:edgenodes]
  node[:hadoop_infrastructure][:cluster][:edgenodes].each do |n|
    name = n[:name]
    key = n[:ssh_key] rescue nil
    keys[name] = key
Severity: Major
Found in chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb and 5 other locations - About 35 mins to fix
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 122..126
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 133..137
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 155..159
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 166..170
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 177..181

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 35.

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

Block has too many lines. [28/25]
Open

found_disks.each { |disk|
  if disk[:fresh]
    # We just created this filesystem. Grab its UUID and create a mount point.
    disk[:uuid]=get_uuid disk[:name]
    Chef::Log.info("HI - Adding #{disk[:name]} (#{disk[:uuid]}) to the Hadoop configuration.")

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.

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

if node[:hadoop_infrastructure][:cluster][:hajournalingnodes]
  node[:hadoop_infrastructure][:cluster][:hajournalingnodes].each do |n|
    name = n[:name]
    key = n[:ssh_key] rescue nil
    keys[name] = key
Severity: Major
Found in chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb and 5 other locations - About 35 mins to fix
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 122..126
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 133..137
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 144..148
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 155..159
chef/cookbooks/hadoop_infrastructure/recipes/hadoop-setup.rb on lines 166..170

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 35.

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

  unless ::Kernel.system("grep -q \'#{target_suffix}$\' /proc/partitions")
    Chef::Log.info("HI - Creating hadoop partition on #{target_dev}")
    ::Kernel.system("parted -s #{target_dev} -- unit s mklabel gpt mkpart primary ext2 2048s -1M")
    ::Kernel.system("partprobe #{target_dev}")
    sleep 3
Severity: Minor
Found in chef/cookbooks/hadoop_infrastructure/recipes/configure-disks.rb and 1 other location - About 30 mins to fix
chef/cookbooks/hadoop/recipes/configure-disks.rb on lines 76..81

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 33.

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

  unless ::Kernel.system("grep -q \'#{target_suffix}$\' /proc/partitions")
    Chef::Log.info("HADOOP: Creating hadoop partition on #{target_dev}")
    ::Kernel.system("parted -s #{target_dev} -- unit s mklabel gpt mkpart primary ext2 2048s -1M")
    ::Kernel.system("partprobe #{target_dev}")
    sleep 3
Severity: Minor
Found in chef/cookbooks/hadoop/recipes/configure-disks.rb and 1 other location - About 30 mins to fix
chef/cookbooks/hadoop_infrastructure/recipes/configure-disks.rb on lines 113..118

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 33.

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

if secondary_node_ip.nil? || secondary_node_ip.empty? || secondary_node_ip == "0.0.0.0"
  Chef::Log.info("HADOOP : WARNING - Invalid secondary name node IP #{secondary_node_ip}")
  node[:hadoop][:cluster][:valid_config] = false
else
  Chef::Log.info("HADOOP : SECONDARY NAME NODE IP #{secondary_node_ip}") if debug
Severity: Minor
Found in chef/cookbooks/hadoop/recipes/default.rb and 1 other location - About 30 mins to fix
chef/cookbooks/hadoop/recipes/default.rb on lines 153..158

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 33.

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

if master_node_ip.nil? || master_node_ip.empty? || master_node_ip == "0.0.0.0"
  Chef::Log.info("HADOOP : WARNING - Invalid master name node IP #{master_node_ip}")
  node[:hadoop][:cluster][:valid_config] = false
else
  Chef::Log.info("HADOOP : MASTER NAME NODE IP #{master_node_ip}") if debug
Severity: Minor
Found in chef/cookbooks/hadoop/recipes/default.rb and 1 other location - About 30 mins to fix
chef/cookbooks/hadoop/recipes/default.rb on lines 172..177

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 33.

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

Block has too many lines. [27/25]
Open

to_use_disks.sort.each { |k|
  # By default, we will format first partition.
  target_suffix= k + "1"
  target_dev = "/dev/#{k}"
  target_dev_part = "/dev/#{target_suffix}"

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. [27/25]
Open

    respond_to do |format|
      format.html { render template: "barclamp/hadoop_infrastructure/nodes" }
      format.text {
        export = ["role, ip, name, cpu, ram, drives"]
        @hadoop_config[:adminnodes].each do |node|

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.

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

        @hadoop_config[:edgenodes].each do |node|
          export << I18n.t(".barclamp.hadoop_infrastructure.nodes.edgenodes") + ", #{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 50..51
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[:hajournalingnodes].each do |node|
          export << I18n.t(".barclamp.hadoop_infrastructure.nodes.hajournalingnodes") + ", #{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 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 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[:hafilernodes].each do |node|
          export << I18n.t(".barclamp.hadoop_infrastructure.nodes.hafilernodes") + ", #{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 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

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[:adminnodes].each do |node|
          export << I18n.t(".barclamp.hadoop_infrastructure.nodes.adminnodes") + ", #{node.ip}, #{node.name}, #{node.cpu}, #{node.memory}, #{node.number_of_drives}"
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 47..48
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[:datanodes].each do |node|
          export << I18n.t(".barclamp.hadoop_infrastructure.nodes.datanodes") + ", #{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 50..51
crowbar_framework/app/controllers/hadoop_infrastructure_controller.rb on lines 53..54
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

Severity
Category
Status
Source
Language