puppetlabs/facter

View on GitHub

Showing 386 of 386 total issues

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

  module Macosx
    module Os
      module Macosx
        class Product
          FACT_NAME = 'os.macosx.product'
Severity: Major
Found in lib/facter/facts/macosx/os/macosx/product.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/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 21 locations. Consider refactoring.
Open

  module Windows
    module Dmi
      module Product
        class SerialNumber
          FACT_NAME = 'dmi.product.serial_number'
Severity: Major
Found in lib/facter/facts/windows/dmi/product/serial_number.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/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 21 locations. Consider refactoring.
Open

  module Windows
    module Os
      module Windows
        class System32
          FACT_NAME = 'os.windows.system32'
Severity: Major
Found in lib/facter/facts/windows/os/windows/system32.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/release_id.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 Distro
        class Specification
          FACT_NAME = 'os.distro.specification'
Severity: Major
Found in lib/facter/facts/linux/os/distro/specification.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/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/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 21 locations. Consider refactoring.
Open

  module Linux
    module Os
      module Distro
        class Id
          FACT_NAME = 'os.distro.id'
Severity: Major
Found in lib/facter/facts/linux/os/distro/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/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/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 21 locations. Consider refactoring.
Open

  module Linux
    module Os
      module Selinux
        class Enabled
          FACT_NAME = 'os.selinux.enabled'
Severity: Major
Found in lib/facter/facts/linux/os/selinux/enabled.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/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/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 21 locations. Consider refactoring.
Open

  module Linux
    module Os
      module Distro
        class Description
          FACT_NAME = 'os.distro.description'
Severity: Major
Found in lib/facter/facts/linux/os/distro/description.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/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/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 21 locations. Consider refactoring.
Open

  module Windows
    module Dmi
      module Product
        class Uuid
          FACT_NAME = 'dmi.product.uuid'
Severity: Major
Found in lib/facter/facts/windows/dmi/product/uuid.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/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 21 locations. Consider refactoring.
Open

  module Windows
    module Dmi
      module Product
        class Name
          FACT_NAME = 'dmi.product.name'
Severity: Major
Found in lib/facter/facts/windows/dmi/product/name.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/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 21 locations. Consider refactoring.
Open

  module Linux
    module Os
      module Distro
        class Codename
          FACT_NAME = 'os.distro.codename'
Severity: Major
Found in lib/facter/facts/linux/os/distro/codename.rb and 20 other locations - About 20 mins to fix
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/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 21 locations. Consider refactoring.
Open

  module Linux
    module Os
      module Selinux
        class ConfigMode
          FACT_NAME = 'os.selinux.config_mode'
Severity: Major
Found in lib/facter/facts/linux/os/selinux/config_mode.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_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/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 Windows
    module Networking
      class Scope6
        FACT_NAME = 'networking.scope6'
        ALIASES = 'scope6'
Severity: Minor
Found in lib/facter/facts/windows/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/linux/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 EditionId
          FACT_NAME = 'os.windows.edition_id'
Severity: Major
Found in lib/facter/facts/windows/os/windows/edition_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/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 21 locations. Consider refactoring.
Open

  module Linux
    module Os
      module Selinux
        class CurrentMode
          FACT_NAME = 'os.selinux.current_mode'
Severity: Major
Found in lib/facter/facts/linux/os/selinux/current_mode.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/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/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 21 locations. Consider refactoring.
Open

  module Windows
    module Os
      module Windows
        class DisplayVersion
          FACT_NAME = 'os.windows.display_version'
Severity: Major
Found in lib/facter/facts/windows/os/windows/display_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/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/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 21 locations. Consider refactoring.
Open

  module Linux
    module Os
      module Selinux
        class Enforced
          FACT_NAME = 'os.selinux.enforced'
Severity: Major
Found in lib/facter/facts/linux/os/selinux/enforced.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/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/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 21 locations. Consider refactoring.
Open

  module Macosx
    module Os
      module Macosx
        class Build
          FACT_NAME = 'os.macosx.build'
Severity: Major
Found in lib/facter/facts/macosx/os/macosx/build.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/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 21 locations. Consider refactoring.
Open

  module Windows
    module Os
      module Windows
        class InstallationType
          FACT_NAME = 'os.windows.installation_type'
Severity: Major
Found in lib/facter/facts/windows/os/windows/installation_type.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/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 21 locations. Consider refactoring.
Open

  module Linux
    module Os
      module Selinux
        class ConfigPolicy
          FACT_NAME = 'os.selinux.config_policy'
Severity: Major
Found in lib/facter/facts/linux/os/selinux/config_policy.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/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/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 21 locations. Consider refactoring.
Open

  module Windows
    module Os
      module Windows
        class ProductName
          FACT_NAME = 'os.windows.product_name'
Severity: Major
Found in lib/facter/facts/windows/os/windows/product_name.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/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

Severity
Category
Status
Source
Language