HewlettPackard/oneview-puppet

View on GitHub

Showing 44 of 92 total issues

Method update_ports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def update_ports
    Puppet.notice("\n\nUpdating ports...\n")
    interconnect = get_single_resource_instance
    raise('The port information needs to be specified for this action.') unless @ports
    @ports.each do |port|
Severity: Minor
Found in lib/puppet/provider/oneview_interconnect/c7000.rb - About 25 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 parse_uplink_sets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def parse_uplink_sets
    api_version = login[:api_version]
    hardware_variant = login[:hardware_variant]
    lig = OneviewSDK.resource_named(:LogicalInterconnectGroup, api_version, hardware_variant).new(@client, {})
    @uplink_sets.each do |uplink_set_params|
Severity: Minor
Found in lib/puppet/provider/oneview_logical_interconnect_group/c7000.rb - About 25 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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    new_name = @data.delete('new_name')
    uplink_set = @resource_type.new(@client, @data)
    @data['new_name'] = new_name if new_name
    return true if resource_update
Severity: Minor
Found in lib/puppet/provider/oneview_uplink_set/c7000.rb - About 25 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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    new_name = @data.delete('new_name')
    lsg = @resource_type.new(@client, @data)
    lsg.set_grouping_parameters(@switches['number_of_switches'].to_i, @switches['type'].to_s) if @switches
    @data['new_name'] = new_name if new_name
Severity: Minor
Found in lib/puppet/provider/oneview_logical_switch_group/c7000.rb - About 25 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

Severity
Category
Status
Source
Language