hansololai/postgraphile-polymorphic-relation-plugin

View on GitHub
src/add_forward_poly_association_plugin.ts

Summary

Maintainability
A
3 hrs
Test Coverage
A
100%

Function addForwardPolyAssociation has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const addForwardPolyAssociation = (builder: SchemaBuilder, option: Options) => {
  builder.hook('inflection', inflection => ({
    ...inflection,
    forwardRelationByPolymorphic(table: PgClass, polymorphicName: string) {
      return this.camelCase(`${this.singularize(table.name)}-as-${polymorphicName}`);
Severity: Major
Found in src/add_forward_poly_association_plugin.ts - About 2 hrs to fix

    Function forwardPolyRelationSpec has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          .reduce((memo, currentPoly) => {
            const { name } = currentPoly;
            const fieldsPerPolymorphicConstraint = currentPoly.to.reduce((acc, polyC) => {
              const { pgClass: foreignTable,
                name: mName,
    Severity: Minor
    Found in src/add_forward_poly_association_plugin.ts - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status