Reactive-Extensions/RxJS

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

Summary

Maintainability
F
1 mo
Test Coverage

Showing 23 of 23 total issues

File rx.core.binding.js has 571 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-binding/rx.core.binding.js - About 1 day to fix

    Function ReplaySubject has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
     
    var maxSafeInteger = Math.pow(2, 53) - 1;
     
    function createRemovableDisposable(subject, observer) {
    Severity: Major
    Found in modules/rx-core-binding/rx.core.binding.js - About 3 hrs to fix

      Function AsyncSubject has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
      inherits(AsyncSubject, __super__);
       
      /**
      * Creates a subject that can only receive one value and that value is cached for all future observations.
      Severity: Major
      Found in modules/rx-core-binding/rx.core.binding.js - About 2 hrs to fix

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

        var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
        inherits(BehaviorSubject, __super__);
        function BehaviorSubject(value) {
        __super__.call(this);
        this.value = value;
        Severity: Major
        Found in modules/rx-core-binding/rx.core.binding.js - About 2 hrs to fix

          Function Subject has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var Subject = Rx.Subject = (function (__super__) {
          inherits(Subject, __super__);
          function Subject() {
          __super__.call(this);
          this.isDisposed = false;
          Severity: Major
          Found in modules/rx-core-binding/rx.core.binding.js - About 2 hrs to fix

            Function ScheduledObserver has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
            inherits(ScheduledObserver, __super__);
             
            function ScheduledObserver(scheduler, observer) {
            __super__.call(this);
            Severity: Major
            Found in modules/rx-core-binding/rx.core.binding.js - About 2 hrs to fix

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

              var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
              inherits(ConnectableObservable, __super__);
              function ConnectableObservable(source, subject) {
              this.source = source;
              this._connection = null;
              Severity: Minor
              Found in modules/rx-core-binding/rx.core.binding.js - About 1 hr to fix

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

                var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
                 
                var maxSafeInteger = Math.pow(2, 53) - 1;
                 
                function createRemovableDisposable(subject, observer) {
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 1 other location - About 1 wk to fix
                src/core/subjects/replaysubject.js on lines 5..133

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

                var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
                inherits(BehaviorSubject, __super__);
                function BehaviorSubject(value) {
                __super__.call(this);
                this.value = value;
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 2 other locations - About 4 days to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 7156..7253
                modules/rx-lite/rx.lite.js on lines 6807..6904

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

                var Subject = Rx.Subject = (function (__super__) {
                inherits(Subject, __super__);
                function Subject() {
                __super__.call(this);
                this.isDisposed = false;
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 1 other location - About 3 days to fix
                src/core/subjects/subject.js on lines 5..97

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

                var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
                inherits(ScheduledObserver, __super__);
                 
                function ScheduledObserver(scheduler, observer) {
                __super__.call(this);
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 3 other locations - About 3 days to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 2399..2462
                modules/rx-lite/rx.lite.js on lines 1784..1847
                src/core/scheduledobserver.js on lines 1..64

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

                var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
                inherits(ConnectableObservable, __super__);
                function ConnectableObservable(source, subject) {
                this.source = source;
                this._connection = null;
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 3 other locations - About 2 days to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 5713..5756
                modules/rx-lite/rx.lite.js on lines 5364..5407
                src/core/linq/connectableobservable.js on lines 33..76

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

                var RefCountObservable = (function (__super__) {
                inherits(RefCountObservable, __super__);
                function RefCountObservable(source) {
                this.source = source;
                this._count = 0;
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 3 other locations - About 1 day to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 5681..5711
                modules/rx-lite/rx.lite.js on lines 5332..5362
                src/core/linq/connectableobservable.js on lines 1..31

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

                var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
                inherits(AnonymousSubject, __super__);
                function AnonymousSubject(observer, observable) {
                this.observer = observer;
                this.observable = observable;
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 2 other locations - About 1 day to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 7126..7150
                modules/rx-lite/rx.lite.js on lines 6777..6801

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

                var Observable = Rx.Observable,
                observableProto = Observable.prototype,
                AnonymousObservable = Rx.AnonymousObservable,
                ObservableBase = Rx.ObservableBase,
                Observer = Rx.Observer,
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 1 other location - About 7 hrs to fix
                src/core/headers/core-bindingheader.js on lines 1..16

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

                var MulticastObservable = (function (__super__) {
                inherits(MulticastObservable, __super__);
                function MulticastObservable(source, fn1, fn2) {
                this.source = source;
                this._fn1 = fn1;
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 3 other locations - About 6 hrs to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 5527..5542
                modules/rx-lite/rx.lite.js on lines 5178..5193
                src/core/linq/observable/multicast.js on lines 1..16

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

                InnerSubscription.prototype.dispose = function () {
                if (!this._s.isDisposed && this._o !== null) {
                var idx = this._s.observers.indexOf(this._o);
                this._s.observers.splice(idx, 1);
                this._o = null;
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 2 other locations - About 3 hrs to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 6908..6914
                modules/rx-lite/rx.lite.js on lines 6559..6565

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

                observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
                return selector && isFunction(selector) ?
                this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
                this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
                };
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 2 other locations - About 2 hrs to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 5656..5660
                modules/rx-lite/rx.lite.js on lines 5307..5311

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

                function cloneArray(arr) {
                var len = arr.length, a = new Array(len);
                for(var i = 0; i < len; i++) { a[i] = arr[i]; }
                return a;
                }
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 2 other locations - About 1 hr to fix
                src/core/headers/bindingheader.js on lines 19..23
                src/core/headers/core-bindingheader.js on lines 19..23

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

                observableProto.publishValue = function (initialValueOrSelector, initialValue) {
                return arguments.length === 2 ?
                this.multicast(function () {
                return new BehaviorSubject(initialValue);
                }, initialValueOrSelector) :
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 2 other locations - About 1 hr to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 5622..5628
                modules/rx-lite/rx.lite.js on lines 5273..5279

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

                observableProto.publishLast = function (selector) {
                return selector && isFunction(selector) ?
                this.multicast(function () { return new AsyncSubject(); }, selector) :
                this.multicast(new AsyncSubject());
                };
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 5 other locations - About 1 hr to fix
                modules/rx-core-binding/rx.core.binding.js on lines 131..135
                modules/rx-lite-compat/rx.lite.compat.js on lines 5578..5582
                modules/rx-lite-compat/rx.lite.compat.js on lines 5604..5608
                modules/rx-lite/rx.lite.js on lines 5229..5233
                modules/rx-lite/rx.lite.js on lines 5255..5259

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

                observableProto.publish = function (selector) {
                return selector && isFunction(selector) ?
                this.multicast(function () { return new Subject(); }, selector) :
                this.multicast(new Subject());
                };
                Severity: Major
                Found in modules/rx-core-binding/rx.core.binding.js and 5 other locations - About 1 hr to fix
                modules/rx-core-binding/rx.core.binding.js on lines 157..161
                modules/rx-lite-compat/rx.lite.compat.js on lines 5578..5582
                modules/rx-lite-compat/rx.lite.compat.js on lines 5604..5608
                modules/rx-lite/rx.lite.js on lines 5229..5233
                modules/rx-lite/rx.lite.js on lines 5255..5259

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

                observableProto.multicast = function (subjectOrSubjectSelector, selector) {
                return isFunction(subjectOrSubjectSelector) ?
                new MulticastObservable(this, subjectOrSubjectSelector, selector) :
                new ConnectableObservable(this, subjectOrSubjectSelector);
                };
                Severity: Minor
                Found in modules/rx-core-binding/rx.core.binding.js and 2 other locations - About 35 mins to fix
                modules/rx-lite-compat/rx.lite.compat.js on lines 5561..5565
                modules/rx-lite/rx.lite.js on lines 5212..5216
                Category
                Status