lib/puma/minissl.rb

Summary

Maintainability
B
6 hrs
Test Coverage

File minissl.rb has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

begin
  require 'io/wait' unless Puma::HAS_NATIVE_IO_WAIT
rescue LoadError
end

Severity: Minor
Found in lib/puma/minissl.rb - About 3 hrs to fix

    Method read_nonblock has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

          def read_nonblock(size, *_)
            # *_ is to deal with keyword args that were added
            # at some point (and being used in the wild)
            while true
              output = engine_read_all
    Severity: Minor
    Found in lib/puma/minissl.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 write has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

          def write(data)
            return 0 if data.empty?
    
            data_size = data.bytesize
            need = data_size
    Severity: Minor
    Found in lib/puma/minissl.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 readpartial has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def readpartial(size)
            while true
              output = @engine.read
              return output if output
    
    
    Severity: Minor
    Found in lib/puma/minissl.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

    There are no issues that match your filters.

    Category
    Status