jmdobry/reheat

View on GitHub

Showing 296 of 296 total issues

Function setSync has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function setSync(key, value, options) {
    // Check pre-conditions
    if (utils.isObject(key) && !options) {
      options = value;
    }
Severity: Minor
Found in lib/model/prototype/setSync.js - About 1 hr to fix

    Function createLifecycle has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        createLifecycle: function (test) {
            test.expect(9);
    
            var Post = reheat.defineModel('Post', {
                tableName: tableName,
    Severity: Minor
    Found in old_test/model/index.test.js - About 1 hr to fix

      Function viewSource has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      docsApp.directive.viewSource = function ($timeout, $compile) {
          return {
              restrict: 'E',
              replace: true,
              template: [
      Severity: Minor
      Found in guide/reheat.js - About 1 hr to fix

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

        module.exports = function (container, utils, errors, Collection_prototype, Collection_findAll, Collection_getAll) {
        
          /**
           * @doc function
           * @name Collection
        Severity: Minor
        Found in lib/collection/index.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 normal has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            normal: function (test) {
                test.expect(3);
        
                var instance = {
                    attributes: {
        Severity: Minor
        Found in old_test/reheat/model/prototype/save.test.js - About 1 hr to fix

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

              return Promise.resolve().bind(this).then(function sanitize() {
          
                if (!utils.isObject(predicate)) {
                  throw new IllegalArgumentError(errorPrefix + 'predicate: Must be an object!', { actual: typeof predicate, expected: 'object' });
                } else if (!utils.isObject(options)) {
          Severity: Minor
          Found in lib/collection/static/findAll.js - About 1 hr to fix

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

            module.exports = function (utils, Model_findOne, Model_prototype, Model_destroyOne) {
            
              /**
               * @doc function
               * @name Model
            Severity: Minor
            Found in lib/model/index.js - About 1 hr to fix

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

                                  {
                                      id: comment7.get(Comment.idAttribute),
                                      postId: post3.get(Post.idAttribute),
                                      userId: tempUser2.get(User.idAttribute),
                                      content: comment7.get('content')
              Severity: Major
              Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
              old_test/model/static/relations.test.js on lines 428..433
              old_test/model/static/relations.test.js on lines 434..439
              old_test/model/static/relations.test.js on lines 440..445
              old_test/model/static/relations.test.js on lines 446..451
              old_test/model/static/relations.test.js on lines 452..457
              old_test/model/static/relations.test.js on lines 569..574
              old_test/model/static/relations.test.js on lines 581..586

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

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

                                  {
                                      id: comment1.get(Comment.idAttribute),
                                      postId: post2.get(Post.idAttribute),
                                      userId: tempUser.get(User.idAttribute),
                                      content: comment1.get('content')
              Severity: Major
              Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
              old_test/model/static/relations.test.js on lines 434..439
              old_test/model/static/relations.test.js on lines 440..445
              old_test/model/static/relations.test.js on lines 446..451
              old_test/model/static/relations.test.js on lines 452..457
              old_test/model/static/relations.test.js on lines 569..574
              old_test/model/static/relations.test.js on lines 575..580
              old_test/model/static/relations.test.js on lines 581..586

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

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

                                  {
                                      id: comment4.get(Comment.idAttribute),
                                      postId: post5.get(Post.idAttribute),
                                      userId: tempUser.get(User.idAttribute),
                                      content: comment4.get('content')
              Severity: Major
              Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
              old_test/model/static/relations.test.js on lines 428..433
              old_test/model/static/relations.test.js on lines 434..439
              old_test/model/static/relations.test.js on lines 440..445
              old_test/model/static/relations.test.js on lines 452..457
              old_test/model/static/relations.test.js on lines 569..574
              old_test/model/static/relations.test.js on lines 575..580
              old_test/model/static/relations.test.js on lines 581..586

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

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

                                  {
                                      id: comment8.get(Comment.idAttribute),
                                      postId: post3.get(Post.idAttribute),
                                      userId: tempUser2.get(User.idAttribute),
                                      content: comment8.get('content')
              Severity: Major
              Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
              old_test/model/static/relations.test.js on lines 428..433
              old_test/model/static/relations.test.js on lines 434..439
              old_test/model/static/relations.test.js on lines 440..445
              old_test/model/static/relations.test.js on lines 446..451
              old_test/model/static/relations.test.js on lines 452..457
              old_test/model/static/relations.test.js on lines 569..574
              old_test/model/static/relations.test.js on lines 575..580

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

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

                                  {
                                      id: comment2.get(Comment.idAttribute),
                                      postId: post5.get(Post.idAttribute),
                                      userId: tempUser.get(User.idAttribute),
                                      content: comment2.get('content')
              Severity: Major
              Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
              old_test/model/static/relations.test.js on lines 428..433
              old_test/model/static/relations.test.js on lines 440..445
              old_test/model/static/relations.test.js on lines 446..451
              old_test/model/static/relations.test.js on lines 452..457
              old_test/model/static/relations.test.js on lines 569..574
              old_test/model/static/relations.test.js on lines 575..580
              old_test/model/static/relations.test.js on lines 581..586

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

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

                                  {
                                      id: comment3.get(Comment.idAttribute),
                                      postId: post5.get(Post.idAttribute),
                                      userId: tempUser.get(User.idAttribute),
                                      content: comment3.get('content')
              Severity: Major
              Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
              old_test/model/static/relations.test.js on lines 428..433
              old_test/model/static/relations.test.js on lines 434..439
              old_test/model/static/relations.test.js on lines 446..451
              old_test/model/static/relations.test.js on lines 452..457
              old_test/model/static/relations.test.js on lines 569..574
              old_test/model/static/relations.test.js on lines 575..580
              old_test/model/static/relations.test.js on lines 581..586

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

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

                                  {
                                      id: comment5.get(Comment.idAttribute),
                                      postId: post5.get(Post.idAttribute),
                                      userId: tempUser.get(User.idAttribute),
                                      content: comment5.get('content')
              Severity: Major
              Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
              old_test/model/static/relations.test.js on lines 428..433
              old_test/model/static/relations.test.js on lines 434..439
              old_test/model/static/relations.test.js on lines 440..445
              old_test/model/static/relations.test.js on lines 446..451
              old_test/model/static/relations.test.js on lines 569..574
              old_test/model/static/relations.test.js on lines 575..580
              old_test/model/static/relations.test.js on lines 581..586

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

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

                                  {
                                      id: comment6.get(Comment.idAttribute),
                                      postId: post3.get(Post.idAttribute),
                                      userId: tempUser2.get(User.idAttribute),
                                      content: comment6.get('content')
              Severity: Major
              Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
              old_test/model/static/relations.test.js on lines 428..433
              old_test/model/static/relations.test.js on lines 434..439
              old_test/model/static/relations.test.js on lines 440..445
              old_test/model/static/relations.test.js on lines 446..451
              old_test/model/static/relations.test.js on lines 452..457
              old_test/model/static/relations.test.js on lines 575..580
              old_test/model/static/relations.test.js on lines 581..586

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

              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 options has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  options: function (test) {
                      test.expect(8);
              
                      var instance = {
                          attributes: {
              Severity: Minor
              Found in old_test/reheat/model/prototype/save.test.js - About 1 hr to fix

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

                        if (models[relationModelName] && !models[relationModelName].relations.indices[relation.foreignKey]) {
                          models[relationModelName].relations.indices[relation.foreignKey] = null;
                        }
                Severity: Major
                Found in lib/index.js and 1 other location - About 1 hr to fix
                lib/index.js on lines 80..82

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

                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 (models[relationModelName] && !models[relationModelName].relations.indices[relation.foreignKey]) {
                          models[relationModelName].relations.indices[relation.foreignKey] = null;
                        }
                Severity: Major
                Found in lib/index.js and 1 other location - About 1 hr to fix
                lib/index.js on lines 44..46

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

                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 getPoolSize has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    getPoolSize: function (test) {
                        var _this = this;
                
                        test.expect(7);
                
                
                Severity: Minor
                Found in old_test/reheat/connection/index.test.js - About 1 hr to fix

                  Function lifecycle has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      lifecycle: function (test) {
                          test.expect(8);
                  
                          var instance = {
                              beforeValidate: prototype.beforeValidate,
                  Severity: Minor
                  Found in old_test/reheat/model/prototype/index.test.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language