puppetlabs/facter-ng

View on GitHub

Showing 200 of 200 total issues

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

  module Windows
    class Netmask6Interfaces
      FACT_NAME = 'netmask6_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facts/windows/netmask6_interfaces.rb and 15 other locations - About 40 mins to fix
lib/facts/linux/ipaddress6_interfaces.rb on lines 4..16
lib/facts/linux/ipaddress_interfaces.rb on lines 4..16
lib/facts/linux/macaddress_interfaces.rb on lines 4..16
lib/facts/linux/mtu_interfaces.rb on lines 4..16
lib/facts/linux/netmask6_interfaces.rb on lines 4..16
lib/facts/linux/netmask_interfaces.rb on lines 4..16
lib/facts/linux/network6_interfaces.rb on lines 4..16
lib/facts/linux/network_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress6_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress_interfaces.rb on lines 4..16
lib/facts/windows/macaddress_interfaces.rb on lines 4..16
lib/facts/windows/mtu_interfaces.rb on lines 4..16
lib/facts/windows/netmask_interfaces.rb on lines 4..16
lib/facts/windows/network6_interfaces.rb on lines 4..16
lib/facts/windows/network_interfaces.rb on lines 4..16

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

  module Windows
    class MtuInterfaces
      FACT_NAME = 'mtu_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facts/windows/mtu_interfaces.rb and 15 other locations - About 40 mins to fix
lib/facts/linux/ipaddress6_interfaces.rb on lines 4..16
lib/facts/linux/ipaddress_interfaces.rb on lines 4..16
lib/facts/linux/macaddress_interfaces.rb on lines 4..16
lib/facts/linux/mtu_interfaces.rb on lines 4..16
lib/facts/linux/netmask6_interfaces.rb on lines 4..16
lib/facts/linux/netmask_interfaces.rb on lines 4..16
lib/facts/linux/network6_interfaces.rb on lines 4..16
lib/facts/linux/network_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress6_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress_interfaces.rb on lines 4..16
lib/facts/windows/macaddress_interfaces.rb on lines 4..16
lib/facts/windows/netmask6_interfaces.rb on lines 4..16
lib/facts/windows/netmask_interfaces.rb on lines 4..16
lib/facts/windows/network6_interfaces.rb on lines 4..16
lib/facts/windows/network_interfaces.rb on lines 4..16

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

  module Linux
    class MacaddressInterfaces
      FACT_NAME = 'macaddress_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facts/linux/macaddress_interfaces.rb and 15 other locations - About 40 mins to fix
lib/facts/linux/ipaddress6_interfaces.rb on lines 4..16
lib/facts/linux/ipaddress_interfaces.rb on lines 4..16
lib/facts/linux/mtu_interfaces.rb on lines 4..16
lib/facts/linux/netmask6_interfaces.rb on lines 4..16
lib/facts/linux/netmask_interfaces.rb on lines 4..16
lib/facts/linux/network6_interfaces.rb on lines 4..16
lib/facts/linux/network_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress6_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress_interfaces.rb on lines 4..16
lib/facts/windows/macaddress_interfaces.rb on lines 4..16
lib/facts/windows/mtu_interfaces.rb on lines 4..16
lib/facts/windows/netmask6_interfaces.rb on lines 4..16
lib/facts/windows/netmask_interfaces.rb on lines 4..16
lib/facts/windows/network6_interfaces.rb on lines 4..16
lib/facts/windows/network_interfaces.rb on lines 4..16

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

  module Linux
    class MtuInterfaces
      FACT_NAME = 'mtu_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facts/linux/mtu_interfaces.rb and 15 other locations - About 40 mins to fix
lib/facts/linux/ipaddress6_interfaces.rb on lines 4..16
lib/facts/linux/ipaddress_interfaces.rb on lines 4..16
lib/facts/linux/macaddress_interfaces.rb on lines 4..16
lib/facts/linux/netmask6_interfaces.rb on lines 4..16
lib/facts/linux/netmask_interfaces.rb on lines 4..16
lib/facts/linux/network6_interfaces.rb on lines 4..16
lib/facts/linux/network_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress6_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress_interfaces.rb on lines 4..16
lib/facts/windows/macaddress_interfaces.rb on lines 4..16
lib/facts/windows/mtu_interfaces.rb on lines 4..16
lib/facts/windows/netmask6_interfaces.rb on lines 4..16
lib/facts/windows/netmask_interfaces.rb on lines 4..16
lib/facts/windows/network6_interfaces.rb on lines 4..16
lib/facts/windows/network_interfaces.rb on lines 4..16

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

  module Windows
    class MacaddressInterfaces
      FACT_NAME = 'macaddress_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facts/windows/macaddress_interfaces.rb and 15 other locations - About 40 mins to fix
lib/facts/linux/ipaddress6_interfaces.rb on lines 4..16
lib/facts/linux/ipaddress_interfaces.rb on lines 4..16
lib/facts/linux/macaddress_interfaces.rb on lines 4..16
lib/facts/linux/mtu_interfaces.rb on lines 4..16
lib/facts/linux/netmask6_interfaces.rb on lines 4..16
lib/facts/linux/netmask_interfaces.rb on lines 4..16
lib/facts/linux/network6_interfaces.rb on lines 4..16
lib/facts/linux/network_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress6_interfaces.rb on lines 4..16
lib/facts/windows/ipaddress_interfaces.rb on lines 4..16
lib/facts/windows/mtu_interfaces.rb on lines 4..16
lib/facts/windows/netmask6_interfaces.rb on lines 4..16
lib/facts/windows/netmask_interfaces.rb on lines 4..16
lib/facts/windows/network6_interfaces.rb on lines 4..16
lib/facts/windows/network_interfaces.rb on lines 4..16

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(fact_name, fact_class, filter_tokens, user_query, type)
Severity: Minor
Found in lib/models/searched_fact.rb - About 35 mins to fix

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

        def initialize(name, value = '', type = :core, user_query = nil, filter_tokens = [])
    Severity: Minor
    Found in lib/models/resolved_fact.rb - About 35 mins to fix

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

        module Linux
          module Networking
            class Scope6
              FACT_NAME = 'networking.scope6'
      
      
      Severity: Minor
      Found in lib/facts/linux/networking/scope6.rb and 2 other locations - About 35 mins to fix
      lib/facts/linux/networking/dhcp.rb on lines 4..15
      lib/facts/linux/networking/mtu.rb on lines 4..15

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

      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

        def create_fact_from_template(fact_name, operating_system)
          delimiters = ['.', '_']
          fact_tokens = fact_name.split(Regexp.union(delimiters))
          template = ERB.new(File.read(File.join(ROOT_DIR, 'tasks', 'fact_generator', 'fact.erb')))
      
      
      Severity: Minor
      Found in tasks/fact_generator/fact_creator.rb and 1 other location - About 35 mins to fix
      tasks/fact_generator/fact_creator.rb on lines 96..103

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

      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

        module Linux
          module Networking
            class Dhcp
              FACT_NAME = 'networking.dhcp'
      
      
      Severity: Minor
      Found in lib/facts/linux/networking/dhcp.rb and 2 other locations - About 35 mins to fix
      lib/facts/linux/networking/mtu.rb on lines 4..15
      lib/facts/linux/networking/scope6.rb on lines 4..15

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

      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

        module Linux
          module Networking
            class Mtu
              FACT_NAME = 'networking.mtu'
      
      
      Severity: Minor
      Found in lib/facts/linux/networking/mtu.rb and 2 other locations - About 35 mins to fix
      lib/facts/linux/networking/dhcp.rb on lines 4..15
      lib/facts/linux/networking/scope6.rb on lines 4..15

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

      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

              def populate_other_ipv6_facts(network_info, interface_name, binding)
                network_info[interface_name]['bindings6'] << binding
                network_info[interface_name][:ip6] ||= binding[:address]
                network_info[interface_name][:network6] ||= binding[:network]
                network_info[interface_name][:netmask6] ||= binding[:netmask]
      Severity: Minor
      Found in lib/resolvers/networking_linux_resolver.rb and 1 other location - About 35 mins to fix
      lib/resolvers/networking_linux_resolver.rb on lines 101..106

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

      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

        def create_spec_from_template(fact_name, operating_system)
          delimiters = ['.', '_']
          fact_tokens = fact_name.split(Regexp.union(delimiters))
          template = ERB.new(File.read(File.join(ROOT_DIR, 'tasks', 'fact_generator', 'fact_spec.erb')))
      
      
      Severity: Minor
      Found in tasks/fact_generator/fact_creator.rb and 1 other location - About 35 mins to fix
      tasks/fact_generator/fact_creator.rb on lines 86..93

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

      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

              def populate_other_ipv4_facts(network_info, interface_name, binding)
                network_info[interface_name]['bindings'] << binding
                network_info[interface_name][:ip] ||= binding[:address]
                network_info[interface_name][:network] ||= binding[:network]
                network_info[interface_name][:netmask] ||= binding[:netmask]
      Severity: Minor
      Found in lib/resolvers/networking_linux_resolver.rb and 1 other location - About 35 mins to fix
      lib/resolvers/networking_linux_resolver.rb on lines 130..135

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

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

        module Linux
          module Memory
            module System
              class Available
                FACT_NAME = 'memory.system.available'
      Severity: Major
      Found in lib/facts/linux/memory/system/available.rb and 7 other locations - About 35 mins to fix
      lib/facts/linux/memory/swap/available.rb on lines 4..14
      lib/facts/linux/memory/swap/total.rb on lines 4..14
      lib/facts/linux/memory/system/total.rb on lines 4..14
      lib/facts/macosx/memory/swap/available.rb on lines 4..15
      lib/facts/macosx/memory/swap/total.rb on lines 4..15
      lib/facts/macosx/memory/system/available.rb on lines 4..15
      lib/facts/macosx/memory/system/total.rb on lines 4..15

      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

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

                def collect_processors_info(fact_name)
                  require "#{ROOT_DIR}/lib/resolvers/freebsd/ffi/ffi_helper"
      
                  @fact_list[:logical_count] = logical_count
                  @fact_list[:models] = Array.new(logical_count, model) if logical_count && model
      Severity: Minor
      Found in lib/resolvers/freebsd/processors.rb and 1 other location - About 35 mins to fix
      lib/resolvers/bsd/processors.rb on lines 17..24

      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

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

        module Aix
          module Hypervisors
            class Lpar
              FACT_NAME = 'hypervisors.lpar'
      
      
      Severity: Minor
      Found in lib/facts/aix/hypervisors/lpar.rb and 1 other location - About 35 mins to fix
      lib/facts/aix/hypervisors/wpar.rb on lines 4..14

      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

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

        module Macosx
          module Memory
            module Swap
              class Total
                FACT_NAME = 'memory.swap.total'
      Severity: Major
      Found in lib/facts/macosx/memory/swap/total.rb and 7 other locations - About 35 mins to fix
      lib/facts/linux/memory/swap/available.rb on lines 4..14
      lib/facts/linux/memory/swap/total.rb on lines 4..14
      lib/facts/linux/memory/system/available.rb on lines 4..15
      lib/facts/linux/memory/system/total.rb on lines 4..14
      lib/facts/macosx/memory/swap/available.rb on lines 4..15
      lib/facts/macosx/memory/system/available.rb on lines 4..15
      lib/facts/macosx/memory/system/total.rb on lines 4..15

      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

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

        module Linux
          module Memory
            module Swap
              class Total
                FACT_NAME = 'memory.swap.total'
      Severity: Major
      Found in lib/facts/linux/memory/swap/total.rb and 7 other locations - About 35 mins to fix
      lib/facts/linux/memory/swap/available.rb on lines 4..14
      lib/facts/linux/memory/system/available.rb on lines 4..15
      lib/facts/linux/memory/system/total.rb on lines 4..14
      lib/facts/macosx/memory/swap/available.rb on lines 4..15
      lib/facts/macosx/memory/swap/total.rb on lines 4..15
      lib/facts/macosx/memory/system/available.rb on lines 4..15
      lib/facts/macosx/memory/system/total.rb on lines 4..15

      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

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

        module Linux
          module Memory
            module Swap
              class Available
                FACT_NAME = 'memory.swap.available'
      Severity: Major
      Found in lib/facts/linux/memory/swap/available.rb and 7 other locations - About 35 mins to fix
      lib/facts/linux/memory/swap/total.rb on lines 4..14
      lib/facts/linux/memory/system/available.rb on lines 4..15
      lib/facts/linux/memory/system/total.rb on lines 4..14
      lib/facts/macosx/memory/swap/available.rb on lines 4..15
      lib/facts/macosx/memory/swap/total.rb on lines 4..15
      lib/facts/macosx/memory/system/available.rb on lines 4..15
      lib/facts/macosx/memory/system/total.rb on lines 4..15

      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

      Severity
      Category
      Status
      Source
      Language