sequelize/sequelize

View on GitHub

Showing 757 of 757 total issues

Avoid too many return statements within this function.
Open

      return results;
Severity: Major
Found in lib/dialects/sqlite/query.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

              return include;
    Severity: Major
    Found in lib/model.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return values;
      Severity: Major
      Found in lib/model.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return this;
        Severity: Major
        Found in lib/model.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return this.handleShowIndexesQuery(results);
          Severity: Major
          Found in lib/dialects/sqlite/query.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return [result, metaData.changes];
            Severity: Major
            Found in lib/dialects/sqlite/query.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return this.dataValues;
              Severity: Major
              Found in lib/model.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          return this;
                Severity: Major
                Found in lib/model.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return metaData.changes;
                  Severity: Major
                  Found in lib/dialects/sqlite/query.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return results[0].version;
                    Severity: Major
                    Found in lib/dialects/sqlite/query.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return dataTypes.ARRAY.prototype.stringify(val, { escape: partialEscape });
                      Severity: Major
                      Found in lib/sql-string.js - About 30 mins to fix

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

                            if (options.useHooks) {
                              this.runHooks('afterAssociate', { source, target, type: BelongsToMany, association }, options);
                            }
                        Severity: Minor
                        Found in lib/associations/mixin.js and 1 other location - About 30 mins to fix
                        lib/associations/mixin.js on lines 40..42

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

                        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

                            if (options.useHooks) {
                              this.runHooks('afterAssociate', { source, target, type: HasMany, association }, options);
                            }
                        Severity: Minor
                        Found in lib/associations/mixin.js and 1 other location - About 30 mins to fix
                        lib/associations/mixin.js on lines 70..72

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

                        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

                            return new Utils.Promise((resolve, reject) => {
                              const handler = (err, results) => {
                                complete();
                        
                                if (err) {
                        Severity: Minor
                        Found in lib/dialects/mysql/query.js and 1 other location - About 30 mins to fix
                        lib/dialects/mariadb/query.js on lines 47..77

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

                        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

                                attribute.defaultValue === DataTypes.NOW ||
                                  attribute.defaultValue === DataTypes.UUIDV1 ||
                                  attribute.defaultValue === DataTypes.UUIDV4
                        Severity: Minor
                        Found in lib/sequelize.js and 1 other location - About 30 mins to fix
                        lib/instance-validator.js on lines 356..356

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

                        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

                              if (this._length) {
                                if (this._length.toLowerCase() === 'tiny') { // tiny = 2^8
                                  warn('MSSQL does not support TEXT with the `length` = `tiny` option. `NVARCHAR(256)` will be used instead.');
                                  return 'NVARCHAR(256)';
                                }
                        Severity: Minor
                        Found in lib/dialects/mssql/data-types.js and 1 other location - About 30 mins to fix
                        lib/dialects/mssql/data-types.js on lines 54..60

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

                        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 new Date(result);
                        Severity: Major
                        Found in lib/query-interface.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return result;
                          Severity: Major
                          Found in lib/query-interface.js - About 30 mins to fix

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

                              validate(value) {
                                if (typeof value !== 'string') {
                                  throw new sequelizeErrors.ValidationError(util.format('%j is not a valid string', value));
                                }
                                return true;
                            Severity: Minor
                            Found in lib/data-types.js and 1 other location - About 30 mins to fix
                            lib/data-types.js on lines 147..152

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

                            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

                                return Promise.resolve(
                                  connection.query(this.sql, parameters)
                                    .then(results => {
                                      complete();
                            
                            
                            Severity: Minor
                            Found in lib/dialects/mariadb/query.js and 1 other location - About 30 mins to fix
                            lib/dialects/mysql/query.js on lines 39..69

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

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language