cotag/spider-gazelle

View on GitHub
lib/spider-gazelle/signaller.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Method become_sg_master has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def become_sg_master
            @is_master = true
            @is_client = false
            @is_connected = true

Severity: Minor
Found in lib/spider-gazelle/signaller.rb - About 1 hr to fix

    Method connect_to_sg_master has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def connect_to_sg_master
                @pipe = @thread.pipe :ipc
                @pipe.connect(SIGNAL_SERVER) do |client|
                    @is_client = true
                    @is_connected = true
    Severity: Minor
    Found in lib/spider-gazelle/signaller.rb - About 1 hr to fix

      Method become_sg_master has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

              def become_sg_master
                  @is_master = true
                  @is_client = false
                  @is_connected = true
      
      
      Severity: Minor
      Found in lib/spider-gazelle/signaller.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 process_request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              def process_request(data, client)
                  validated = @validated.include?(client)
                  parser = @validating[client.object_id]
      
                  if validated
      Severity: Minor
      Found in lib/spider-gazelle/signaller.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

      There are no issues that match your filters.

      Category
      Status