puppetlabs/facter

View on GitHub

Showing 386 of 386 total issues

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

  module Aix
    module Networking
      class Scope6
        FACT_NAME = 'networking.scope6'
        ALIASES = 'scope6'
Severity: Minor
Found in lib/facter/facts/aix/networking/scope6.rb and 2 other locations - About 20 mins to fix
lib/facter/facts/linux/networking/scope6.rb on lines 4..14
lib/facter/facts/windows/networking/scope6.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 28.

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

  module Windows
    module Os
      module Windows
        class ReleaseId
          FACT_NAME = 'os.windows.release_id'
Severity: Major
Found in lib/facter/facts/windows/os/windows/release_id.rb and 20 other locations - About 20 mins to fix
lib/facter/facts/linux/os/distro/codename.rb on lines 4..15
lib/facter/facts/linux/os/distro/description.rb on lines 4..15
lib/facter/facts/linux/os/distro/id.rb on lines 4..15
lib/facter/facts/linux/os/distro/specification.rb on lines 4..15
lib/facter/facts/linux/os/selinux/config_mode.rb on lines 4..15
lib/facter/facts/linux/os/selinux/config_policy.rb on lines 4..15
lib/facter/facts/linux/os/selinux/current_mode.rb on lines 4..15
lib/facter/facts/linux/os/selinux/enabled.rb on lines 4..15
lib/facter/facts/linux/os/selinux/enforced.rb on lines 4..15
lib/facter/facts/linux/os/selinux/policy_version.rb on lines 4..15
lib/facter/facts/macosx/os/macosx/build.rb on lines 4..13
lib/facter/facts/macosx/os/macosx/product.rb on lines 4..13
lib/facter/facts/windows/dmi/product/name.rb on lines 4..14
lib/facter/facts/windows/dmi/product/serial_number.rb on lines 4..14
lib/facter/facts/windows/dmi/product/uuid.rb on lines 4..14
lib/facter/facts/windows/os/windows/display_version.rb on lines 4..14
lib/facter/facts/windows/os/windows/edition_id.rb on lines 4..14
lib/facter/facts/windows/os/windows/installation_type.rb on lines 4..14
lib/facter/facts/windows/os/windows/product_name.rb on lines 4..14
lib/facter/facts/windows/os/windows/system32.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 28.

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

  module Linux
    module Os
      module Selinux
        class PolicyVersion
          FACT_NAME = 'os.selinux.policy_version'
Severity: Major
Found in lib/facter/facts/linux/os/selinux/policy_version.rb and 20 other locations - About 20 mins to fix
lib/facter/facts/linux/os/distro/codename.rb on lines 4..15
lib/facter/facts/linux/os/distro/description.rb on lines 4..15
lib/facter/facts/linux/os/distro/id.rb on lines 4..15
lib/facter/facts/linux/os/distro/specification.rb on lines 4..15
lib/facter/facts/linux/os/selinux/config_mode.rb on lines 4..15
lib/facter/facts/linux/os/selinux/config_policy.rb on lines 4..15
lib/facter/facts/linux/os/selinux/current_mode.rb on lines 4..15
lib/facter/facts/linux/os/selinux/enabled.rb on lines 4..15
lib/facter/facts/linux/os/selinux/enforced.rb on lines 4..15
lib/facter/facts/macosx/os/macosx/build.rb on lines 4..13
lib/facter/facts/macosx/os/macosx/product.rb on lines 4..13
lib/facter/facts/windows/dmi/product/name.rb on lines 4..14
lib/facter/facts/windows/dmi/product/serial_number.rb on lines 4..14
lib/facter/facts/windows/dmi/product/uuid.rb on lines 4..14
lib/facter/facts/windows/os/windows/display_version.rb on lines 4..14
lib/facter/facts/windows/os/windows/edition_id.rb on lines 4..14
lib/facter/facts/windows/os/windows/installation_type.rb on lines 4..14
lib/facter/facts/windows/os/windows/product_name.rb on lines 4..14
lib/facter/facts/windows/os/windows/release_id.rb on lines 4..14
lib/facter/facts/windows/os/windows/system32.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 28.

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 Scope6
        FACT_NAME = 'networking.scope6'
        ALIASES = 'scope6'
Severity: Minor
Found in lib/facter/facts/linux/networking/scope6.rb and 2 other locations - About 20 mins to fix
lib/facter/facts/aix/networking/scope6.rb on lines 4..14
lib/facter/facts/windows/networking/scope6.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 28.

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

  module Linux
    module Memory
      module System
        class Used
          FACT_NAME = 'memory.system.used'
Severity: Minor
Found in lib/facter/facts/linux/memory/system/used.rb and 5 other locations - About 20 mins to fix
lib/facter/facts/freebsd/memory/swap/used.rb on lines 4..14
lib/facter/facts/freebsd/memory/system/used.rb on lines 4..14
lib/facter/facts/linux/memory/swap/used.rb on lines 4..13
lib/facter/facts/macosx/memory/swap/used.rb on lines 4..14
lib/facter/facts/macosx/memory/system/used.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 27.

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

      elsif @@message_callback && Options[:allow_external_loggers]
        @@message_callback.call(:info, msg)
      else
        msg = colorize(msg, GREEN) if Options[:color]
        @@logger.info("#{@class_name} - #{msg}")
Severity: Minor
Found in lib/facter/framework/logging/logger.rb and 2 other locations - About 20 mins to fix
lib/facter/framework/logging/logger.rb on lines 107..112
lib/facter/framework/logging/logger.rb on lines 137..142

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

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

      if @@message_callback && Options[:allow_external_loggers]
        @@message_callback.call(:warn, msg)
      else
        msg = colorize(msg, YELLOW) if Options[:color]
        @@logger.warn("#{@class_name} - #{msg}")
Severity: Minor
Found in lib/facter/framework/logging/logger.rb and 2 other locations - About 20 mins to fix
lib/facter/framework/logging/logger.rb on lines 107..112
lib/facter/framework/logging/logger.rb on lines 128..132

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

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

  module Linux
    module Memory
      module Swap
        class Used
          FACT_NAME = 'memory.swap.used'
Severity: Minor
Found in lib/facter/facts/linux/memory/swap/used.rb and 5 other locations - About 20 mins to fix
lib/facter/facts/freebsd/memory/swap/used.rb on lines 4..14
lib/facter/facts/freebsd/memory/system/used.rb on lines 4..14
lib/facter/facts/linux/memory/system/used.rb on lines 4..13
lib/facter/facts/macosx/memory/swap/used.rb on lines 4..14
lib/facter/facts/macosx/memory/system/used.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 27.

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

  module Freebsd
    module Memory
      module System
        class Used
          FACT_NAME = 'memory.system.used'
Severity: Minor
Found in lib/facter/facts/freebsd/memory/system/used.rb and 5 other locations - About 20 mins to fix
lib/facter/facts/freebsd/memory/swap/used.rb on lines 4..14
lib/facter/facts/linux/memory/swap/used.rb on lines 4..13
lib/facter/facts/linux/memory/system/used.rb on lines 4..13
lib/facter/facts/macosx/memory/swap/used.rb on lines 4..14
lib/facter/facts/macosx/memory/system/used.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 27.

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 Hypervisors
      class SystemdNspawn
        FACT_NAME = 'hypervisors.systemd_nspawn'

Severity: Minor
Found in lib/facter/facts/linux/hypervisors/systemd_nspawn.rb and 2 other locations - About 20 mins to fix
lib/facter/facts/linux/hypervisors/docker.rb on lines 4..16
lib/facter/facts/linux/hypervisors/lxc.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 27.

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

  module Macosx
    module Memory
      module Swap
        class Used
          FACT_NAME = 'memory.swap.used'
Severity: Minor
Found in lib/facter/facts/macosx/memory/swap/used.rb and 5 other locations - About 20 mins to fix
lib/facter/facts/freebsd/memory/swap/used.rb on lines 4..14
lib/facter/facts/freebsd/memory/system/used.rb on lines 4..14
lib/facter/facts/linux/memory/swap/used.rb on lines 4..13
lib/facter/facts/linux/memory/system/used.rb on lines 4..13
lib/facter/facts/macosx/memory/system/used.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 27.

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 Hypervisors
      class Docker
        FACT_NAME = 'hypervisors.docker'

Severity: Minor
Found in lib/facter/facts/linux/hypervisors/docker.rb and 2 other locations - About 20 mins to fix
lib/facter/facts/linux/hypervisors/lxc.rb on lines 4..16
lib/facter/facts/linux/hypervisors/systemd_nspawn.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 27.

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

      if @@message_callback && Options[:allow_external_loggers]
        @@message_callback.call(:debug, msg)
      else
        msg = colorize(msg, CYAN) if Options[:color]
        @@logger.debug("#{@class_name} - #{msg}")
Severity: Minor
Found in lib/facter/framework/logging/logger.rb and 2 other locations - About 20 mins to fix
lib/facter/framework/logging/logger.rb on lines 128..132
lib/facter/framework/logging/logger.rb on lines 137..142

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

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

  module Freebsd
    module Memory
      module Swap
        class Used
          FACT_NAME = 'memory.swap.used'
Severity: Minor
Found in lib/facter/facts/freebsd/memory/swap/used.rb and 5 other locations - About 20 mins to fix
lib/facter/facts/freebsd/memory/system/used.rb on lines 4..14
lib/facter/facts/linux/memory/swap/used.rb on lines 4..13
lib/facter/facts/linux/memory/system/used.rb on lines 4..13
lib/facter/facts/macosx/memory/swap/used.rb on lines 4..14
lib/facter/facts/macosx/memory/system/used.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 27.

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 Hypervisors
      class Lxc
        FACT_NAME = 'hypervisors.lxc'

Severity: Minor
Found in lib/facter/facts/linux/hypervisors/lxc.rb and 2 other locations - About 20 mins to fix
lib/facter/facts/linux/hypervisors/docker.rb on lines 4..16
lib/facter/facts/linux/hypervisors/systemd_nspawn.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 27.

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

  module Macosx
    module Memory
      module System
        class Used
          FACT_NAME = 'memory.system.used'
Severity: Minor
Found in lib/facter/facts/macosx/memory/system/used.rb and 5 other locations - About 20 mins to fix
lib/facter/facts/freebsd/memory/swap/used.rb on lines 4..14
lib/facter/facts/freebsd/memory/system/used.rb on lines 4..14
lib/facter/facts/linux/memory/swap/used.rb on lines 4..13
lib/facter/facts/linux/memory/system/used.rb on lines 4..13
lib/facter/facts/macosx/memory/swap/used.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 27.

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 Aix
    module Memory
      module Swap
        class UsedBytes
          FACT_NAME = 'memory.swap.used_bytes'
Severity: Major
Found in lib/facter/facts/aix/memory/swap/used_bytes.rb and 7 other locations - About 15 mins to fix
lib/facter/facts/aix/memory/swap/capacity.rb on lines 4..14
lib/facter/facts/aix/memory/system/capacity.rb on lines 4..14
lib/facter/facts/aix/memory/system/used_bytes.rb on lines 4..13
lib/facter/facts/solaris/memory/swap/capacity.rb on lines 4..14
lib/facter/facts/solaris/memory/swap/used_bytes.rb on lines 4..13
lib/facter/facts/solaris/memory/system/capacity.rb on lines 4..14
lib/facter/facts/solaris/memory/system/used_bytes.rb on lines 4..13

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

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 Solaris
    module Memory
      module System
        class UsedBytes
          FACT_NAME = 'memory.system.used_bytes'
Severity: Major
Found in lib/facter/facts/solaris/memory/system/used_bytes.rb and 7 other locations - About 15 mins to fix
lib/facter/facts/aix/memory/swap/capacity.rb on lines 4..14
lib/facter/facts/aix/memory/swap/used_bytes.rb on lines 4..13
lib/facter/facts/aix/memory/system/capacity.rb on lines 4..14
lib/facter/facts/aix/memory/system/used_bytes.rb on lines 4..13
lib/facter/facts/solaris/memory/swap/capacity.rb on lines 4..14
lib/facter/facts/solaris/memory/swap/used_bytes.rb on lines 4..13
lib/facter/facts/solaris/memory/system/capacity.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 26.

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 Solaris
    module Memory
      module Swap
        class Capacity
          FACT_NAME = 'memory.swap.capacity'
Severity: Major
Found in lib/facter/facts/solaris/memory/swap/capacity.rb and 7 other locations - About 15 mins to fix
lib/facter/facts/aix/memory/swap/capacity.rb on lines 4..14
lib/facter/facts/aix/memory/swap/used_bytes.rb on lines 4..13
lib/facter/facts/aix/memory/system/capacity.rb on lines 4..14
lib/facter/facts/aix/memory/system/used_bytes.rb on lines 4..13
lib/facter/facts/solaris/memory/swap/used_bytes.rb on lines 4..13
lib/facter/facts/solaris/memory/system/capacity.rb on lines 4..14
lib/facter/facts/solaris/memory/system/used_bytes.rb on lines 4..13

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

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 Solaris
    module Memory
      module Swap
        class UsedBytes
          FACT_NAME = 'memory.swap.used_bytes'
Severity: Major
Found in lib/facter/facts/solaris/memory/swap/used_bytes.rb and 7 other locations - About 15 mins to fix
lib/facter/facts/aix/memory/swap/capacity.rb on lines 4..14
lib/facter/facts/aix/memory/swap/used_bytes.rb on lines 4..13
lib/facter/facts/aix/memory/system/capacity.rb on lines 4..14
lib/facter/facts/aix/memory/system/used_bytes.rb on lines 4..13
lib/facter/facts/solaris/memory/swap/capacity.rb on lines 4..14
lib/facter/facts/solaris/memory/system/capacity.rb on lines 4..14
lib/facter/facts/solaris/memory/system/used_bytes.rb on lines 4..13

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

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