jmdobry/reheat

View on GitHub

Showing 125 of 296 total issues

Function limitError has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    limitError: function (test) {
        test.expect(8);

        function Model(attrs) {
            this.attributes = attrs;
Severity: Minor
Found in old_test/reheat/model/static/filter.test.js - About 1 hr to fix

    Function key has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function options has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

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

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

              primaryKey: function (test) {
                  test.expect(18);
          
                  function Model(attrs) {
                      this.attributes = attrs;
          Severity: Minor
          Found in old_test/reheat/model/static/get.test.js - About 1 hr to fix

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

                options: function (test) {
                    test.expect(8);
            
                    function Model(attrs) {
                        this.attributes = attrs;
            Severity: Minor
            Found in old_test/reheat/model/static/getAll.test.js - About 1 hr to fix

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

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

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

                  Connection.prototype.run = function (query, options, cb) {
                    if (utils.isFunction(options)) {
                      cb = options;
                      options = {};
                    }
                Severity: Minor
                Found in lib/connection/index.js - About 1 hr to fix

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

                      where: function (test) {
                          test.expect(3);
                  
                          function Model(attrs) {
                              this.attributes = attrs;
                  Severity: Minor
                  Found in old_test/reheat/model/static/filter.test.js - About 1 hr to fix

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

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

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

                      module.exports = function (container, Promise, utils, errors) {
                        var IllegalArgumentError = errors.IllegalArgumentError;
                        var RuntimeError = errors.RuntimeError;
                        var errorPrefix = 'Model.load(relations[, options][, cb]): ';
                      
                      
                      Severity: Minor
                      Found in lib/model/prototype/load.js - About 45 mins 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

                      Avoid deeply nested control flow statements.
                      Open

                                          if (newModels[localKey].relation === 'hasOne' && localValue.length) {
                                            doc[localKey] = new models[newModels[localKey].modelName](localValue[0]);
                                          } else {
                                            doc[localKey] = new models[newModels[localKey].modelName].collection(localValue);
                                          }
                      Severity: Major
                      Found in lib/collection/static/findAll.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if (models[modelName].timestamps) {
                                              attrs.updated = Model.r.now();
                                            }
                        Severity: Major
                        Found in lib/model/static/destroyOne.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if (models[modelName].timestamps) {
                                                attrs.updated = Model.r.now();
                                              }
                          Severity: Major
                          Found in lib/model/static/destroyOne.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if (newModels[localKey].relation === 'hasOne' && localValue.length) {
                                                  doc[localKey] = new models[newModels[localKey].modelName](localValue[0]);
                                                } else {
                                                  doc[localKey] = new models[newModels[localKey].modelName].collection(localValue);
                                                }
                            Severity: Major
                            Found in lib/collection/static/getAll.js - About 45 mins to fix

                              Function exports has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              module.exports = function (container, utils, errors, Collection_prototype, Collection_findAll, Collection_getAll) {
                              Severity: Minor
                              Found in lib/collection/index.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if (newModels[localKey].relation === 'hasOne' && localValue.length) {
                                                      doc[localKey] = new models[newModels[localKey].modelName](localValue[0]);
                                                    } else {
                                                      doc[localKey] = new models[newModels[localKey].modelName].collection(localValue);
                                                    }
                                Severity: Major
                                Found in lib/model/static/findOne.js - About 45 mins to fix

                                  Function viewSource has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  docsApp.directive.viewSource = function ($timeout, $compile) {
                                      return {
                                          restrict: 'E',
                                          replace: true,
                                          template: [
                                  Severity: Minor
                                  Found in guide/reheat.js - About 35 mins 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 defineModel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      defineModel: function (test) {
                                          test.expect(42);
                                  
                                          for (var i = 0; i < support.TYPES_EXCEPT_STRING.length; i++) {
                                              test.throws(
                                  Severity: Minor
                                  Found in old_test/reheat/index.test.js - About 35 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  module.exports = function (container, Promise, utils, errors) {
                                    /**
                                     * @doc method
                                     * @id Model.static_methods:destroyOne
                                     * @name destroyOne
                                  Severity: Minor
                                  Found in lib/model/static/destroyOne.js - About 25 mins 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language