infopark/ntswf

View on GitHub

Showing 5 of 5 total issues

Method failure_details has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def failure_details(workflow_execution)
      terminal_event = workflow_execution.history_events.reverse_order.detect {|e|
        TERMINAL_EVENT_TYPES_ON_FAILURE.include?(e.event_type)
      }
      if terminal_event
Severity: Minor
Found in lib/ntswf/client.rb - About 1 hr to fix

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

        def parse_attribute(event, key)
          value = nil
          begin
            json_value = event.attributes[key]
          rescue ArgumentError
    Severity: Minor
    Found in lib/ntswf/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

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

        def failure_details(workflow_execution)
          terminal_event = workflow_execution.history_events.reverse_order.detect {|e|
            TERMINAL_EVENT_TYPES_ON_FAILURE.include?(e.event_type)
          }
          if terminal_event
    Severity: Minor
    Found in lib/ntswf/client.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 process_returned_hash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def process_returned_hash(activity_task, returned_hash)
          return unless returned_hash.kind_of? Hash
          kind, value = returned_hash.detect { |k, v| KNOWN_RETURN_KEYS.include? k }
          case kind
          when :error
    Severity: Minor
    Found in lib/ntswf/activity_worker.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 isolation_id has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def isolation_id
          file = @config.isolation_file || @config.task_list_suffix_file
          return "" unless file
          File.write(file, SecureRandom.hex(9)) unless File.exist?(file)
          @isolation_id ||= File.read(file)
    Severity: Minor
    Found in lib/ntswf/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

    Severity
    Category
    Status
    Source
    Language