wearefine/maximus

View on GitHub
lib/maximus/config.rb

Summary

Maintainability
B
5 hrs
Test Coverage

Method evaluate_settings has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def evaluate_settings(settings_data = @settings)
      settings_data.each do |key, value|
        next if value.is_a?(FalseClass)
        value = {} if value.is_a?(TrueClass)

Severity: Minor
Found in lib/maximus/config.rb - About 1 hr to fix

    Method evaluate_for_wraith has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def evaluate_for_wraith(value)
            @settings[:wraith] = {}
    
            if value.include?('browser')
              value['browser'].each do |browser, browser_value|
    Severity: Minor
    Found in lib/maximus/config.rb - About 1 hr to fix

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

            def evaluate_for_wraith(value)
              @settings[:wraith] = {}
      
              if value.include?('browser')
                value['browser'].each do |browser, browser_value|
      Severity: Minor
      Found in lib/maximus/config.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 initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def initialize(opts = {})
      
            # Strips from command line
            opts = opts.delete_if { |k, v| v.nil? }
      
      
      Severity: Minor
      Found in lib/maximus/config.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 evaluate_settings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def evaluate_settings(settings_data = @settings)
            settings_data.each do |key, value|
              next if value.is_a?(FalseClass)
              value = {} if value.is_a?(TrueClass)
      
      
      Severity: Minor
      Found in lib/maximus/config.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 load_config has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def load_config(value)
              return value unless value.is_a?(String)
      
              if value =~ /^http/
                begin open(value)
      Severity: Minor
      Found in lib/maximus/config.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 load_config_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def load_config_file(file_path, root)
      
              conf_location = if file_path.present? && File.exist?(file_path)
                file_path
              else
      Severity: Minor
      Found in lib/maximus/config.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