jmdobry/reheat

View on GitHub

Showing 125 of 296 total issues

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 exports has 36 lines of code (exceeds 25 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 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

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

        module.exports = function (Promise, utils, errors, models) {
          /**
           * @doc method
           * @id Model.instance_methods:destroy
           * @name destroy
        Severity: Minor
        Found in lib/model/prototype/destroy.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 reset has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          reset: function () {
            // 3rd-party dependencies
            container.register('r', function () {
              return require('rethinkdbdash');
            });
        Severity: Minor
        Found in lib/config.js - About 1 hr to fix

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

              return Promise.resolve().then(function sanitize() {
                if (!utils.isObject(options)) {
                  throw new IllegalArgumentError(errorPrefix + 'options: Must be an object', { actual: typeof options, expected: 'object' });
                } else if (!utils.isObject(key) && !utils.isString(key)) {
                  throw new IllegalArgumentError(errorPrefix + 'key: Must be a string or an object!', { actual: typeof key, expected: 'string|object' });
          Severity: Minor
          Found in lib/model/prototype/set.js - About 1 hr to fix

            Function exports has 34 lines of code (exceeds 25 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 1 hr to fix

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

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

                Function unset has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function unset(key, options, cb) {
                    var _this = this;
                
                    // Check pre-conditions
                    options = options ? (options === true ? { validate: true } : options) : {};
                Severity: Minor
                Found in lib/model/prototype/unset.js - About 1 hr to fix

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

                  module.exports = function (r, Promise, utils, errors) {
                  
                    /**
                     * @doc function
                     * @id Connection.class:constructor
                  Severity: Minor
                  Found in lib/connection/index.js - About 1 hr to fix

                    Function get has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function methodsExist has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          methodsExist: function (test) {
                              test.expect(30);
                      
                              test.ok(typeof Model.get, 'function');
                              test.ok(typeof Model.getAll, 'function');
                      Severity: Minor
                      Found in old_test/reheat/model/index.test.js - About 1 hr to fix

                        Function manyInsert has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            manyInsert: function (test) {
                                test.expect(4003);
                        
                                connection.configure({
                                    max: 100
                        Severity: Minor
                        Found in old_test/connection/index.test.js - About 1 hr to fix

                          Function profile has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Function exports has 31 lines of code (exceeds 25 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

                              Function profile has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

                                Function normalIsNew has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

                                  Function clear has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function clear(options, cb) {
                                      var _this = this;
                                  
                                      // Check pre-conditions
                                      options = options ? (options === true ? { validate: true } : options) : {};
                                  Severity: Minor
                                  Found in lib/model/prototype/clear.js - About 1 hr to fix

                                    Function link has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            link: function(scope, element, attrs) {
                                    
                                                element.bind('click', function(){
                                    
                                                    element.addClass('loading');
                                    Severity: Minor
                                    Found in guide/reheat.js - About 1 hr to fix

                                      Function validateWithError has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          validateWithError: function (test) {
                                              test.expect(6);
                                      
                                              var instance = {
                                                  attributes: {
                                      Severity: Minor
                                      Found in old_test/reheat/model/prototype/clear.test.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language