silverbucket/teste

View on GitHub

Showing 36 of 66 total issues

File jaribu.js has 496 lines of code (exceeds 250 allowed). Consider refactoring.
Open

if (typeof define !== 'function') {
  var define = require('amdefine')(module);
}

define([ 'jaribu/colors', 'jaribu/display', 'jaribu/tools/Env',
Severity: Minor
Found in lib/jaribu.js - About 7 hrs to fix

    Function connect has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        WebSocketClient.prototype.connect = function (onComplete) {
          var client = new WebSocket.client();
          var self = this;
    
          client.on('connectFailed', function (error) {
    Severity: Major
    Found in lib/tools/WebSocketClient.js - About 4 hrs to fix

      File display.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      if (typeof define !== 'function') {
        var define = require('amdefine')(module);
      }
      define(['jaribu/colors'], function (colors, undefined) {
       
      Severity: Minor
      Found in lib/display.js - About 4 hrs to fix

        Function isEqual has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function isEqual(a, b) {
            if (b === undefined) { return false; }
            var p;
            if (Array.isArray(a)) {
              if (!Array.isArray(b)) {
        Severity: Major
        Found in lib/tools/assert.js - About 2 hrs to fix

          Function fail has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function fail(part, suiteIndex, testIndex, msg) {
              if (typeof testIndex === 'string') {
                msg = testIndex;
                testIndex = undefined;
              }
          Severity: Major
          Found in lib/jaribu.js - About 2 hrs to fix

            Function pass has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function pass(part, suiteIndex, testIndex) {
                var o;
                var isSuite = false;
            
                if (typeof testIndex === 'number') {
            Severity: Major
            Found in lib/jaribu.js - About 2 hrs to fix

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

                Throws.prototype.run = function (func, expected, message) {
                  if (typeof func !== 'function') {
                    throw new Error('throws takes at least one parameter, a function to run.');
                  }
              
              
              Severity: Minor
              Found in lib/tools/Throws.js - About 1 hr to fix

                Function executeTest has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function executeTest(part, local, suiteIndex, testIndex) {
                    //
                    // we run the test in the next tick so that the function returns and
                    // we don't build up the call stack
                    //
                Severity: Minor
                Found in lib/jaribu.js - About 1 hr to fix

                  Function buildTestObj has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function buildTestObj(env, s, t) {
                      if (! t.desc ) {
                        err_msg = s.name + ": test '" + t.name +
                                "'' requires a 'desc' property";
                        return false;
                  Severity: Minor
                  Found in lib/jaribu.js - About 1 hr to fix

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

                      WebSocketServer.prototype.run = function (callback) {
                        var WebSocketServer = require('websocket').server;
                        var http = requirejs('http');
                        var messages = this.messages;
                        var port = this.port;
                    Severity: Minor
                    Found in lib/tools/WebSocketServer.js - About 1 hr to fix

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

                        function waitResult(part, suiteIndex, testIndex, local) {
                          // this is function calls itself after a set interval, checking the
                          // status of the test via. the result property.
                          // result is initialized as undefined, and the test is not complete
                          // until it is 'true' or 'false'.
                      Severity: Minor
                      Found in lib/jaribu.js - About 1 hr to fix

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

                          pub.loadSuite = function (s) {
                            if (! s.desc ) {
                              err_msg = '... suite requires a \'desc\' property';
                              return false;
                            } else if (! s.tests ) {
                        Severity: Minor
                        Found in lib/jaribu.js - About 1 hr to fix

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

                                json: (function () {
                                  var lPromise = (typeof Promise !== 'undefined') ? Promise : helpers.pub.fetch.Promise;
                          
                                  function status(response) {
                                    if (response.status >= 200 && response.status < 300) {
                          Severity: Minor
                          Found in lib/Scaffolding.js - About 1 hr to fix

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

                              HttpServer.prototype.run = function (callback) {
                                var key;
                                var express    = requirejs('express');
                                var bodyParser = requirejs('body-parser');
                            
                            
                            Severity: Minor
                            Found in lib/tools/HttpServer.js - About 1 hr to fix

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

                                  (function _waitResult() {
                                    if (processed) {
                                      console.log('test processed, aborting waitResult');
                                      return;
                                    } else if (local.result() === undefined)  {
                              Severity: Minor
                              Found in lib/jaribu.js - About 1 hr to fix

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

                                  function getTestSummary(summary, suite) {
                                    // iterate through tests for this suite, populating the summary
                                    for (var i = 0, len = suite.tests.length; i < len; i++) {
                                      var t = suite.tests[i];
                                      var types = [ 'setup', 'takedown', 'beforeEach', 'afterEach' ];
                                Severity: Minor
                                Found in lib/jaribu.js - About 1 hr to fix

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

                                    pub.assert = function (one, two, customMsg) {
                                      customMsg = customMsg ? (' -- ' + customMsg) : '';
                                      var args = Array.prototype.slice.call(arguments);
                                      var self = arguments.callee;
                                      if (typeof one === 'undefined') {
                                  Severity: Minor
                                  Found in lib/tools/assert.js - About 1 hr to fix

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

                                        console: function (summary) {
                                          var i, o;
                                          var failedScaffoldingLength = summary.scaffolding.failObjs.length;
                                          if (failedScaffoldingLength > 0) {
                                            process.stdout.write("\nfailed scaffolding:");
                                    Severity: Minor
                                    Found in lib/display.js - About 1 hr to fix

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

                                          browser: function (summary) {
                                            var i, o;
                                            var failedScaffoldingLength = summary.scaffolding.failObjs.length;
                                            if (failedScaffoldingLength > 0) {
                                              __browserWrite("<br />failed scaffolding:");
                                      Severity: Minor
                                      Found in lib/display.js - About 1 hr to fix

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

                                          function run(part, suiteIndex, testIndex) {
                                            var local;
                                            var o;
                                            var isSuite = true;
                                        
                                        
                                        Severity: Minor
                                        Found in lib/jaribu.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language