Reactive-Extensions/RxJS

View on GitHub
modules/rx-core-testing/rx.core.testing.js

Summary

Maintainability
F
3 wks
Test Coverage

Showing 28 of 28 total issues

File rx.core.testing.js has 793 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information.
 
;(function (factory) {
var objectTypes = {
'function': true,
Severity: Major
Found in modules/rx-core-testing/rx.core.testing.js - About 1 day to fix

    Function VirtualTimeScheduler has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var VirtualTimeScheduler = Rx.VirtualTimeScheduler = (function (__super__) {
    inherits(VirtualTimeScheduler, __super__);
     
    /**
    * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer.
    Severity: Major
    Found in modules/rx-core-testing/rx.core.testing.js - About 4 hrs to fix

      Function TestScheduler has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Rx.TestScheduler = (function (__super__) {
      inherits(TestScheduler, __super__);
       
      function baseComparer(x, y) {
      return x > y ? 1 : (x < y ? -1 : 0);
      Severity: Major
      Found in modules/rx-core-testing/rx.core.testing.js - About 2 hrs to fix

        Function baseIsEqualDeep has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function baseIsEqualDeep(object, other, equalFunc, isLoose, stackA, stackB) {
        var objIsArr = isArray(object),
        othIsArr = isArray(other),
        objTag = arrayTag,
        othTag = arrayTag;
        Severity: Minor
        Found in modules/rx-core-testing/rx.core.testing.js - About 1 hr to fix

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

          function equalObjects(object, other, equalFunc, isLoose, stackA, stackB) {
          var objProps = keys(object),
          objLength = objProps.length,
          othProps = keys(other),
          othLength = othProps.length;
          Severity: Minor
          Found in modules/rx-core-testing/rx.core.testing.js - About 1 hr to fix

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

            var HotObservable = (function (__super__) {
            inherits(HotObservable, __super__);
             
            function HotObservable(scheduler, messages) {
            __super__.call(this);
            Severity: Minor
            Found in modules/rx-core-testing/rx.core.testing.js - About 1 hr to fix

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

              var keys = Object.keys || (function() {
              var hasOwnProperty = Object.prototype.hasOwnProperty,
              hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'),
              dontEnums = [
              'toString',
              Severity: Minor
              Found in modules/rx-core-testing/rx.core.testing.js - About 1 hr to fix

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

                var ColdObservable = (function (__super__) {
                inherits(ColdObservable, __super__);
                 
                function ColdObservable(scheduler, messages) {
                __super__.call(this);
                Severity: Minor
                Found in modules/rx-core-testing/rx.core.testing.js - About 1 hr to fix

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

                  function equalArrays(array, other, equalFunc, isLoose, stackA, stackB) {
                  var index = -1,
                  arrLength = array.length,
                  othLength = other.length;
                   
                   
                  Severity: Minor
                  Found in modules/rx-core-testing/rx.core.testing.js - About 1 hr to fix

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

                    MockPromise.prototype.then = function (onResolved, onRejected) {
                    var self = this;
                     
                    this.subscriptions.push(new Subscription(this.scheduler.clock));
                    var index = this.subscriptions.length - 1;
                    Severity: Minor
                    Found in modules/rx-core-testing/rx.core.testing.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                      if (objCtor !== othCtor &&
                      ('constructor' in object && 'constructor' in other) &&
                      !(typeof objCtor === 'function' && objCtor instanceof objCtor &&
                      typeof othCtor === 'function' && othCtor instanceof othCtor)) {
                      return false;
                      Severity: Major
                      Found in modules/rx-core-testing/rx.core.testing.js - About 1 hr to fix

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

                        function equalArrays(array, other, equalFunc, isLoose, stackA, stackB) {
                        Severity: Minor
                        Found in modules/rx-core-testing/rx.core.testing.js - About 45 mins to fix

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

                          function baseIsEqualDeep(object, other, equalFunc, isLoose, stackA, stackB) {
                          Severity: Minor
                          Found in modules/rx-core-testing/rx.core.testing.js - About 45 mins to fix

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

                            function equalObjects(object, other, equalFunc, isLoose, stackA, stackB) {
                            Severity: Minor
                            Found in modules/rx-core-testing/rx.core.testing.js - About 45 mins to fix

                              Function baseIsEqual has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              function baseIsEqual(value, other, isLoose, stackA, stackB) {
                              Severity: Minor
                              Found in modules/rx-core-testing/rx.core.testing.js - About 35 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                return true;
                                Severity: Major
                                Found in modules/rx-core-testing/rx.core.testing.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                  return result;
                                  Severity: Major
                                  Found in modules/rx-core-testing/rx.core.testing.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                    return true;
                                    Severity: Major
                                    Found in modules/rx-core-testing/rx.core.testing.js - About 30 mins to fix

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

                                      var VirtualTimeScheduler = Rx.VirtualTimeScheduler = (function (__super__) {
                                      inherits(VirtualTimeScheduler, __super__);
                                       
                                      /**
                                      * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer.
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 1 other location - About 1 wk to fix
                                      src/core/concurrency/virtualtimescheduler.js on lines 2..194

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

                                      function baseIsEqualDeep(object, other, equalFunc, isLoose, stackA, stackB) {
                                      var objIsArr = isArray(object),
                                      othIsArr = isArray(other),
                                      objTag = arrayTag,
                                      othTag = arrayTag;
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 3 other locations - About 2 days to fix
                                      modules/rx-lite-compat/rx.lite.compat.js on lines 846..905
                                      modules/rx-lite/rx.lite.js on lines 497..556
                                      src/core/internal/isequal.js on lines 224..283

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

                                      function equalObjects(object, other, equalFunc, isLoose, stackA, stackB) {
                                      var objProps = keys(object),
                                      objLength = objProps.length,
                                      othProps = keys(other),
                                      othLength = othProps.length;
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 4 other locations - About 1 day to fix
                                      modules/rx-lite-compat/rx.lite.compat.js on lines 705..745
                                      modules/rx-lite/rx.lite.js on lines 356..396
                                      src/core/internal/isequal.js on lines 83..123
                                      src/modular/internal/isequal.js on lines 83..123

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

                                      var Notification = Rx.Notification = (function () {
                                      function Notification() {
                                       
                                      }
                                       
                                       
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 3 other locations - About 1 day to fix
                                      modules/rx-lite-compat/rx.lite.compat.js on lines 1780..1825
                                      modules/rx-lite/rx.lite.js on lines 1431..1476
                                      src/core/notification.js on lines 4..49

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

                                      var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
                                      function createTick(self) {
                                      return function tick(command, recurse) {
                                      recurse(0, self._period);
                                      var state = tryCatch(self._action)(self._state);
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 1 other location - About 1 day to fix
                                      modules/rx-core/rx.core.js on lines 600..629

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

                                      var Observer = Rx.Observer,
                                      Observable = Rx.Observable,
                                      Disposable = Rx.Disposable,
                                      disposableEmpty = Disposable.empty,
                                      disposableCreate = Disposable.create,
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 1 other location - About 6 hrs to fix
                                      src/core/headers/core-testheader.js on lines 2..15

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

                                      var OnErrorNotification = (function (__super__) {
                                      inherits(OnErrorNotification, __super__);
                                      function OnErrorNotification(error) {
                                      this.error = error;
                                      this.kind = 'E';
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 3 other locations - About 6 hrs to fix
                                      modules/rx-lite-compat/rx.lite.compat.js on lines 1849..1869
                                      modules/rx-lite/rx.lite.js on lines 1500..1520
                                      src/core/notification.js on lines 73..93

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

                                      var OnNextNotification = (function (__super__) {
                                      inherits(OnNextNotification, __super__);
                                      function OnNextNotification(value) {
                                      this.value = value;
                                      this.kind = 'N';
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 3 other locations - About 6 hrs to fix
                                      modules/rx-lite-compat/rx.lite.compat.js on lines 1827..1847
                                      modules/rx-lite/rx.lite.js on lines 1478..1498
                                      src/core/notification.js on lines 51..71

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

                                      var OnCompletedNotification = (function (__super__) {
                                      inherits(OnCompletedNotification, __super__);
                                      function OnCompletedNotification() {
                                      this.kind = 'C';
                                      }
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 3 other locations - About 4 hrs to fix
                                      modules/rx-lite-compat/rx.lite.compat.js on lines 1871..1890
                                      modules/rx-lite/rx.lite.js on lines 1522..1541
                                      src/core/notification.js on lines 95..114

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

                                      var isObject = Rx.internals.isObject = function(value) {
                                      var type = typeof value;
                                      return !!value && (type === 'object' || type === 'function');
                                      };
                                      Severity: Major
                                      Found in modules/rx-core-testing/rx.core.testing.js and 3 other locations - About 1 hr to fix
                                      modules/rx-lite-compat/rx.lite.compat.js on lines 768..771
                                      modules/rx-lite/rx.lite.js on lines 419..422
                                      src/core/internal/isequal.js on lines 146..149

                                      There are no issues that match your filters.

                                      Category
                                      Status