puppetlabs/facter

View on GitHub
lib/facter/framework/core/options/config_file_options.rb

Summary

Maintainability
A
3 hrs
Test Coverage
A
90%

Method augment_cli has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def augment_cli(file_cli_conf)
        return unless file_cli_conf

        @options[:debug] = file_cli_conf['debug'] unless file_cli_conf['debug'].nil?
        @options[:trace] = file_cli_conf['trace'] unless file_cli_conf['trace'].nil?
Severity: Minor
Found in lib/facter/framework/core/options/config_file_options.rb - About 1 hr 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 augment_custom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def augment_custom(file_global_conf)
        return unless file_global_conf

        if Options.cli? && !file_global_conf['no-custom-facts'].nil?
          @options[:no_custom_facts] = file_global_conf['no-custom-facts']
Severity: Minor
Found in lib/facter/framework/core/options/config_file_options.rb - About 35 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 augment_external has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def augment_external(global_conf)
        return unless global_conf

        if Options.cli? && !global_conf['no-external-facts'].nil?
          @options[:no_external_facts] = global_conf['no-external-facts']
Severity: Minor
Found in lib/facter/framework/core/options/config_file_options.rb - About 35 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 augment_facts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def augment_facts(ttls, groups)
        fact_groups = Facter::FactGroups.new

        @options[:blocked_facts] = fact_groups.blocked_facts unless fact_groups.blocked_facts.nil?
        @options[:block_list] = fact_groups.block_list
Severity: Minor
Found in lib/facter/framework/core/options/config_file_options.rb - About 35 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 augment_ruby has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def augment_ruby(global_conf)
        return unless global_conf
        return unless Options.cli?

        @options[:no_ruby] = global_conf['no-ruby'].nil? ? false : global_conf['no-ruby']
Severity: Minor
Found in lib/facter/framework/core/options/config_file_options.rb - About 25 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

There are no issues that match your filters.

Category
Status