Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dpl936 json api - 2 #3990

Closed
wants to merge 45 commits into from
Closed

Dpl936 json api - 2 #3990

wants to merge 45 commits into from

Conversation

emrojo
Copy link
Contributor

@emrojo emrojo commented Dec 15, 2023

Closes #

Changes proposed in this pull request

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@@ -0,0 +1,7 @@
# frozen_string_literal: true
class ParentResource < JSONAPI::Resource
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ParentResource has no descriptive comment

@sanger sanger deleted a comment from codeclimate bot Jan 30, 2024
@sanger sanger deleted a comment from codeclimate bot Jan 30, 2024
@sanger sanger deleted a comment from codeclimate bot Jan 30, 2024
@sanger sanger deleted a comment from codeclimate bot Jan 30, 2024
@sanger sanger deleted a comment from codeclimate bot Jan 30, 2024
@sanger sanger deleted a comment from codeclimate bot Jan 30, 2024
@sanger sanger deleted a comment from codeclimate bot Jan 30, 2024
end

# https://jsonapi.org/format/#document-resource-object-linkage
def relationship_exists?(name, hash)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method relationship_exists? has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.

@@ -39,49 +39,59 @@ def self.inclusions
@default_includes || [].freeze
end

# Extends the default behaviour to add our default inclusions if provided
def self.apply_includes(records, options = {})
# TODO: Explain preloading and why we used it here.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO found

module Concerns
module DefaultIncludesParser
def parse_include_directives(resource_klass, raw_include)
if resource_klass.respond_to?(:format_default_includes)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Api::V2::Concerns::DefaultIncludesParser#parse_include_directives refers to 'resource_klass' more than self (maybe move it to another class?)

module Concerns
module DefaultIncludesParser
def parse_include_directives(resource_klass, raw_include)
if resource_klass.respond_to?(:format_default_includes)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Api::V2::Concerns::DefaultIncludesParser#parse_include_directives manually dispatches method call

@@ -0,0 +1,16 @@
# frozen_string_literal: true
module Api
module V2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Api::V2 has the name 'V2'

Copy link

codeclimate bot commented Jan 31, 2024

Code Climate has analyzed commit 381c45d and detected 28 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 27
Bug Risk 1

The test coverage on the diff in this pull request is 97.9% (50% is the threshold).

This pull request will bring the total coverage in the repository to 86.8% (0.0% change).

View more on Code Climate.

@yoldas
Copy link
Member

yoldas commented Mar 7, 2024

Although these changes pass unit tests here, they fail the integration suite tests. They are also inconsistent and low performance when they work. Because we are using a frozen 9.0 version of the dependency from a fork now, I am closing this PR.

@yoldas yoldas closed this Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants