Glavin001/graphql-sequelize-crud

View on GitHub
src/OperationFactory.ts

Summary

Maintainability
F
1 wk
Test Coverage

File OperationFactory.ts has 570 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// tslint:disable-next-line:no-reference
/// <reference path="./@types/graphql-sequelize/index.d.ts" />

import {
    GraphQLObjectType,
Severity: Major
Found in src/OperationFactory.ts - About 1 day to fix

    Function updateRecords has 123 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public updateRecords({
            mutations,
            model,
            modelType,
        }: {
    Severity: Major
    Found in src/OperationFactory.ts - About 4 hrs to fix

      Function updateRecord has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public updateRecord({
              mutations,
              model,
              modelType,
          }: {
      Severity: Major
      Found in src/OperationFactory.ts - About 4 hrs to fix

        Function createRecord has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public createRecord({
                mutations,
                model,
                modelType,
            }: {
        Severity: Major
        Found in src/OperationFactory.ts - About 2 hrs to fix

          Function outputFields has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      outputFields: () => {
                          const output: GraphQLFieldConfigMap<any, any> = {};
                          // New Record
                          output[camelcase(`new_${getTableName(model)}`)] = {
                              type: modelType,
          Severity: Major
          Found in src/OperationFactory.ts - About 2 hrs to fix

            Function outputFields has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        outputFields: () => {
                            const output: GraphQLFieldConfigMap<any, any> = {};
                            // New Record
                            output[camelcase(`new_${getTableName(model)}`)] = {
                                type: modelType,
            Severity: Minor
            Found in src/OperationFactory.ts - About 2 hrs to fix

              Function deleteRecords has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public deleteRecords({
                      mutations,
                      model,
                      modelType,
                  }: {
              Severity: Minor
              Found in src/OperationFactory.ts - About 1 hr to fix

                Function outputFields has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            outputFields: () => {
                                const output: GraphQLFieldConfigMap<any, any> = {};
                                // New Record
                                output[camelcase(`new_${getTableName(model)}`)] = {
                                    type: modelType,
                Severity: Minor
                Found in src/OperationFactory.ts - About 1 hr to fix

                  Function deleteRecord has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public deleteRecord({
                          mutations,
                          model,
                          modelType,
                      }: {
                  Severity: Minor
                  Found in src/OperationFactory.ts - About 1 hr to fix

                    Function inputFields has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                inputFields: () => {
                                    const fields = attributeFields(model, {
                                        exclude: model.excludeFields ? model.excludeFields : [],
                                        commentToDescription: true,
                                        allowNull: true,
                    Severity: Minor
                    Found in src/OperationFactory.ts - About 1 hr to fix

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                                      _.each(associationsToModel[getTableName(model)], (association) => {
                                          const {
                                              from,
                                              type: atype,
                                              key: field
                      Severity: Major
                      Found in src/OperationFactory.ts and 1 other location - About 7 hrs to fix
                      src/OperationFactory.ts on lines 301..318

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 186.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                                      _.each(associationsToModel[getTableName(model)], (association) => {
                                          const {
                                              from,
                                              type: atype,
                                              key: field
                      Severity: Major
                      Found in src/OperationFactory.ts and 1 other location - About 7 hrs to fix
                      src/OperationFactory.ts on lines 448..465

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 186.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      _.each(associationsFromModel[getTableName(model)], (association) => {
                                          const {
                                              to,
                                              type: atype,
                                              foreignKey,
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 7 hrs to fix
                      src/OperationFactory.ts on lines 319..339
                      src/OperationFactory.ts on lines 466..486

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 176.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      _.each(associationsFromModel[getTableName(model)], (association) => {
                                          const {
                                              to,
                                              type: atype,
                                              foreignKey,
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 7 hrs to fix
                      src/OperationFactory.ts on lines 134..154
                      src/OperationFactory.ts on lines 466..486

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 176.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      _.each(associationsFromModel[getTableName(model)], (association) => {
                                          const {
                                              to,
                                              type: atype,
                                              foreignKey,
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 7 hrs to fix
                      src/OperationFactory.ts on lines 134..154
                      src/OperationFactory.ts on lines 319..339

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 176.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      output[camelcase(`new_${getTableName(model)}`)] = {
                                          type: modelType,
                                          description: `The new ${getTableName(model)}, if successfully created.`,
                                          // tslint:disable-next-line max-func-args
                                          resolve: (args: any, arg2: any, context: any, info: any) => {
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 4 hrs to fix
                      src/OperationFactory.ts on lines 100..110
                      src/OperationFactory.ts on lines 435..445

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 123.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      output[camelcase(`new_${getTableName(model)}`)] = {
                                          type: modelType,
                                          description: `The new ${getTableName(model)}, if successfully created.`,
                                          // tslint:disable-next-line max-func-args
                                          resolve: (args: any, arg2: any, context: any, info: any) => {
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 4 hrs to fix
                      src/OperationFactory.ts on lines 100..110
                      src/OperationFactory.ts on lines 288..298

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 123.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      output[camelcase(`new_${getTableName(model)}`)] = {
                                          type: modelType,
                                          description: `The new ${getTableName(model)}, if successfully created.`,
                                          // tslint:disable-next-line:max-func-args
                                          resolve: (args: any, arg2: any, context: any, info: any) => {
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 4 hrs to fix
                      src/OperationFactory.ts on lines 288..298
                      src/OperationFactory.ts on lines 435..445

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 123.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      const fields = attributeFields(model, {
                                          exclude: model.excludeFields ? model.excludeFields : [],
                                          commentToDescription: true,
                                          allowNull: true,
                                          cache
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 55 mins to fix
                      src/OperationFactory.ts on lines 250..255
                      src/OperationFactory.ts on lines 538..543

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 54.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      const fields = attributeFields(model, {
                                          exclude: model.excludeFields ? model.excludeFields : [],
                                          commentToDescription: true,
                                          allowNull: true,
                                          cache
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 55 mins to fix
                      src/OperationFactory.ts on lines 250..255
                      src/OperationFactory.ts on lines 407..412

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 54.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 3 locations. Consider refactoring.
                      Open

                                      const fields = attributeFields(model, {
                                          exclude: model.excludeFields ? model.excludeFields : [],
                                          commentToDescription: true,
                                          allowNull: true,
                                          cache
                      Severity: Major
                      Found in src/OperationFactory.ts and 2 other locations - About 55 mins to fix
                      src/OperationFactory.ts on lines 407..412
                      src/OperationFactory.ts on lines 538..543

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 54.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 7 locations. Consider refactoring.
                      Open

                          public updateRecord({
                              mutations,
                              model,
                              modelType,
                          }: {
                      Severity: Major
                      Found in src/OperationFactory.ts and 6 other locations - About 45 mins to fix
                      src/OperationFactory.ts on lines 59..164
                      src/OperationFactory.ts on lines 166..195
                      src/OperationFactory.ts on lines 197..226
                      src/OperationFactory.ts on lines 228..383
                      src/OperationFactory.ts on lines 520..578
                      src/OperationFactory.ts on lines 580..623

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 50.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 7 locations. Consider refactoring.
                      Open

                          public updateRecords({
                              mutations,
                              model,
                              modelType,
                          }: {
                      Severity: Major
                      Found in src/OperationFactory.ts and 6 other locations - About 45 mins to fix
                      src/OperationFactory.ts on lines 59..164
                      src/OperationFactory.ts on lines 166..195
                      src/OperationFactory.ts on lines 197..226
                      src/OperationFactory.ts on lines 385..518
                      src/OperationFactory.ts on lines 520..578
                      src/OperationFactory.ts on lines 580..623

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 50.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 7 locations. Consider refactoring.
                      Open

                          public createRecord({
                              mutations,
                              model,
                              modelType,
                          }: {
                      Severity: Major
                      Found in src/OperationFactory.ts and 6 other locations - About 45 mins to fix
                      src/OperationFactory.ts on lines 166..195
                      src/OperationFactory.ts on lines 197..226
                      src/OperationFactory.ts on lines 228..383
                      src/OperationFactory.ts on lines 385..518
                      src/OperationFactory.ts on lines 520..578
                      src/OperationFactory.ts on lines 580..623

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 50.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 7 locations. Consider refactoring.
                      Open

                          public findAll({
                              queries,
                              model,
                              modelType
                          }: {
                      Severity: Major
                      Found in src/OperationFactory.ts and 6 other locations - About 45 mins to fix
                      src/OperationFactory.ts on lines 59..164
                      src/OperationFactory.ts on lines 166..195
                      src/OperationFactory.ts on lines 228..383
                      src/OperationFactory.ts on lines 385..518
                      src/OperationFactory.ts on lines 520..578
                      src/OperationFactory.ts on lines 580..623

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 50.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 7 locations. Consider refactoring.
                      Open

                          public deleteRecords({
                              mutations,
                              model,
                              modelType,
                          }: {
                      Severity: Major
                      Found in src/OperationFactory.ts and 6 other locations - About 45 mins to fix
                      src/OperationFactory.ts on lines 59..164
                      src/OperationFactory.ts on lines 166..195
                      src/OperationFactory.ts on lines 197..226
                      src/OperationFactory.ts on lines 228..383
                      src/OperationFactory.ts on lines 385..518
                      src/OperationFactory.ts on lines 580..623

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 50.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 7 locations. Consider refactoring.
                      Open

                          public deleteRecord({
                              mutations,
                              model,
                              modelType,
                          }: {
                      Severity: Major
                      Found in src/OperationFactory.ts and 6 other locations - About 45 mins to fix
                      src/OperationFactory.ts on lines 59..164
                      src/OperationFactory.ts on lines 166..195
                      src/OperationFactory.ts on lines 197..226
                      src/OperationFactory.ts on lines 228..383
                      src/OperationFactory.ts on lines 385..518
                      src/OperationFactory.ts on lines 520..578

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 50.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 7 locations. Consider refactoring.
                      Open

                          public findRecord({
                              queries,
                              model,
                              modelType
                          }: {
                      Severity: Major
                      Found in src/OperationFactory.ts and 6 other locations - About 45 mins to fix
                      src/OperationFactory.ts on lines 59..164
                      src/OperationFactory.ts on lines 197..226
                      src/OperationFactory.ts on lines 228..383
                      src/OperationFactory.ts on lines 385..518
                      src/OperationFactory.ts on lines 520..578
                      src/OperationFactory.ts on lines 580..623

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 50.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      There are no issues that match your filters.

                      Category
                      Status