Glavin001/graphql-sequelize-crud

View on GitHub

Showing 37 of 37 total issues

Function mutations has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      mutations: (models: Models, modelTypes: ModelTypes) => {
        return {
          createCustom: {
            type: new GraphQLObjectType({
              name: "Custom",
Severity: Minor
Found in demo/index.ts - About 1 hr to fix

    Function fields has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                fields: () => {
                    // Attribute fields
                    const defaultFields = attributeFields(model, {
                        exclude: model.excludeFields ? model.excludeFields : [],
                        globalId: true,
    Severity: Minor
    Found in src/getSchema.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 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 2 locations. Consider refactoring.
        Open

                            edgeFields = attributeFields(aModel, {
                                exclude: aModel.excludeFields ? aModel.excludeFields : [],
                                globalId: true,
                                commentToDescription: true,
                                cache
        Severity: Minor
        Found in src/getSchema.ts and 1 other location - About 55 mins to fix
        src/getSchema.ts on lines 63..68

        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 53.

        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 2 locations. Consider refactoring.
        Open

                        const defaultFields = attributeFields(model, {
                            exclude: model.excludeFields ? model.excludeFields : [],
                            globalId: true,
                            commentToDescription: true,
                            cache
        Severity: Minor
        Found in src/getSchema.ts and 1 other location - About 55 mins to fix
        src/getSchema.ts on lines 190..195

        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 53.

        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

        Avoid too many return statements within this function.
        Open

                    return camelcase(`${type}_${getTableName(model)}`);
        Severity: Major
        Found in src/utils.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return camelcase(`delete_${getTableName(model)}`);
          Severity: Major
          Found in src/utils.ts - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language