NateFerrero/cmd.js

View on GitHub

Showing 13 of 34 total issues

Function export has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.export = function (cmd) {

        var arraysEqual = function (a, b) {
            if (a.length !== b.length) {
                return false;
Severity: Minor
Found in src/lib/group.js - About 1 hr to fix

    Function registerEachFn has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Command.prototype.registerEachFn = function (name, fn, plugin) {
            if (typeof fn !== 'function') {
                throw new Error('cmd.registerEachFn(name, fn), fn was not a function, got ' + typeof fn);
            }
    
    
    Severity: Minor
    Found in src/cmd.js - About 1 hr to fix

      Function export has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.export = function (cmd) {
      
              /**
               * Command: clone(null) === [false]
               *      clone.raw(null) === false
      Severity: Minor
      Found in src/lib/clone.js - About 1 hr to fix

        Function registerAllFn has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Command.prototype.registerAllFn = function (name, fn, plugin) {
                if (typeof fn !== 'function') {
                    throw new Error('cmd.registerAllFn(name, fn), fn was not a function, got ' + typeof fn);
                }
        
        
        Severity: Minor
        Found in src/cmd.js - About 1 hr to fix

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

              this.export = function (cmd) {
                  /**
                   * Dependencies
                   */
                  cmd.use('compare', 'clone');
          Severity: Minor
          Found in src/lib/sort.js - About 1 hr to fix

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

                    this.all = function (args, vals) {
                        var groups = [];
                        var groupBy = [];
            
                        vals.forEach(function (val, i) {
            Severity: Minor
            Found in src/lib/group.js - About 1 hr to fix

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

                  Command.prototype.use = function () {
                      var self = this;
                      Array.prototype.forEach.call(arguments, function (name) {
                          if (name === '*') {
                              var libs = [
              Severity: Minor
              Found in src/cmd.js - About 1 hr to fix

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

                    this.export = function () {
                
                        /**
                         * Command: compare(6, 3) === -1
                         * @author Nate Ferrero
                Severity: Minor
                Found in src/lib/compare.js - About 1 hr to fix

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

                      this.export = function () {
                  
                  
                          /**
                           * Command: case.lower('aAa') === ['aaa']
                  Severity: Minor
                  Found in src/lib/case.js - About 1 hr to fix

                    Function raw has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            this.raw = function (_a, _b) {
                                var compare = function (a, b) {
                                    if (typeof a !== typeof b) {
                                        return compare(typeof a, typeof b);
                                    }
                    Severity: Minor
                    Found in src/lib/compare.js - About 1 hr to fix

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

                              this.all = function (args, vals) {
                                  var direction = 1;
                                  var local = cmd.clone.with(args);
                      
                                  if (local && local.length && typeof local[0] === 'number') {
                      Severity: Minor
                      Found in src/lib/sort.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                            if (index > 0 && index + match.length !== title.length &&
                                                match.search(smallWords) > -1 && title.charAt(index - 2) !== ':' &&
                                                (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
                                                title.charAt(index - 1).search(/[^\s-]/) < 0) {
                                                return match.toLowerCase();
                        Severity: Major
                        Found in src/lib/case.js - About 1 hr to fix

                          Avoid too many return statements within this function.
                          Open

                                          return cloneObject(obj);
                          Severity: Major
                          Found in src/lib/clone.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language