uniak/puppet-networkdevice

View on GitHub

Showing 46 of 98 total issues

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

module Puppet::Util::NetworkDevice::Cisco_ios::Model::Interface::Hardware::C2960

  # TODO: Generalize me!
  def self.ifprop(base, param, base_command = param, &block)
    base.register_scoped param, /^(interface\s+(\S+).*?)^!/m do
lib/puppet/util/network_device/cisco_ios/model/interface/hardware/c4500.rb on lines 3..30

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

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

module Puppet::Util::NetworkDevice::Cisco_ios::Model::Interface::Hardware::C4500

  # TODO: Generalize me!
  def self.ifprop(base, param, base_command = param, &block)
    base.register_scoped param, /^(interface\s+(\S+).*?)^!/m do
lib/puppet/util/network_device/cisco_ios/model/interface/hardware/c2960.rb on lines 3..30

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

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

class Puppet::Util::NetworkDevice::Cisco_ios::Model::Interface < Puppet::Util::NetworkDevice::Cisco_ios::Model::Base

  attr_reader :params, :name

  def initialize(transport, facts, options)
Severity: Major
Found in lib/puppet/util/network_device/cisco_ios/model/interface.rb and 1 other location - About 2 hrs to fix
lib/puppet/util/network_device/cisco_ios/model/line.rb on lines 6..44

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

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

class Puppet::Util::NetworkDevice::Cisco_ios::Model::Line < Puppet::Util::NetworkDevice::Cisco_ios::Model::Base

  attr_reader :params, :name

  def initialize(transport, facts, options)
Severity: Major
Found in lib/puppet/util/network_device/cisco_ios/model/line.rb and 1 other location - About 2 hrs to fix
lib/puppet/util/network_device/cisco_ios/model/interface.rb on lines 6..44

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

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

    [is.keys, should.keys].flatten.uniq.sort.each do |property|
      next if property == :acl_type
      next if should[property] == :undef
      @params[property].value = :absent if should[property] == :absent || should[property].nil?
      @params[property].value = should[property] unless should[property] == :absent || should[property].nil?
Severity: Major
Found in lib/puppet/util/network_device/cisco_ios/model/vlan.rb and 2 other locations - About 1 hr to fix
lib/puppet/util/network_device/cisco_ios/model/base.rb on lines 21..26
lib/puppet/util/network_device/cisco_ios/model/snmp_community.rb on lines 35..40

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

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

    [is.keys, should.keys].flatten.uniq.sort.each do |property|
      next if property == :acl_type
      next if should[property] == :undef
      @params[property].value = :absent if should[property] == :absent || should[property].nil?
      @params[property].value = should[property] unless should[property] == :absent || should[property].nil?
lib/puppet/util/network_device/cisco_ios/model/base.rb on lines 21..26
lib/puppet/util/network_device/cisco_ios/model/vlan.rb on lines 24..29

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

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

    [is.keys, should.keys].flatten.uniq.sort.each do |property|
      next if property == :ensure
      next if should[property] == :undef
      @params[property].value = :absent if should[property] == :absent || should[property].nil?
      @params[property].value = should[property] unless should[property] == :absent || should[property].nil?
Severity: Major
Found in lib/puppet/util/network_device/cisco_ios/model/base.rb and 2 other locations - About 1 hr to fix
lib/puppet/util/network_device/cisco_ios/model/snmp_community.rb on lines 35..40
lib/puppet/util/network_device/cisco_ios/model/vlan.rb on lines 24..29

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

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

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

    [is.keys, should.keys].flatten.uniq.sort.each do |property|
      next if should[property] == :undef
      @params[property].value = :absent if should[property] == :absent
      @params[property].value = should[property] unless should[property] == :absent || should[property].nil?
    end
lib/puppet/util/network_device/cisco_ios/model/user.rb on lines 31..35

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

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

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

    [is.keys, should.keys].flatten.uniq.sort.each do |property|
      next if should[property] == :undef
      @params[property].value = :absent if should[property] == :absent
      @params[property].value = should[property] unless should[property] == :absent || should[property].nil?
    end
Severity: Major
Found in lib/puppet/util/network_device/cisco_ios/model/user.rb and 1 other location - About 1 hr to fix
lib/puppet/util/network_device/cisco_ios/model/radius_server.rb on lines 38..42

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

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

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

    Puppet::Util::NetworkDevice::Sorter.new(@params).tsort.each do |param|
      # We dont want to change undefined values
      next if should[param.name] == :undef || should[param.name].nil?
      param.update(@transport, is[param.name]) unless is[param.name] == should[param.name]
Severity: Minor
Found in lib/puppet/util/network_device/cisco_ios/model/base.rb and 1 other location - About 50 mins to fix
lib/puppet/util/network_device/cisco_ios/model/acl.rb on lines 57..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 42.

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

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

      Puppet::Util::NetworkDevice::Sorter.new(@params).tsort.each do |param|
        # We dont want to change undefined values
        next if should[param.name] == :undef || should[param.name].nil?
        param.update(@transport, is[param.name]) unless is[param.name] == should[param.name]
Severity: Minor
Found in lib/puppet/util/network_device/cisco_ios/model/acl.rb and 1 other location - About 50 mins to fix
lib/puppet/util/network_device/cisco_ios/model/base.rb on lines 28..31

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

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

    base.register_scoped :local_authentication, /^(aaa\s+authentication\s+login\s+default\s+group\s+(\S+)\s+local)/, Puppet::Util::NetworkDevice::Cisco_ios::Model::ScopedValue do
      cmd 'sh run'
      match do |txt|
        (!txt.nil? and txt.length > 0) ? :true : :false
      end
lib/puppet/util/network_device/cisco_ios/model/aaa_group/base.rb on lines 65..77

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

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

    base.register_scoped :local_authorization, /^(aaa\s+authorization\s+exec\s+default\s+group\s+(\S+)\s+local)/, Puppet::Util::NetworkDevice::Cisco_ios::Model::ScopedValue do
      cmd 'sh run'
      match do |txt|
        (!txt.nil? and txt.length > 0) ? :true : :false
      end
lib/puppet/util/network_device/cisco_ios/model/aaa_group/base.rb on lines 50..62

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

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_trap).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_trap/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_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_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_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

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_snmp_server_host).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_host/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_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

Severity
Category
Status
Source
Language