jannishuebl/orchparty

View on GitHub

Showing 6 of 20 total issues

File dsl_parser_kubernetes.rb has 291 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'pathname'
require 'securerandom'
module Orchparty
  module Kubernetes
    class DSLParser
Severity: Minor
Found in lib/orchparty/dsl_parser_kubernetes.rb - About 3 hrs to fix

    Method method_missing has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def method_missing(_, *values, &block)
          if block_given?
            value = HashBuilder.build(block)
            if values.count == 1
              @hash ||= AST.hash
    Severity: Minor
    Found in lib/orchparty/dsl_parser.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 transform_hash has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.transform_hash(original, options={}, &block)
        original.inject({}){|result, (key,value)|
          value = if (options[:deep] && Hash === value)
                    transform_hash(value, options, &block)
                  else
    Severity: Minor
    Found in lib/hash.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 method_missing has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

          def method_missing(_, *values, &block)
            if block_given?
              value = HashBuilder.build(block)
              if values.count == 1
                @hash ||= AST.hash
    Severity: Minor
    Found in lib/orchparty/dsl_parser_kubernetes.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 resolve has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

          def resolve(application, subject, service)
            subject.deep_transform_values! do |v|
              if v.respond_to?(:call)
                eval_value(build_context(application: application, service: service), v) 
              elsif v.is_a? Array
    Severity: Minor
    Found in lib/orchparty/transformations/variable.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 _recursive_merge_concat has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def _recursive_merge_concat(hash, other_hash, &block)
            other_hash.each do |k, v|
              hash[k] = if hash.key?(k) && hash[k].is_a?(::Hash) && v.is_a?(::Hash)
                          _recursive_merge(hash[k], v, &block)
                        elsif hash.key?(k) && hash[k].is_a?(::Array) && v.is_a?(::Array)
    Severity: Minor
    Found in lib/deep_merge.rb - About 45 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