jmdobry/reheat

View on GitHub

Showing 296 of 296 total issues

Function normal has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    normal: function (test) {
        test.expect(7);

        var instance = {
            attributes: {
Severity: Major
Found in old_test/reheat/model/prototype/destroy.test.js - About 2 hrs to fix

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

                    var JSONposts = [
                        {
                            title: 'post3',
                            id: post3.get(Post.idAttribute),
                            userId: tempUser2.get(User.idAttribute)
    Severity: Major
    Found in old_test/model/static/relations.test.js and 1 other location - About 2 hrs to fix
    old_test/model/static/relations.test.js on lines 498..509

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

    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

                    var JSONposts = [
                        {
                            title: 'post3',
                            id: post3.get(Post.idAttribute),
                            userId: tempUser2.get(User.idAttribute)
    Severity: Major
    Found in old_test/model/static/relations.test.js and 1 other location - About 2 hrs to fix
    old_test/model/static/relations.test.js on lines 551..562

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

    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

                instance.clear(true).catch(errors.ValidationError, function (err) {
                    test.equal(err.type, 'ValidationError');
                    test.equal(instance.constructor.schema.validate.callCount, 2);
                    test.deepEqual(instance.attributes, {
                        name: 'John'
    Severity: Major
    Found in old_test/reheat/model/prototype/clear.test.js and 1 other location - About 2 hrs to fix
    old_test/reheat/model/prototype/unset.test.js on lines 172..179

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

    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

                instance.unset('name', true).catch(errors.ValidationError, function (err) {
                    test.equal(err.type, 'ValidationError');
                    test.equal(instance.constructor.schema.validate.callCount, 2);
                    test.deepEqual(instance.attributes, {
                        name: 'John'
    Severity: Major
    Found in old_test/reheat/model/prototype/unset.test.js and 1 other location - About 2 hrs to fix
    old_test/reheat/model/prototype/clear.test.js on lines 145..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 89.

    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 save.test.js has 279 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*jshint loopfunc:true*/
    
    var SandboxedModule = require('sandboxed-module'),
        errors = require('../../../../../build/instrument/lib/support/errors'),
        support = require('../../../../support/support'),
    Severity: Minor
    Found in old_test/reheat/model/prototype/save.test.js - About 2 hrs to fix

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

            if (predicate.limit) {
              var limit = parseInt(predicate.limit, 10);
              if (isNaN(limit)) {
                throw new IllegalArgumentError(errorPrefix + 'predicate.limit: Must be a number!', { limit: { actual: typeof predicate.limit, expected: 'number' } });
              } else {
      Severity: Major
      Found in lib/collection/static/findAll.js and 1 other location - About 2 hrs to fix
      lib/collection/static/findAll.js on lines 307..314

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

      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 (predicate.skip) {
              var skip = parseInt(predicate.skip, 10);
              if (isNaN(skip)) {
                throw new IllegalArgumentError(errorPrefix + 'predicate.skip: Must be a number!', { skip: { actual: typeof predicate.skip, expected: 'number' } });
              } else {
      Severity: Major
      Found in lib/collection/static/findAll.js and 1 other location - About 2 hrs to fix
      lib/collection/static/findAll.js on lines 298..305

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

      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

                              _this.connection.acquire().then(function (conn) {
                                  var deferred = Promise.defer();
                                  setTimeout(function () {
                                      _this.connection.release(conn);
                                      deferred.resolve();
      Severity: Major
      Found in old_test/reheat/connection/index.test.js and 1 other location - About 2 hrs to fix
      old_test/reheat/connection/index.test.js on lines 710..717

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

      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 instance = {
                  attributes: {
                      name: 'John'
                  },
                  save: save,
      Severity: Major
      Found in old_test/reheat/model/prototype/save.test.js and 1 other location - About 2 hrs to fix
      old_test/reheat/model/prototype/save.test.js on lines 193..210

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

      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

                              _this.connection.acquire().then(function (conn) {
                                  var deferred = Promise.defer();
                                  setTimeout(function () {
                                      _this.connection.release(conn);
                                      deferred.resolve();
      Severity: Major
      Found in old_test/reheat/connection/index.test.js and 1 other location - About 2 hrs to fix
      old_test/reheat/connection/index.test.js on lines 718..725

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

      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 instance = {
                  attributes: {
                      name: 'John'
                  },
                  save: save,
      Severity: Major
      Found in old_test/reheat/model/prototype/save.test.js and 1 other location - About 2 hrs to fix
      old_test/reheat/model/prototype/save.test.js on lines 117..134

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

      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 filter.relations.test.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*jshint loopfunc:true*/
      
      var Connection = require('../../../../build/instrument/lib/connection'),
          reheat = require('../../../../build/instrument/lib'),
          utils = require('../../../../build/instrument/lib/support/utils'),
      Severity: Minor
      Found in old_test/model/static/filter.relations.test.js - About 2 hrs to fix

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

                    publicBottom = this.connection.pooled(privateBottom = function (client, arg, cb) {
                        test.ok('close' in client);
                        test.equal(typeof client.close, 'function');
                        test.equal(arg, 'hello');
                        cb(null, arg);
        Severity: Major
        Found in old_test/reheat/connection/index.test.js and 1 other location - About 2 hrs to fix
        old_test/reheat/connection/index.test.js on lines 645..650

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

        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

                    publicFn = this.connection.pooled(privateFn = function (client, arg, cb) {
                        test.ok('close' in client);
                        test.equal(typeof client.close, 'function');
                        test.equal(arg, 'hello');
                        cb(null, arg);
        Severity: Major
        Found in old_test/reheat/connection/index.test.js and 1 other location - About 2 hrs to fix
        old_test/reheat/connection/index.test.js on lines 662..667

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

        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 exports has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function (Promise, utils, errors) {
          var IllegalArgumentError = errors.IllegalArgumentError;
        
          /**
           * @doc method
        Severity: Minor
        Found in lib/model/prototype/clear.js - About 2 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 exports has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function (Promise, utils, errors) {
          var IllegalArgumentError = errors.IllegalArgumentError;
        
          /**
           * @doc method
        Severity: Minor
        Found in lib/model/prototype/unset.js - About 2 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 clone has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            clone: function (test) {
                test.expect(3);
        
                function constructor(attrs) {
                    return {
        Severity: Major
        Found in old_test/reheat/model/prototype/index.test.js - About 2 hrs to fix

          Function exports has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (mout) {
            return {
              contains: mout.array.contains,
              every: mout.array.every,
              filter: mout.array.filter,
          Severity: Major
          Found in lib/support/utils.js - About 2 hrs to fix

            Function exports has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (Promise, utils, errors) {
              var IllegalArgumentError = errors.IllegalArgumentError;
            
              /**
               * @doc method
            Severity: Major
            Found in lib/model/prototype/set.js - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language