biemond/biemond-wildfly

View on GitHub

Showing 5 of 218 total issues

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

  def restart
    command = resource[:reload] ? ':reload' : ':shutdown(restart=true)'

    debug "Executing: #{command}"

Severity: Minor
Found in lib/puppet/provider/wildfly_restart/http_api.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 _deep_intersect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def _deep_intersect(current_state, desired_state)
        diff = {}

        current_state.each do |key, value|
          next unless desired_state.is_a? Hash and desired_state.keys.include? key
Severity: Minor
Found in lib/puppet_x/wildfly/deep_hash.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 should_execute? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def should_execute?
    unless_eval = true
    onlyif_eval = false

    unless @resource[:unless].nil?
Severity: Minor
Found in lib/puppet/provider/wildfly_cli/http_api.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

Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def initialize(address, port, user, password, timeout, secure)
Severity: Minor
Found in lib/puppet_x/wildfly/api_client.rb - About 45 mins to fix

    Method authz_header has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def authz_header
            digest_auth = Net::HTTP::DigestAuth.new
            authz_request = Net::HTTP::Get.new @uri.request_uri
    
            retried = 0
    Severity: Minor
    Found in lib/puppet_x/wildfly/api_client.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

    Severity
    Category
    Status
    Source
    Language