benchmarks/local/response_time_wrk.rb

Summary

Maintainability
C
1 day
Test Coverage

Method run has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def run
      time_start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      super
      # default values
      @duration ||= 10
Severity: Minor
Found in benchmarks/local/response_time_wrk.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 run has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def run
      time_start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      super
      # default values
      @duration ||= 10
Severity: Minor
Found in benchmarks/local/response_time_wrk.rb - About 1 hr to fix

    Method ci_test_rps has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def ci_test_rps
          host = ENV['HOST']
          port = ENV['PORT'].to_i
    
          str = 'a' * 65_500
    Severity: Minor
    Found in benchmarks/local/response_time_wrk.rb - About 1 hr to fix

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

          def run_summaries(summaries)
            digits = [4 - Math.log10(@max_100_time).to_i, 3].min
      
            fmt_vals = +'%-6s %6d'
            fmt_vals << (digits < 0 ? "  %6d" : "  %6.#{digits}f")*5
      Severity: Minor
      Found in benchmarks/local/response_time_wrk.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 ci_test_rps has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def ci_test_rps
            host = ENV['HOST']
            port = ENV['PORT'].to_i
      
            str = 'a' * 65_500
      Severity: Minor
      Found in benchmarks/local/response_time_wrk.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

      There are no issues that match your filters.

      Category
      Status