crowbar/crowbar-hadoop

View on GitHub

Showing 19 of 509 total issues

Method create_proposal has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

  def create_proposal
    @logger.debug("hadoop_infrastructure create_proposal: entering")
    base = super

    adminnodes = [] # Crowbar admin node (size=1).
Severity: Minor
Found in crowbar_framework/app/models/hadoop_infrastructure_service.rb - About 6 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method create_proposal has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

  def create_proposal
    @logger.debug("hadoop create_proposal: entering")
    base = super

    # Compute the hadoop cluster node distribution.
Severity: Minor
Found in crowbar_framework/app/models/hadoop_service.rb - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method create_proposal has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_proposal
    @logger.debug("hadoop_infrastructure create_proposal: entering")
    base = super

    adminnodes = [] # Crowbar admin node (size=1).
Severity: Major
Found in crowbar_framework/app/models/hadoop_infrastructure_service.rb - About 2 hrs to fix

Method create_proposal has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_proposal
    @logger.debug("hadoop create_proposal: entering")
    base = super

    # Compute the hadoop cluster node distribution.
Severity: Minor
Found in crowbar_framework/app/models/hadoop_service.rb - About 1 hr to fix

Method create_proposal has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def create_proposal
    @logger.debug("zookeeper create_proposal: entering")
    base = super

    # Get the node list.
Severity: Minor
Found in crowbar_framework/app/models/zookeeper_service.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method nodes has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def nodes
    @hadoop_config = @service_object.get_hadoop_config

    respond_to do |format|
      format.html { render template: "barclamp/hadoop_infrastructure/nodes" }

Method create_proposal has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def create_proposal
    @logger.debug("hive create_proposal: entering")
    base = super

    # Get the node list.
Severity: Minor
Found in crowbar_framework/app/models/hive_service.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method create_proposal has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def create_proposal
    @logger.debug("pig create_proposal: entering")
    base = super

    # Get the node list.
Severity: Minor
Found in crowbar_framework/app/models/pig_service.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method apply_role_pre_chef_call has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def apply_role_pre_chef_call(old_role, role, all_nodes)
    @logger.debug("hadoop apply_role_pre_chef_call: entering #{all_nodes.inspect}")
    return if all_nodes.empty?

    # Make sure that the front-end pieces have public ip addreses.
Severity: Minor
Found in crowbar_framework/app/models/hadoop_service.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method create_proposal has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def create_proposal
    @logger.debug("sqoop create_proposal: entering")
    base = super

    # Get the node list.
Severity: Minor
Found in crowbar_framework/app/models/sqoop_service.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method apply_role_pre_chef_call has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def apply_role_pre_chef_call(old_role, role, all_nodes)
    @logger.debug("hadoop_infrastructure apply_role_pre_chef_call: entering #{all_nodes.inspect}")
    return if all_nodes.empty?

    # Assign a public IP address to the edge node for external access.
Severity: Minor
Found in crowbar_framework/app/models/hadoop_infrastructure_service.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid deeply nested control flow statements.
Open

        slaves << n[:fqdn] if n[:fqdn]
Severity: Major
Found in crowbar_framework/app/models/hadoop_service.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

      slaves << nodes[1][:fqdn] if nodes[1][:fqdn]
Severity: Major
Found in crowbar_framework/app/models/hadoop_service.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

      edge << nodes[2][:fqdn] if nodes[2][:fqdn]
Severity: Major
Found in crowbar_framework/app/models/hadoop_service.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

      namenodes << nodes[1][:fqdn] if nodes[1][:fqdn]
Severity: Major
Found in crowbar_framework/app/models/hadoop_infrastructure_service.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

      namenodes << nodes[0][:fqdn] if nodes[0][:fqdn]
Severity: Major
Found in crowbar_framework/app/models/hadoop_infrastructure_service.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

      master << nodes[0][:fqdn] if nodes[0][:fqdn]
Severity: Major
Found in crowbar_framework/app/models/hadoop_service.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

      edgenodes << nodes[2][:fqdn] if nodes[2][:fqdn]
Severity: Major
Found in crowbar_framework/app/models/hadoop_infrastructure_service.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

        datanodes << n[:fqdn] if n[:fqdn]
Severity: Major
Found in crowbar_framework/app/models/hadoop_infrastructure_service.rb - About 45 mins to fix
Severity
Category
Status
Source
Language