cloudfoundry/cloud_controller_ng

View on GitHub
lib/cloud_controller/rest_controller/paginated_collection_renderer.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method url has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def url(controller, path, page, page_size, order_direction, opts, request_params)
Severity: Major
Found in lib/cloud_controller/rest_controller/paginated_collection_renderer.rb - About 50 mins to fix

    Method url has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def url(controller, path, page, page_size, order_direction, opts, request_params)
          params = {
            'page' => page,
            'results-per-page' => page_size,
            'order-direction' => order_direction
    Severity: Minor
    Found in lib/cloud_controller/rest_controller/paginated_collection_renderer.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 render_json has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def render_json(controller, dataset, path, opts, request_params)
          page = opts[:page] || 1
          order_applicator = OrderApplicator.new(opts)
          order_direction = opts[:order_direction] || 'asc'
          page_size = opts[:results_per_page] || @default_results_per_page
    Severity: Minor
    Found in lib/cloud_controller/rest_controller/paginated_collection_renderer.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 fetch_and_process_records has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def fetch_and_process_records(paginated_dataset, controller, inline_relations_depth, orphans, opts)
    Severity: Minor
    Found in lib/cloud_controller/rest_controller/paginated_collection_renderer.rb - About 35 mins to fix

      Method render_json has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def render_json(controller, dataset, path, opts, request_params)
      Severity: Minor
      Found in lib/cloud_controller/rest_controller/paginated_collection_renderer.rb - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status