actionpack/lib/action_dispatch/http/request.rb

Summary

Maintainability
C
1 day
Test Coverage

Class Request has 57 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Request
    include Rack::Request::Helpers
    include ActionDispatch::Http::Cache::Request
    include ActionDispatch::Http::MimeNegotiation
    include ActionDispatch::Http::Parameters
Severity: Major
Found in actionpack/lib/action_dispatch/http/request.rb - About 1 day to fix

    File request.rb has 303 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "stringio"
    
    require "active_support/inflector"
    require "action_dispatch/http/headers"
    require "action_controller/metal/exceptions"
    Severity: Minor
    Found in actionpack/lib/action_dispatch/http/request.rb - About 3 hrs to fix

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

          def controller_class_for(name)
            if name
              controller_param = name.underscore
              const_name = controller_param.camelize << "Controller"
              begin
      Severity: Minor
      Found in actionpack/lib/action_dispatch/http/request.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

      There are no issues that match your filters.

      Category
      Status