symbols-worldwide/symgate-gem

View on GitHub

Showing 5 of 5 total issues

Method copy_wordlist has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

      def copy_wordlist(src_uuid, dest_uuid: nil, context: nil, name: nil, readonly: nil,
                        src_group: nil, src_user: nil, dest_group: nil, dest_user: nil)
        response = savon_request(:copy_wordlist) do |soap|
          params = { srcwordlistuuid: src_uuid }
          params[:dstwordlistuuid] = dest_uuid unless dest_uuid.nil?
Severity: Minor
Found in lib/symgate/wordlist/client.rb - About 3 hrs 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 savon_request has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def savon_request(method, opts = {})
      attempts = 0

      begin
        attempts += 1
Severity: Minor
Found in lib/symgate/client.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 create_wordlist has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def create_wordlist(name, context, entries = [], readonly: false)
        tries ||= 3 # TODO: Find out if we still need to do this!

        Symgate::Wordlist::Info.from_soap(
          savon_request(:create_wordlist) do |soap|
Severity: Minor
Found in lib/symgate/wordlist/client.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 savon_array has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def self.savon_array(hash, key, classname = nil)
      if hash && hash.include?(key)
        [hash[key]].flatten
      else
        []
Severity: Minor
Found in lib/symgate/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 destroy_wordlist has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def destroy_wordlist(uuid)
        tries ||= 3 # TODO: Find out if we still need to do this!

        savon_request(:destroy_wordlist, returns_error_string: true) do |soap|
          soap.message(wordlistid: uuid)
Severity: Minor
Found in lib/symgate/wordlist/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

Severity
Category
Status
Source
Language