sequelize/sequelize

View on GitHub
src/dialects/sqlite/query-generator.js

Summary

Maintainability
F
1 wk
Test Coverage

File query-generator.js has 409 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const Utils = require('../../utils');
const Transaction = require('../../transaction');
const _ = require('lodash');
const MySqlQueryGenerator = require('../mysql/query-generator');
const AbstractQueryGenerator = require('../abstract/query-generator');
Severity: Minor
Found in src/dialects/sqlite/query-generator.js - About 5 hrs to fix

    Function attributesToSQL has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

      attributesToSQL(attributes) {
        const result = {};
        for (const name in attributes) {
          const dataType = attributes[name];
          const fieldName = dataType.field || name;
    Severity: Minor
    Found in src/dialects/sqlite/query-generator.js - About 5 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function createTableQuery has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

      createTableQuery(tableName, attributes, options) {
        options = options || {};
    
        const primaryKeys = [];
        const needsMultiplePrimaryKeys =
    Severity: Minor
    Found in src/dialects/sqlite/query-generator.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    SQLiteQueryGenerator has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SQLiteQueryGenerator extends MySqlQueryGenerator {
      createSchema() {
        return "SELECT name FROM `sqlite_master` WHERE type='table' and name!='sqlite_sequence';";
      }
    
    
    Severity: Minor
    Found in src/dialects/sqlite/query-generator.js - About 3 hrs to fix

      Function updateQuery has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        updateQuery(tableName, attrValueHash, where, options, attributes) {
          options = options || {};
          _.defaults(options, this.options);
      
          attrValueHash = Utils.removeNullValuesFromHash(attrValueHash, options.omitNull, options);
      Severity: Minor
      Found in src/dialects/sqlite/query-generator.js - About 1 hr to fix

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

          createTableQuery(tableName, attributes, options) {
            options = options || {};
        
            const primaryKeys = [];
            const needsMultiplePrimaryKeys =
        Severity: Minor
        Found in src/dialects/sqlite/query-generator.js - About 1 hr to fix

          Function attributesToSQL has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            attributesToSQL(attributes) {
              const result = {};
              for (const name in attributes) {
                const dataType = attributes[name];
                const fieldName = dataType.field || name;
          Severity: Minor
          Found in src/dialects/sqlite/query-generator.js - About 1 hr to fix

            Function _checkValidJsonStatement has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              _checkValidJsonStatement(stmt) {
                if (typeof stmt !== 'string') {
                  return false;
                }
            
            
            Severity: Minor
            Found in src/dialects/sqlite/query-generator.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function _checkValidJsonStatement has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _checkValidJsonStatement(stmt) {
                if (typeof stmt !== 'string') {
                  return false;
                }
            
            
            Severity: Minor
            Found in src/dialects/sqlite/query-generator.js - About 1 hr to fix

              Function updateQuery has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                updateQuery(tableName, attrValueHash, where, options, attributes) {
                  options = options || {};
                  _.defaults(options, this.options);
              
                  attrValueHash = Utils.removeNullValuesFromHash(attrValueHash, options.omitNull, options);
              Severity: Minor
              Found in src/dialects/sqlite/query-generator.js - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                renameColumnQuery(tableName, attrNameBefore, attrNameAfter, attributes) {
                  let backupTableName;
              
                  attributes = this.attributesToSQL(attributes);
              
              
              Severity: Minor
              Found in src/dialects/sqlite/query-generator.js - About 1 hr to fix

                Function removeColumnQuery has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  removeColumnQuery(tableName, attributes) {
                    attributes = this.attributesToSQL(attributes);
                
                    let backupTableName;
                    if (typeof tableName === 'object') {
                Severity: Minor
                Found in src/dialects/sqlite/query-generator.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if (dataType.includes(' REFERENCES')) {
                                dataTypeString += dataType.substr(dataType.indexOf(' REFERENCES'));
                              }
                  Severity: Major
                  Found in src/dialects/sqlite/query-generator.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if (dataType.includes('NOT NULL')) {
                                  dataTypeString = dataType.replace(' PRIMARY KEY', '');
                                } else {
                                  dataTypeString = dataType.replace('PRIMARY KEY', 'NOT NULL');
                                }
                    Severity: Major
                    Found in src/dialects/sqlite/query-generator.js - About 45 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                            if (value instanceof Utils.SequelizeMethod || options.bindParam === false) {
                              values.push(
                                `${this.quoteIdentifier(key)}=${this.escape(
                                  value,
                                  (modelAttributeMap && modelAttributeMap[key]) || undefined,
                      Severity: Major
                      Found in src/dialects/sqlite/query-generator.js - About 40 mins to fix

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

                              if (value instanceof Utils.SequelizeMethod || options.bindParam === false) {
                                values.push(
                                  `${this.quoteIdentifier(key)}=${this.escape(
                                    value,
                                    (modelAttributeMap && modelAttributeMap[key]) || undefined,
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 5 hrs to fix
                        src/dialects/abstract/query-generator.js on lines 415..432

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

                        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.uniqueKeys) {
                              _.each(options.uniqueKeys, columns => {
                                if (columns.customIndex) {
                                  attrStr += `, UNIQUE (${columns.fields.map(field => this.quoteIdentifier(field)).join(', ')})`;
                                }
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 2 hrs to fix
                        src/dialects/postgres/query-generator.js on lines 88..94

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

                        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

                            return (
                              `${this.createTableQuery(
                                backupTableName,
                                attributes
                              )}INSERT INTO ${quotedBackupTableName} SELECT ${attributeNames} FROM ${quotedTableName};` +
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 2 hrs to fix
                        src/dialects/sqlite/query-generator.js on lines 468..478

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

                        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

                            return (
                              `${this.createTableQuery(
                                backupTableName,
                                attributes
                              )}INSERT INTO ${quotedBackupTableName} SELECT ${attributeNamesImport} FROM ${quotedTableName};` +
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 2 hrs to fix
                        src/dialects/sqlite/query-generator.js on lines 396..406

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

                        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

                          removeIndexQuery(tableName, indexNameOrAttributes) {
                            let indexName = indexNameOrAttributes;
                        
                            if (typeof indexName !== 'string') {
                              indexName = Utils.underscore(`${tableName}_${indexNameOrAttributes.join('_')}`);
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 2 hrs to fix
                        src/dialects/postgres/query-generator.js on lines 425..433

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

                        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

                            if (typeof tableName === 'object') {
                              backupTableName = {
                                tableName: `${tableName.tableName}_backup`,
                                schema: tableName.schema
                              };
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 2 other locations - About 1 hr to fix
                        src/dialects/sqlite/query-generator.js on lines 380..387
                        src/dialects/sqlite/query-generator.js on lines 445..452

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

                        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

                            if (typeof tableName === 'object') {
                              backupTableName = {
                                tableName: `${tableName.tableName}_backup`,
                                schema: tableName.schema
                              };
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 2 other locations - About 1 hr to fix
                        src/dialects/sqlite/query-generator.js on lines 380..387
                        src/dialects/sqlite/query-generator.js on lines 414..421

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

                        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

                            if (typeof tableName === 'object') {
                              backupTableName = {
                                tableName: `${tableName.tableName}_backup`,
                                schema: tableName.schema
                              };
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 2 other locations - About 1 hr to fix
                        src/dialects/sqlite/query-generator.js on lines 414..421
                        src/dialects/sqlite/query-generator.js on lines 445..452

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

                        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

                            if (attributes) {
                              _.each(attributes, (attribute, key) => {
                                modelAttributeMap[key] = attribute;
                                if (attribute.field) {
                                  modelAttributeMap[attribute.field] = attribute;
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 1 hr to fix
                        src/dialects/abstract/query-generator.js on lines 393..400

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

                        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 (dataType.references.key) {
                                    referencesKey = this.quoteIdentifier(dataType.references.key);
                                  } else {
                                    referencesKey = this.quoteIdentifier('id');
                                  }
                        Severity: Major
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 1 hr to fix
                        src/dialects/postgres/query-generator.js on lines 534..538

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

                        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 attributeNamesExport = Object.keys(attributes)
                              .map(attr => this.quoteIdentifier(attr))
                              .join(', ');
                        Severity: Minor
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 30 mins to fix
                        src/dialects/sqlite/query-generator.js on lines 391..393

                        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

                            const attributeNames = Object.keys(attributes)
                              .map(attr => this.quoteIdentifier(attr))
                              .join(', ');
                        Severity: Minor
                        Found in src/dialects/sqlite/query-generator.js and 1 other location - About 30 mins to fix
                        src/dialects/sqlite/query-generator.js on lines 463..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 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

                        There are no issues that match your filters.

                        Category
                        Status