puppetlabs/facter-ng

View on GitHub

Showing 135 of 200 total issues

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

  module Windows
    class NetmaskInterfaces
      FACT_NAME = 'netmask_.*'
      TYPE = :legacy

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

  module Windows
    class Network6Interfaces
      FACT_NAME = 'network6_.*'
      TYPE = :legacy

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

  def create_fact_file(fact_path, fact_name, operating_system)
    fact_tokens = fact_name.split('.')
    fact_file_name = fact_tokens.reverse.first + '.rb'
    fact_file_with_path = File.join(fact_path, fact_file_name)

Severity: Minor
Found in tasks/fact_generator/fact_creator.rb and 1 other location - About 40 mins to fix
tasks/fact_generator/fact_creator.rb on lines 74..83

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

  module Linux
    class IpaddressInterfaces
      FACT_NAME = 'ipaddress_.*'
      TYPE = :legacy

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

  module Linux
    class Ipaddress6Interfaces
      FACT_NAME = 'ipaddress6_.*'
      TYPE = :legacy

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

  module Windows
    class Ipaddress6Interfaces
      FACT_NAME = 'ipaddress6_.*'
      TYPE = :legacy

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

  module Linux
    class NetmaskInterfaces
      FACT_NAME = 'netmask_.*'
      TYPE = :legacy

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

  module Linux
    class NetworkInterfaces
      FACT_NAME = 'network_.*'
      TYPE = :legacy

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

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

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

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

Refactorings

Further Reading

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

  def create_spec_from_template(fact_name, operating_system)
    delimiters = ['.', '_']
    fact_tokens = fact_name.split(Regexp.union(delimiters))
    template = ERB.new(File.read(File.join(ROOT_DIR, 'tasks', 'fact_generator', 'fact_spec.erb')))

Severity: Minor
Found in tasks/fact_generator/fact_creator.rb and 1 other location - About 35 mins to fix
tasks/fact_generator/fact_creator.rb on lines 86..93

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  module Linux
    module Networking
      class Dhcp
        FACT_NAME = 'networking.dhcp'

Severity: Minor
Found in lib/facts/linux/networking/dhcp.rb and 2 other locations - About 35 mins to fix
lib/facts/linux/networking/mtu.rb on lines 4..15
lib/facts/linux/networking/scope6.rb on lines 4..15

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  module Linux
    module Networking
      class Mtu
        FACT_NAME = 'networking.mtu'

Severity: Minor
Found in lib/facts/linux/networking/mtu.rb and 2 other locations - About 35 mins to fix
lib/facts/linux/networking/dhcp.rb on lines 4..15
lib/facts/linux/networking/scope6.rb on lines 4..15

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  def create_fact_from_template(fact_name, operating_system)
    delimiters = ['.', '_']
    fact_tokens = fact_name.split(Regexp.union(delimiters))
    template = ERB.new(File.read(File.join(ROOT_DIR, 'tasks', 'fact_generator', 'fact.erb')))

Severity: Minor
Found in tasks/fact_generator/fact_creator.rb and 1 other location - About 35 mins to fix
tasks/fact_generator/fact_creator.rb on lines 96..103

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  module Linux
    module Networking
      class Scope6
        FACT_NAME = 'networking.scope6'

Severity: Minor
Found in lib/facts/linux/networking/scope6.rb and 2 other locations - About 35 mins to fix
lib/facts/linux/networking/dhcp.rb on lines 4..15
lib/facts/linux/networking/mtu.rb on lines 4..15

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language