File rx.core.js
has 936 lines of code (exceeds 250 allowed). Consider refactoring.
;(function (undefined) {
var objectTypes = {
Function DefaultScheduler
has 49 lines of code (exceeds 25 allowed). Consider refactoring.
var DefaultScheduler = (function (__super__) {
inherits(DefaultScheduler, __super__);
function DefaultScheduler() {
__super__.call(this);
}
Function Observable
has 37 lines of code (exceeds 25 allowed). Consider refactoring.
var Observable = Rx.Observable = (function () {
function makeSubscribe(self, subscribe) {
return function (o) {
var oldOnError = o.onError;
Function AbstractObserver
has 32 lines of code (exceeds 25 allowed). Consider refactoring.
var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
inherits(AbstractObserver, __super__);
* Creates a new observer in a non-stopped state.
Function AutoDetachObserver
has 31 lines of code (exceeds 25 allowed). Consider refactoring.
var AutoDetachObserver = (function (__super__) {
inherits(AutoDetachObserver, __super__);
function AutoDetachObserver(observer) {
__super__.call(this);
Function CurrentThreadScheduler
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
var CurrentThreadScheduler = (function (__super__) {
var queue;
function runTrampoline () {
while (queue.length > 0) {
Function AnonymousObservable
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
inherits(AnonymousObservable, __super__);
function fixSubscriber(subscriber) {
Consider simplifying this complex logical expression.
if (hasStacks &&
observable.stack &&
typeof error === 'object' &&
error !== null &&
error.stack &&
Function ScheduledItem
has 5 arguments (exceeds 4 allowed). Consider refactoring.
var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
Similar blocks of code found in 4 locations. Consider refactoring.
(function () {
var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
clearMethod = function (handle) {
Similar blocks of code found in 4 locations. Consider refactoring.
var Observable = Rx.Observable = (function () {
function makeSubscribe(self, subscribe) {
return function (o) {
var oldOnError = o.onError;
Similar blocks of code found in 4 locations. Consider refactoring.
var DefaultScheduler = (function (__super__) {
inherits(DefaultScheduler, __super__);
function DefaultScheduler() {
__super__.call(this);
}
Similar blocks of code found in 4 locations. Consider refactoring.
(function (schedulerProto) {
function invokeRecImmediate(scheduler, pair) {
var state = pair[0], action = pair[1], group = new CompositeDisposable();
action(state, innerAction);
src/core/concurrency/scheduler.recursive.js on lines 1..76 Similar blocks of code found in 3 locations. Consider refactoring.
var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
inherits(AbstractObserver, __super__);
* Creates a new observer in a non-stopped state.
Similar blocks of code found in 4 locations. Consider refactoring.
var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
inherits(AnonymousObservable, __super__);
function fixSubscriber(subscriber) {
Similar blocks of code found in 4 locations. Consider refactoring.
var Scheduler = Rx.Scheduler = (function () {
function Scheduler() { }
Similar blocks of code found in 4 locations. Consider refactoring.
var ObservableBase = Rx.ObservableBase = (function (__super__) {
inherits(ObservableBase, __super__);
function fixSubscriber(subscriber) {
return subscriber && isFunction(subscriber.dispose) ? subscriber :
Similar blocks of code found in 4 locations. Consider refactoring.
var CurrentThreadScheduler = (function (__super__) {
var queue;
function runTrampoline () {
while (queue.length > 0) {
src/core/concurrency/currentthreadscheduler.js on lines 4..38 Similar blocks of code found in 2 locations. Consider refactoring.
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);
Similar blocks of code found in 4 locations. Consider refactoring.
priorityProto.heapify = function (index) {
+index || (index = 0);
if (index >= this.length || index < 0) { return; }
var left = 2 * index + 1,
right = 2 * index + 2,
Similar blocks of code found in 2 locations. Consider refactoring.
var
noop = Rx.helpers.noop = function () { },
defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()),
defaultError = Rx.helpers.defaultError = function (err) { throw err; },
isPromise = Rx.helpers.isPromise = function (p) { return !!p && !isFunction(p.subscribe) && isFunction(p.then); },
Similar blocks of code found in 4 locations. Consider refactoring.
var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
inherits(AnonymousObserver, __super__);
* Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
Identical blocks of code found in 4 locations. Consider refactoring.
function makeStackTraceLong(error, observable) {
if (hasStacks &&
observable.stack &&
src/core/longstacktraces/longstacktraces.js on lines 3..24 Identical blocks of code found in 3 locations. Consider refactoring.
CompositeDisposablePrototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var len = this.disposables.length, currentDisposables = new Array(len);
for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
Identical blocks of code found in 4 locations. Consider refactoring.
var CompositeDisposable = Rx.CompositeDisposable = function () {
var args = [], i, len;
if (Array.isArray(arguments[0])) {
args = arguments[0];
} else {
src/core/disposables/compositedisposable.js on lines 5..17 Identical blocks of code found in 4 locations. Consider refactoring.
priorityProto.percolate = function (index) {
if (index >= this.length || index < 0) { return; }
var parent = index - 1 >> 1;
if (parent < 0 || parent === index) { return; }
if (this.isHigherPriority(index, parent)) {
Identical blocks of code found in 4 locations. Consider refactoring.
var addProperties = Rx.internals.addProperties = function (obj) {
for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
for (var idx = 0, ln = sources.length; idx < ln; idx++) {
var source = sources[idx];
for (var prop in source) {
Identical blocks of code found in 3 locations. Consider refactoring.
function getFileNameAndLineNumber(stackLine) {
var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
Similar blocks of code found in 4 locations. Consider refactoring.
var localTimer = (function () {
var localSetTimeout, localClearTimeout = noop;
if (!!root.setTimeout) {
localSetTimeout = root.setTimeout;
localClearTimeout = root.clearTimeout;
src/core/concurrency/defaultscheduler.js on lines 3..21 Similar blocks of code found in 3 locations. Consider refactoring.
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
root.Rx = Rx;
define(function() {
return Rx;
Identical blocks of code found in 4 locations. Consider refactoring.
function captureLine() {
if (!hasStacks) { return; }
try {
throw new Error();
Similar blocks of code found in 2 locations. Consider refactoring.
(function (schedulerProto) {
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
src/core/concurrency/scheduler.periodic.js on lines 1..17 Identical blocks of code found in 4 locations. Consider refactoring.
function filterStackString(stackString) {
var lines = stackString.split('\n'), desiredLines = [];
for (var i = 0, len = lines.length; i < len; i++) {
var line = lines[i];
Identical blocks of code found in 4 locations. Consider refactoring.
CompositeDisposablePrototype.remove = function (item) {
var shouldDispose = false;
if (!this.isDisposed) {
var idx = this.disposables.indexOf(item);
if (idx !== -1) {
Similar blocks of code found in 2 locations. Consider refactoring.
isFunction = Rx.helpers.isFunction = (function () {
var isFn = function (value) {
return typeof value == 'function' || false;
};
Identical blocks of code found in 4 locations. Consider refactoring.
var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
this.scheduler = scheduler;
this.state = state;
this.action = action;
this.dueTime = dueTime;
src/core/concurrency/scheduleditem.js on lines 1..8 Identical blocks of code found in 4 locations. Consider refactoring.
SerialDisposable.prototype.setDisposable = function (value) {
var shouldDispose = this.isDisposed;
if (!shouldDispose) {
var old = this.current;
this.current = value;
Identical blocks of code found in 4 locations. Consider refactoring.
priorityProto.remove = function (item) {
for (var i = 0; i < this.length; i++) {
if (this.items[i].value === item) {
this.removeAt(i);
return true;
Similar blocks of code found in 4 locations. Consider refactoring.
var ImmediateScheduler = (function (__super__) {
inherits(ImmediateScheduler, __super__);
function ImmediateScheduler() {
__super__.call(this);
}
src/core/concurrency/immediatescheduler.js on lines 2..13 Identical blocks of code found in 4 locations. Consider refactoring.
SingleAssignmentDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var old = this.current;
this.current = null;
Identical blocks of code found in 4 locations. Consider refactoring.
SerialDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var old = this.current;
this.current = null;
Identical blocks of code found in 4 locations. Consider refactoring.
priorityProto.removeAt = function (index) {
this.items[index] = this.items[--this.length];
this.items[this.length] = undefined;
this.heapify();
};
Identical blocks of code found in 4 locations. Consider refactoring.
function isInternalFrame(stackLine) {
var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
if (!fileNameAndLineNumber) {
return false;
}
Identical blocks of code found in 4 locations. Consider refactoring.
var inherits = Rx.internals.inherits = function (child, parent) {
function __() { this.constructor = child; }
__.prototype = parent.prototype;
child.prototype = new __();
};
Identical blocks of code found in 4 locations. Consider refactoring.
CompositeDisposablePrototype.add = function (item) {
if (this.isDisposed) {
item.dispose();
} else {
this.disposables.push(item);
Similar blocks of code found in 4 locations. Consider refactoring.
var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
onNext || (onNext = noop);
onError || (onError = defaultError);
onCompleted || (onCompleted = noop);
return new AnonymousObserver(onNext, onError, onCompleted);
Identical blocks of code found in 4 locations. Consider refactoring.
priorityProto.enqueue = function (item) {
var index = this.length++;
this.items[index] = new IndexedItem(PriorityQueue.count++, item);
this.percolate(index);
};
Identical blocks of code found in 4 locations. Consider refactoring.
var addRef = Rx.internals.addRef = function (xs, r) {
return new AnonymousObservable(function (observer) {
return new BinaryDisposable(r.getDisposable(), xs.subscribe(observer));
});
};
Identical blocks of code found in 3 locations. Consider refactoring.
function arrayInitialize(count, factory) {
var a = new Array(count);
for (var i = 0; i < count; i++) {
a[i] = factory();
}
Identical blocks of code found in 4 locations. Consider refactoring.
var BinaryDisposable = Rx.BinaryDisposable = function (first, second) {
this._first = first;
this._second = second;
this.isDisposed = false;
};
src/core/disposables/binarydisposable.js on lines 1..5 Identical blocks of code found in 4 locations. Consider refactoring.
var Disposable = Rx.Disposable = function (action) {
this.isDisposed = false;
this.action = action || noop;
};
Identical blocks of code found in 4 locations. Consider refactoring.
var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
this.items = new Array(capacity);
this.length = 0;
};
Identical blocks of code found in 4 locations. Consider refactoring.
priorityProto.isHigherPriority = function (left, right) {
return this.items[left].compareTo(this.items[right]) < 0;
};
Similar blocks of code found in 10 locations. Consider refactoring.
var NotSupportedError = Rx.NotSupportedError = function (message) {
this.message = message || 'This operation is not supported';
Error.call(this);
};
Similar blocks of code found in 10 locations. Consider refactoring.
var NotImplementedError = Rx.NotImplementedError = function (message) {
this.message = message || 'This operation is not implemented';
Error.call(this);
};
Identical blocks of code found in 3 locations. Consider refactoring.
var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
Identical blocks of code found in 3 locations. Consider refactoring.
ScheduledItem.prototype.invokeCore = function () {
return disposableFixup(this.action(this.scheduler, this.state));
};
There are no issues that match your filters.