Reactive-Extensions/RxJS

View on GitHub
examples/testing/qunit/qunit.js

Summary

Maintainability
F
1 wk
Test Coverage

Showing 33 of 33 total issues

File qunit.js has 1469 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
* QUnit v1.10.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
Severity: Major
Found in examples/testing/qunit/qunit.js - About 3 days to fix

    Function jsDump has 185 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    QUnit.jsDump = (function() {
    function quote( str ) {
    return '"' + str.toString().replace( /"/g, '\\"' ) + '"';
    }
    function literal( o ) {
    Severity: Major
    Found in examples/testing/qunit/qunit.js - About 7 hrs to fix

      Function equiv has 126 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      QUnit.equiv = (function() {
       
      // Call the o related callback with the given arguments.
      function bindCallbacks( o, callbacks, args ) {
      var prop = QUnit.objectType( o );
      Severity: Major
      Found in examples/testing/qunit/qunit.js - About 5 hrs to fix

        Function diff has 114 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        QUnit.diff = (function() {
        function diff( o, n ) {
        var i,
        ns = {},
        os = {};
        Severity: Major
        Found in examples/testing/qunit/qunit.js - About 4 hrs to fix

          Function load has 98 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          QUnit.load = function() {
          runLoggingCallbacks( "begin", QUnit, {} );
           
          // Initialize the config, saving the execution queue
          var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, moduleFilter,
          Severity: Major
          Found in examples/testing/qunit/qunit.js - About 3 hrs to fix

            Function callbacks has 90 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            callbacks = (function () {
             
            // for string, boolean, number and null
            function useStrictEquality( b, a ) {
            if ( b instanceof a.constructor || a instanceof b.constructor ) {
            Severity: Major
            Found in examples/testing/qunit/qunit.js - About 3 hrs to fix

              Function finish has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              finish: function() {
              config.current = this;
              if ( config.requireExpects && this.expected == null ) {
              QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack );
              } else if ( this.expected != null && this.expected != this.assertions.length ) {
              Severity: Major
              Found in examples/testing/qunit/qunit.js - About 3 hrs to fix

                Function diff has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function diff( o, n ) {
                var i,
                ns = {},
                os = {};
                 
                 
                Severity: Major
                Found in examples/testing/qunit/qunit.js - About 2 hrs to fix

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

                  function done() {
                  config.autorun = true;
                   
                  // Log the last module results
                  if ( config.currentModule ) {
                  Severity: Major
                  Found in examples/testing/qunit/qunit.js - About 2 hrs to fix

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

                    setup: function() {
                    if ( this.module !== config.previousModule ) {
                    if ( config.previousModule ) {
                    runLoggingCallbacks( "moduleDone", QUnit, {
                    name: config.previousModule,
                    Severity: Minor
                    Found in examples/testing/qunit/qunit.js - About 1 hr to fix

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

                      init: function() {
                      extend( config, {
                      stats: { all: 0, bad: 0 },
                      moduleStats: { all: 0, bad: 0 },
                      started: +new Date(),
                      Severity: Minor
                      Found in examples/testing/qunit/qunit.js - About 1 hr to fix

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

                        push: function( result, actual, expected, message ) {
                        if ( !config.current ) {
                        throw new Error( "assertion outside test context, was " + sourceFromStacktrace() );
                        }
                         
                         
                        Severity: Minor
                        Found in examples/testing/qunit/qunit.js - About 1 hr to fix

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

                          "object": function( b, a ) {
                          var i, j, loop,
                          // Default to true
                          eq = true,
                          aProperties = [],
                          Severity: Minor
                          Found in examples/testing/qunit/qunit.js - About 1 hr to fix

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

                            function extractStacktrace( e, offset ) {
                            offset = offset === undefined ? 3 : offset;
                             
                            var stack, include, i, regex;
                             
                             
                            Severity: Minor
                            Found in examples/testing/qunit/qunit.js - About 1 hr to fix

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

                              throws: function( block, expected, message ) {
                              var actual,
                              ok = false;
                               
                              // 'expected' is optional
                              Severity: Minor
                              Found in examples/testing/qunit/qunit.js - About 1 hr to fix

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

                                pushFailure: function( message, source, actual ) {
                                if ( !config.current ) {
                                throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) );
                                }
                                 
                                 
                                Severity: Minor
                                Found in examples/testing/qunit/qunit.js - About 1 hr to fix

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

                                  queue: function() {
                                  var bad,
                                  test = this;
                                   
                                  synchronize(function() {
                                  Severity: Minor
                                  Found in examples/testing/qunit/qunit.js - About 1 hr to fix

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

                                    typeOf: function( obj ) {
                                    var type;
                                    if ( obj === null ) {
                                    type = "null";
                                    } else if ( typeof obj === "undefined" ) {
                                    Severity: Minor
                                    Found in examples/testing/qunit/qunit.js - About 1 hr to fix

                                      Avoid too many return statements within this function.
                                      Open

                                      return "object";
                                      Severity: Major
                                      Found in examples/testing/qunit/qunit.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                        return undefined;
                                        Severity: Major
                                        Found in examples/testing/qunit/qunit.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                          return !include;
                                          Severity: Major
                                          Found in examples/testing/qunit/qunit.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                            return e.sourceURL + ":" + e.line;
                                            Severity: Major
                                            Found in examples/testing/qunit/qunit.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                              return include;
                                              Severity: Major
                                              Found in examples/testing/qunit/qunit.js - About 30 mins to fix

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

                                                if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null &&
                                                n[ i + 1 ] == o[ n[i].row + 1 ] ) {
                                                 
                                                n[ i + 1 ] = {
                                                text: n[ i + 1 ],
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 3 hrs to fix
                                                examples/testing/qunit/qunit.js on lines 1895..1906

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

                                                if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null &&
                                                n[ i - 1 ] == o[ n[i].row - 1 ]) {
                                                 
                                                n[ i - 1 ] = {
                                                text: n[ i - 1 ],
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 3 hrs to fix
                                                examples/testing/qunit/qunit.js on lines 1880..1891

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

                                                for ( i = 0; i < o.length; i++ ) {
                                                if ( os[ o[i] ] == null ) {
                                                os[ o[i] ] = {
                                                rows: [],
                                                n: null
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 2 hrs to fix
                                                examples/testing/qunit/qunit.js on lines 1843..1851

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

                                                for ( i = 0; i < n.length; i++ ) {
                                                if ( ns[ n[i] ] == null ) {
                                                ns[ n[i] ] = {
                                                rows: [],
                                                o: null
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 2 hrs to fix
                                                examples/testing/qunit/qunit.js on lines 1853..1861

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

                                                try {
                                                this.testEnvironment.setup.call( this.testEnvironment );
                                                } catch( e ) {
                                                QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
                                                }
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 1 hr to fix
                                                examples/testing/qunit/qunit.js on lines 154..158

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

                                                if ( config.previousModule ) {
                                                runLoggingCallbacks( "moduleDone", QUnit, {
                                                name: config.previousModule,
                                                failed: config.moduleStats.bad,
                                                passed: config.moduleStats.all - config.moduleStats.bad,
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 1 hr to fix
                                                examples/testing/qunit/qunit.js on lines 1089..1096

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

                                                if ( config.currentModule ) {
                                                runLoggingCallbacks( "moduleDone", QUnit, {
                                                name: config.currentModule,
                                                failed: config.moduleStats.bad,
                                                passed: config.moduleStats.all - config.moduleStats.bad,
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 1 hr to fix
                                                examples/testing/qunit/qunit.js on lines 69..76

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

                                                try {
                                                this.testEnvironment.teardown.call( this.testEnvironment );
                                                } catch( e ) {
                                                QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
                                                }
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 1 hr to fix
                                                examples/testing/qunit/qunit.js on lines 111..115

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

                                                n[ ns[i].rows[0] ] = {
                                                text: n[ ns[i].rows[0] ],
                                                row: os[i].rows[0]
                                                };
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 1 hr to fix
                                                examples/testing/qunit/qunit.js on lines 1872..1875

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

                                                o[ os[i].rows[0] ] = {
                                                text: o[ os[i].rows[0] ],
                                                row: ns[i].rows[0]
                                                };
                                                Severity: Major
                                                Found in examples/testing/qunit/qunit.js and 1 other location - About 1 hr to fix
                                                examples/testing/qunit/qunit.js on lines 1868..1871
                                                Category
                                                Status