uniak/puppet-networkdevice

View on GitHub

Showing 98 of 98 total issues

Method lineprop has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def self.lineprop(base, param, base_command = param, &block)
    base.register_scoped param, /^(line\s+((?:con|vty)\s+\d+(?:\s+\d+)?)\s*\n(?:\s[^\n]*\n)*)/ do
      cmd 'sh run'
      match /^\s*#{base_command}\s+(.*)$/
      scope_match do |scope, scope_name|
Severity: Minor
Found in lib/puppet/util/network_device/cisco_ios/model/line/base.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 tsort_each_child has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def tsort_each_child(param, &block)
    @param.each_value.select  { |i|
      next unless i.respond_to?(:before) && i.respond_to?(:after)
      next unless param.respond_to?(:after)
      i.before == param.name || i.name == param.after
Severity: Minor
Found in lib/puppet/util/network_device/sorter.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 register has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def self.register(base)
    base.base_cmd = "snmp-server community <%= name %>"
    snmp_scope = /^(snmp-server community (\S+)(.*))/
    base.register_scoped :ensure, snmp_scope do
      match do |txt|

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 initialize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def initialize(url)
    @url = URI.parse(url)
    @query = CGI.parse(@url.query) if @url.query

    require "puppet/util/network_device/transport_ios/#{@url.scheme}"
Severity: Minor
Found in lib/puppet/util/network_device/base_ios.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 newhostlistprop has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def newhostlistprop(name, options = {}, &block)
    # hostlists do array_matching all by default
    options[:array_matching] ||= :all

    newproperty(name, options) do
Severity: Minor
Found in lib/puppet/util/host_list_prop.rb - About 1 hr to fix

    Method connect has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def connect(&block)
        begin
          Puppet.debug "Trying to connect to #{host} as #{user}"
          @ssh = Net::SSH.start(host, user, :port => port, :password => password, :timeout => timeout)
        rescue TimeoutError
    Severity: Minor
    Found in lib/puppet/util/network_device/transport_ios/sshios.rb - About 1 hr to fix

      Method register has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.register(base)
          base.base_cmd = "snmp-server host <%= name %>"
          snmp_scope = /^(snmp-server host (\S+)(.*))/
          base.register_scoped :ensure, snmp_scope do
            match do |txt|
      Severity: Minor
      Found in lib/puppet/util/network_device/cisco_ios/model/snmp_host/base.rb - About 1 hr to fix

        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

            [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

            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

        Method define_value_method has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def define_value_method(methods)
            methods.each do |meth|
              define_method(meth) do |*args, &block|
                # return the current value if we are called like an accessor
                return instance_variable_get("@#{meth}".to_sym) if args.empty? && block.nil?
        Severity: Minor
        Found in lib/puppet/util/network_device/value_helper.rb - About 45 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

                  yield nil if block_given?
        Severity: Major
        Found in lib/puppet/util/network_device/transport_ios/sshios.rb - About 45 mins to fix

          Method newhostlistprop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def newhostlistprop(name, options = {}, &block)
              # hostlists do array_matching all by default
              options[:array_matching] ||= :all
          
              newproperty(name, options) do
          Severity: Minor
          Found in lib/puppet/util/host_list_prop.rb - About 45 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 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_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_snmp_server_group).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_group/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_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_interface).provide :cisco_ios, :parent => Puppet::Provider::Cisco_ios do
            desc "Cisco Switch / Router Interface Provider for Device Configuration."
            mk_resource_methods
          
            def initialize(device, *args)
          Severity: Major
          Found in lib/puppet/provider/cisco_interface/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_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

          Severity
          Category
          Status
          Source
          Language