uniak/puppet-networkdevice

View on GitHub

Showing 98 of 98 total issues

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

Puppet::Type.type(:cisco_acl).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for Device Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_acl/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_snmp_server_community).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for SNMP Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_line).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for Device Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_line/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_radius_server).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for Radius-Server Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_radius_server/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_archive).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for Archive Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_archive/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_snmp_server).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for SNMP Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_snmp_server/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_user).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for User Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_user/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_snmp_server_view).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for SNMP Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_snmp_server_user).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for SNMP Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_aaa_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Puppet::Type.type(:cisco_aaa_group).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
  desc "Cisco Switch / Router Provider for Device Configuration."
  mk_resource_methods

  def initialize(device, *args)
Severity: Major
Found in lib/puppet/provider/cisco_aaa_group/cisco_ios.rb and 13 other locations - About 40 mins to fix
lib/puppet/provider/cisco_acl/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_archive/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_interface/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_line/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_radius_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_community/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_group/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_host/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_trap/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_user/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_snmp_server_view/cisco_ios.rb on lines 3..18
lib/puppet/provider/cisco_user/cisco_ios.rb on lines 3..18

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

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

Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def initialize(name, transport, facts = nil, idx = 0, &block)
Severity: Minor
Found in lib/puppet/util/network_device/cisco_ios/fact.rb - About 35 mins to fix

    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def initialize(name, transport, facts, idx, &block)
    Severity: Minor
    Found in lib/puppet/util/network_device/cisco_ios/model/generic_value.rb - About 35 mins to fix

      Method register_array has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def register_array(param, match_re, fetch_cmd, cmd, &block)
      Severity: Minor
      Found in lib/puppet/util/network_device/dsl.rb - About 35 mins to fix

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

            validate do |value|
              if resource.value(:mode) == :access and value == :absent
                raise ArgumentError, "Must set vlan number or sticky if mode is access"
              elsif resource.value(:mode) != :access and value != :absent
                raise ArgumentError, "May only be set if mode is access"
        Severity: Minor
        Found in lib/puppet/type/cisco_interface.rb and 1 other location - About 35 mins to fix
        lib/puppet/type/cisco_interface.rb on lines 59..66

        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

        Method parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          def parse(txt)
            if self.match.is_a?(Proc)
              self.value = self.match.call(txt)
            else
              self.value = txt.scan(self.match).flatten[self.idx]
        Severity: Minor
        Found in lib/puppet/util/network_device/cisco_ios/fact.rb - About 35 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

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

            validate do |value|
              if resource.value(:mode) == :trunk and value == :absent
                raise ArgumentError, "Must set encapsulation if mode is trunk"
              elsif resource.value(:mode) != :trunk and value != :absent
                raise ArgumentError, "May only be set if mode is trunk"
        Severity: Minor
        Found in lib/puppet/type/cisco_interface.rb and 1 other location - About 35 mins to fix
        lib/puppet/type/cisco_interface.rb on lines 29..36

        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

        Method params_to_hash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          def params_to_hash
            @params.inject({}) {|res, data|
              unless respond_to?(:skip_params_to_hash) && skip_params_to_hash.include?(data[0])
                unless data[1].value.nil? || data[1].value.to_s.empty?
                  if data[1].value.is_a?(Hash)
        Severity: Minor
        Found in lib/puppet/util/network_device/dsl.rb - About 35 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

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

          newproperty(:trunk_native_vlan) do
            desc "Set native VLAN when interface is in trunking mode"
            defaultto(:absent)
            newvalues(:absent, /^\d+$/)
        
        
        Severity: Minor
        Found in lib/puppet/type/cisco_interface.rb and 2 other locations - About 30 mins to fix
        lib/puppet/type/cisco_interface.rb on lines 40..50
        lib/puppet/type/cisco_interface.rb on lines 192..203

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

          newproperty(:trunk_allowed_vlan) do
            desc "List of allowed VLANs on this interface"
            defaultto(:absent)
            newvalues(:absent, /^(\d+(-\d+)?,)*\d+(-\d+)?$/)
        
        
        Severity: Minor
        Found in lib/puppet/type/cisco_interface.rb and 2 other locations - About 30 mins to fix
        lib/puppet/type/cisco_interface.rb on lines 70..80
        lib/puppet/type/cisco_interface.rb on lines 192..203

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

          newproperty(:spanning_tree_cost) do
            desc "The STP port priority"
        
            defaultto(:absent)
            newvalues(:absent, /^\d*$/)
        Severity: Minor
        Found in lib/puppet/type/cisco_interface.rb and 2 other locations - About 30 mins to fix
        lib/puppet/type/cisco_interface.rb on lines 40..50
        lib/puppet/type/cisco_interface.rb on lines 70..80

        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

        Severity
        Category
        Status
        Source
        Language