wbyoung/maguey

View on GitHub

Showing 52 of 52 total issues

Function alterTable has 157 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  alterTable: function(data) {
    /* jscs:disable jsDoc */

    // we know the phrasing is capable of handling one index creation or index
    // drop. we need to create a procedure if there are more operations
Severity: Major
Found in lib/adapters/sqlite3/procedures.js - About 6 hrs to fix

    `` has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Translator.reopen(/** @lends Translator# */ {
    
      /**
       * Translate a predicate and the corresponding args into a format string and
       * arguments that can be used while creating expressions.
    Severity: Minor
    Found in lib/dialect/translator.js - About 3 hrs to fix

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

        _statement: function() {
          this._configure();
      
          var statement = this._adapter.phrasing.alterTable(this._data());
          if (this._procedure()) {
      Severity: Major
      Found in lib/schema/table/alter.js and 1 other location - About 3 hrs to fix
      lib/schema/table/create.js on lines 87..96

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

      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

        _statement: function() {
          this._configure();
      
          var statement = this._adapter.phrasing.createTable(this._data());
          if (this._procedure()) {
      Severity: Major
      Found in lib/schema/table/create.js and 1 other location - About 3 hrs to fix
      lib/schema/table/alter.js on lines 113..122

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

      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

      File condition.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      var _ = require('lodash');
      var Class = require('corazon/class');
      var FieldString = require('../types/field');
      Severity: Minor
      Found in lib/condition/condition.js - About 2 hrs to fix

        Function alterTable has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          alterTable: function(data) {
            /* jscs:disable jsDoc */
        
            // we know the phrasing is capable of handling everything other than index
            // renaming. we need to create a procedure if any index renames occur.
        Severity: Major
        Found in lib/adapters/mysql/procedures.js - About 2 hrs to fix

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

            renameIndex: function(table, index) {
              var quoteField = this._grammar.field.bind(this._grammar);
              var fragments = [
                'ALTER INDEX ', quoteField(index.from),
                ' RENAME TO ', quoteField(index.to),
          Severity: Major
          Found in lib/dialect/phrasing_index.js and 1 other location - About 2 hrs to fix
          lib/dialect/phrasing_table.js on lines 144..150

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

          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

            renameTable: function(data) {
              var quoteField = this._grammar.field.bind(this._grammar);
              var fragments = ['ALTER TABLE ',
                quoteField(data.from), ' RENAME TO ', quoteField(data.to),
              ];
          Severity: Major
          Found in lib/dialect/phrasing_table.js and 1 other location - About 2 hrs to fix
          lib/dialect/phrasing_index.js on lines 67..74

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

          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

          var FieldString = Class.extend(/** @lends FieldString# */ {
          
            /**
             * Create a field string.
             *
          Severity: Major
          Found in lib/types/field.js and 1 other location - About 2 hrs to fix
          lib/types/literal.js on lines 26..49

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

          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

          var LiteralString = Class.extend(/** @lends LiteralString# */ {
          
            /**
             * Create a literal string.
             *
          Severity: Major
          Found in lib/types/literal.js and 1 other location - About 2 hrs to fix
          lib/types/field.js on lines 21..43

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

          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

          Function alterTable has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            alterTable: function(data) {
              // create a base statement that does not include renames, addition of
              // indexes, dropped indexes, or renamed indexes.
              var statement = this._phrasing.alterTable(_.extend({}, data, {
                renamed: [],
          Severity: Major
          Found in lib/adapters/pg/procedures.js - About 2 hrs to fix

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

            RollbackQuery.reopen(/** @lends RollbackQuery# */ {
            
              /**
               * You will not create this query object directly. Instead, you will
               * receive it via {@link TransactionQuery#rollback}.
            Severity: Major
            Found in lib/query/transaction.js and 2 other locations - About 1 hr to fix
            lib/query/transaction.js on lines 286..308
            lib/query/transaction.js on lines 320..342

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

            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

            CommitQuery.reopen(/** @lends CommitQuery# */ {
            
              /**
               * You will not create this query object directly. Instead, you will
               * receive it via {@link TransactionQuery#commit}.
            Severity: Major
            Found in lib/query/transaction.js and 2 other locations - About 1 hr to fix
            lib/query/transaction.js on lines 286..308
            lib/query/transaction.js on lines 354..376

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

            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

            BeginQuery.reopen(/** @lends BeginQuery# */ {
            
              /**
               * You will not create this query object directly. Instead, you will
               * receive it via {@link TransactionQuery#begin}.
            Severity: Major
            Found in lib/query/transaction.js and 2 other locations - About 1 hr to fix
            lib/query/transaction.js on lines 320..342
            lib/query/transaction.js on lines 354..376

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

            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

            Function alterTable has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              alterTable: function(data) {
                var statement;
                var alterations =
                  data.added.length +
                  data.addedIndexes.length +
            Severity: Minor
            Found in lib/dialect/phrasing_table.js - About 1 hr to fix

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

                      data.droppedIndexes.forEach(function(index) {
                        promise = promise.then(function() {
                          return query.raw(dropIndex(data.name, index));
                        });
                      }, this);
              Severity: Major
              Found in lib/adapters/pg/procedures.js and 2 other locations - About 1 hr to fix
              lib/adapters/pg/procedures.js on lines 82..86
              lib/adapters/pg/procedures.js on lines 88..92

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

              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

                      data.addedIndexes.forEach(function(index) {
                        promise = promise.then(function() {
                          return query.raw(createIndex(data.name, index));
                        });
                      }, this);
              Severity: Major
              Found in lib/adapters/pg/procedures.js and 2 other locations - About 1 hr to fix
              lib/adapters/pg/procedures.js on lines 76..80
              lib/adapters/pg/procedures.js on lines 88..92

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

              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

                _take: function(orig) {
                  this._super(orig);
                  this._name = orig._name;
                  this._options = _.clone(orig._options);
                },
              Severity: Major
              Found in lib/schema/table/drop.js and 1 other location - About 1 hr to fix
              lib/query/update.js on lines 73..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 62.

              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

                _take: function(orig) {
                  this._super(orig);
                  this._table = orig._table;
                  this._values = _.clone(orig._values);
                },
              Severity: Major
              Found in lib/query/update.js and 1 other location - About 1 hr to fix
              lib/schema/table/drop.js on lines 53..57

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

              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

                      data.renamedIndexes.forEach(function(index) {
                        promise = promise.then(function() {
                          return query.raw(renameIndex(data.name, index));
                        });
                      }, this);
              Severity: Major
              Found in lib/adapters/pg/procedures.js and 2 other locations - About 1 hr to fix
              lib/adapters/pg/procedures.js on lines 76..80
              lib/adapters/pg/procedures.js on lines 82..86

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

              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