puppetlabs/facter

View on GitHub

Showing 386 of 386 total issues

Method get_fact_group has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get_fact_group(fact_name)
      fact = get_fact(fact_name)
      return fact[:group] if fact

      # @groups.detect { |k, v| break k if Array(v).find { |f| fact_name =~ /^#{f}.*/ } }
Severity: Minor
Found in lib/facter/framework/config/fact_groups.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method write_cache has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def write_cache
      unless File.directory?(@cache_dir)
        require 'fileutils'
        FileUtils.mkdir_p(@cache_dir)
      end
Severity: Minor
Found in lib/facter/framework/core/cache_manager.rb - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  module Linux
    module SystemUptime
      class Hours
        FACT_NAME = 'system_uptime.hours'
        ALIASES = 'uptime_hours'
Severity: Major
Found in lib/facter/facts/linux/system_uptime/hours.rb and 3 other locations - About 55 mins to fix
lib/facter/facts/linux/system_uptime/days.rb on lines 4..19
lib/facter/facts/linux/system_uptime/seconds.rb on lines 4..19
lib/facter/facts/linux/system_uptime/uptime.rb on lines 4..19

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

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

  module Linux
    module SystemUptime
      class Seconds
        FACT_NAME = 'system_uptime.seconds'
        ALIASES = 'uptime_seconds'
Severity: Major
Found in lib/facter/facts/linux/system_uptime/seconds.rb and 3 other locations - About 55 mins to fix
lib/facter/facts/linux/system_uptime/days.rb on lines 4..19
lib/facter/facts/linux/system_uptime/hours.rb on lines 4..19
lib/facter/facts/linux/system_uptime/uptime.rb on lines 4..19

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Freebsd
    class Mountpoints
      FACT_NAME = 'mountpoints'

      def call_the_resolver
Severity: Minor
Found in lib/facter/facts/freebsd/mountpoints.rb and 1 other location - About 55 mins to fix
lib/facter/facts/linux/mountpoints.rb on lines 4..17

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

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

  module Linux
    module SystemUptime
      class Days
        FACT_NAME = 'system_uptime.days'
        ALIASES = 'uptime_days'
Severity: Major
Found in lib/facter/facts/linux/system_uptime/days.rb and 3 other locations - About 55 mins to fix
lib/facter/facts/linux/system_uptime/hours.rb on lines 4..19
lib/facter/facts/linux/system_uptime/seconds.rb on lines 4..19
lib/facter/facts/linux/system_uptime/uptime.rb on lines 4..19

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

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

  module Linux
    module SystemUptime
      class Uptime
        FACT_NAME = 'system_uptime.uptime'
        ALIASES = 'uptime'
Severity: Major
Found in lib/facter/facts/linux/system_uptime/uptime.rb and 3 other locations - About 55 mins to fix
lib/facter/facts/linux/system_uptime/days.rb on lines 4..19
lib/facter/facts/linux/system_uptime/hours.rb on lines 4..19
lib/facter/facts/linux/system_uptime/seconds.rb on lines 4..19

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Linux
    class Mountpoints
      FACT_NAME = 'mountpoints'

      def call_the_resolver
Severity: Minor
Found in lib/facter/facts/linux/mountpoints.rb and 1 other location - About 55 mins to fix
lib/facter/facts/freebsd/mountpoints.rb on lines 4..17

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

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 Solaris
    module Dmi
      module Product
        class Uuid
          FACT_NAME = 'dmi.product.uuid'
Severity: Major
Found in lib/facter/facts/solaris/dmi/product/uuid.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/solaris/dmi/bios/release_date.rb on lines 4..18
lib/facter/facts/solaris/dmi/bios/vendor.rb on lines 4..18
lib/facter/facts/solaris/dmi/bios/version.rb on lines 4..18
lib/facter/facts/solaris/dmi/chassis/asset_tag.rb on lines 4..18
lib/facter/facts/solaris/dmi/chassis/type.rb on lines 4..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Solaris
    module Dmi
      module Chassis
        class Type
          FACT_NAME = 'dmi.chassis.type'
Severity: Major
Found in lib/facter/facts/solaris/dmi/chassis/type.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/solaris/dmi/bios/release_date.rb on lines 4..18
lib/facter/facts/solaris/dmi/bios/vendor.rb on lines 4..18
lib/facter/facts/solaris/dmi/bios/version.rb on lines 4..18
lib/facter/facts/solaris/dmi/chassis/asset_tag.rb on lines 4..18
lib/facter/facts/solaris/dmi/product/uuid.rb on lines 4..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Solaris
    module Dmi
      module Bios
        class ReleaseDate
          FACT_NAME = 'dmi.bios.release_date'
Severity: Major
Found in lib/facter/facts/solaris/dmi/bios/release_date.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/solaris/dmi/bios/vendor.rb on lines 4..18
lib/facter/facts/solaris/dmi/bios/version.rb on lines 4..18
lib/facter/facts/solaris/dmi/chassis/asset_tag.rb on lines 4..18
lib/facter/facts/solaris/dmi/chassis/type.rb on lines 4..18
lib/facter/facts/solaris/dmi/product/uuid.rb on lines 4..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Solaris
    class SshfpAlgorithm
      FACT_NAME = 'sshfp_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facter/facts/solaris/sshfp_algorithm.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/aix/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/freebsd/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/linux/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/macosx/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/openbsd/sshfp_algorithm.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 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Linux
    class SshfpAlgorithm
      FACT_NAME = 'sshfp_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facter/facts/linux/sshfp_algorithm.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/aix/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/freebsd/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/macosx/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/openbsd/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/solaris/sshfp_algorithm.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 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Aix
    class SshfpAlgorithm
      FACT_NAME = 'sshfp_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facter/facts/aix/sshfp_algorithm.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/freebsd/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/linux/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/macosx/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/openbsd/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/solaris/sshfp_algorithm.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 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Freebsd
    class SshfpAlgorithm
      FACT_NAME = 'sshfp_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facter/facts/freebsd/sshfp_algorithm.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/aix/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/linux/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/macosx/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/openbsd/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/solaris/sshfp_algorithm.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 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Solaris
    module Dmi
      module Bios
        class Vendor
          FACT_NAME = 'dmi.bios.vendor'
Severity: Major
Found in lib/facter/facts/solaris/dmi/bios/vendor.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/solaris/dmi/bios/release_date.rb on lines 4..18
lib/facter/facts/solaris/dmi/bios/version.rb on lines 4..18
lib/facter/facts/solaris/dmi/chassis/asset_tag.rb on lines 4..18
lib/facter/facts/solaris/dmi/chassis/type.rb on lines 4..18
lib/facter/facts/solaris/dmi/product/uuid.rb on lines 4..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Ubuntu
    module Os
      class Release
        FACT_NAME = 'os.release'
        ALIASES = %w[operatingsystemmajrelease operatingsystemrelease].freeze
Severity: Minor
Found in lib/facter/facts/ubuntu/os/release.rb and 1 other location - About 50 mins to fix
lib/facter/facts/linux/os/release.rb on lines 4..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Openbsd
    class SshfpAlgorithm
      FACT_NAME = 'sshfp_.*'
      TYPE = :legacy

Severity: Major
Found in lib/facter/facts/openbsd/sshfp_algorithm.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/aix/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/freebsd/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/linux/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/macosx/sshfp_algorithm.rb on lines 4..16
lib/facter/facts/solaris/sshfp_algorithm.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 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Solaris
    module Dmi
      module Chassis
        class AssetTag
          FACT_NAME = 'dmi.chassis.asset_tag'
Severity: Major
Found in lib/facter/facts/solaris/dmi/chassis/asset_tag.rb and 5 other locations - About 50 mins to fix
lib/facter/facts/solaris/dmi/bios/release_date.rb on lines 4..18
lib/facter/facts/solaris/dmi/bios/vendor.rb on lines 4..18
lib/facter/facts/solaris/dmi/bios/version.rb on lines 4..18
lib/facter/facts/solaris/dmi/chassis/type.rb on lines 4..18
lib/facter/facts/solaris/dmi/product/uuid.rb on lines 4..18

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Linux
    module Os
      class Release
        FACT_NAME = 'os.release'
        ALIASES = %w[operatingsystemmajrelease operatingsystemrelease].freeze
Severity: Minor
Found in lib/facter/facts/linux/os/release.rb and 1 other location - About 50 mins to fix
lib/facter/facts/ubuntu/os/release.rb on lines 4..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language