SUSE/machinery

View on GitHub

Showing 187 of 267 total issues

Method as_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def as_json
      object = {}

      object["_attributes"] = @attributes unless @attributes.empty?
      object["_elements"] = @elements.map do |element|
Severity: Minor
Found in lib/array.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

Method render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def render(system_description, options = {})
        @options = options
        @buffer = ""
        @indent = 2
        @stack = []
Severity: Minor
Found in lib/renderer.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

Method render_comparison has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def render_comparison(comparison, options = {})
        @options = options
        @buffer = ""
        @indent = 0
        @stack = []
Severity: Minor
Found in lib/renderer.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

Method has_file? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def has_file?(name)
    EXTRACTABLE_SCOPES.each do |scope|
      if scope_extracted?(scope)
        return true if self[scope] && self[scope].has_file?(name)
      end
Severity: Minor
Found in lib/system_description.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

Method compare_with has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def compare_with(other)
      only_self = self.class.new(self.elements - other.elements)
      only_other = self.class.new(other.elements - self.elements)
      common = self.class.new(self.elements & other.elements)

Severity: Minor
Found in lib/array.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

Method apply_custom_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def apply_custom_config(file)
    content = read_config_file(file) || []

    content.each do |key, value|
      next if deprecated?(key)
Severity: Minor
Found in lib/config_base.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

Method load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def load(name, store, options = {})
      manifest = Machinery::Manifest.load(name, store.manifest_path(name))
      manifest.validate unless options[:skip_validation]

      description = from_hash(name, store, manifest.to_hash)
Severity: Minor
Found in lib/system_description.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

Severity
Category
Status
Source
Language