Reactive-Extensions/RxJS

View on GitHub

Showing 2,890 of 2,890 total issues

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

var r3 : Rx.Observable<number> = o.combineLatest(<any[]>[io, so, p], (v1, items) => 5);
Severity: Minor
Found in ts/core/linq/observable/combinelatestproto.ts and 1 other location - About 30 mins to fix
ts/core/linq/observable/withlatestfrom.ts on lines 60..60

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

voronoi.y = function(_) {
return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;
};
Severity: Minor
Found in examples/assets/d3/d3.js and 1 other location - About 30 mins to fix
examples/assets/d3/d3.js on lines 5420..5422

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

TestScheduler.prototype.createRejectedPromise = function (ticks, reason) {
return new MockPromise(this, [ReactiveTest.onError(ticks, reason)]);
};
Severity: Minor
Found in src/modular/dist/rx.all.js and 1 other location - About 30 mins to fix
src/modular/testing/testscheduler.js on lines 146..148

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

fromNodeCallback<TResult, T1, T2, T3, T4>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => any) => any, context?: any, selector?: Function): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable<TResult>;
Severity: Minor
Found in ts/core/linq/observable/fromnodecallback.ts and 2 other locations - About 30 mins to fix
ts/core/linq/observable/fromcallback.ts on lines 49..49
ts/core/linq/observable/toasync.ts on lines 43..43

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

var rr : Rx.Observable<number> = o.withLatestFrom(<any[]>[io, so, p], (v1, items) => 5);
Severity: Minor
Found in ts/core/linq/observable/withlatestfrom.ts and 1 other location - About 30 mins to fix
ts/core/linq/observable/combinelatestproto.ts on lines 198..198

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

if (dt.x < 0) {
dir = 'left';
} else if (dt.x > 0) {
dir = 'right';
}
Severity: Minor
Found in examples/mario/index.js and 1 other location - About 30 mins to fix
examples/mario/index.js on lines 79..83

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

if (e.sourceURL) {
file = e.sourceURL;
}
else if (e.fileName) {
file = e.fileName;
Severity: Minor
Found in examples/testing/jasmine/lib/jasmine-1.3.1/jasmine.js and 1 other location - About 30 mins to fix
examples/testing/jasmine/lib/jasmine-1.3.1/jasmine.js on lines 669..674

Function toString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

jasmine.MessageResult.prototype.toString = function() {
var text = "";
for (var i = 0; i < this.values.length; i++) {
if (i > 0) text += " ";
if (jasmine.isString_(this.values[i])) {
Severity: Minor
Found in examples/testing/jasmine/lib/jasmine-1.3.1/jasmine.js - About 25 mins to fix

Function contains_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

jasmine.Env.prototype.contains_ = function(haystack, needle) {
if (jasmine.isArray_(haystack)) {
for (var i = 0; i < haystack.length; i++) {
if (this.equals_(haystack[i], needle)) return true;
}
Severity: Minor
Found in examples/testing/jasmine/lib/jasmine-1.3.1/jasmine.js - About 25 mins to fix

Function assertEqual has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

assertEqual: function (expected, actual, comparer, message) {
comparer || (comparer = Rx.internals.isEqual);
var isOk = true, i, len;
 
if (expected.length !== actual.length) {
Severity: Minor
Found in examples/testing/nodejs/collectionassert.js - About 25 mins to fix

Function cacheChars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

ut.WebGLRenderer.prototype.cacheChars = function(chars, build) {
"use strict";
if (!this.gl) return; // Nothing to do if not using WebGL renderer
var changed = false;
for (var i = 0; i < chars.length; ++i) {
Severity: Minor
Found in examples/pacman-unicode/unicodetiles/ut.WebGLRenderer.js - About 25 mins to fix

Function updateStyle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

ut.DOMRenderer.prototype.updateStyle = function(s) {
"use strict";
s = window.getComputedStyle(this.spans[0][0], null);
this.tw = parseInt(s.width, 10);
if (this.tw === 0 || isNaN(this.tw)) return; // Nothing to do, exit
Severity: Minor
Found in examples/pacman-unicode/unicodetiles/ut.DOMRenderer.js - About 25 mins to fix

Function reportRunnerResults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
var results = runner.results();
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
this.runnerDiv.setAttribute("class", className);
//do it twice for IE
Severity: Minor
Found in examples/testing/jasmine/lib/jasmine-1.3.1/jasmine-html.js - About 25 mins to fix

Function putString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

ut.Viewport.prototype.putString = function(str, x, y, r, g, b, br, bg, bb) {
var len = str.length;
var tile;
if (x < 0 || y < 0) return;
for (var i = 0; i < len; ++i) {
Severity: Minor
Found in examples/pacman-unicode/unicodetiles/unicodetiles.js - About 25 mins to fix

Function plucker has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function plucker(args, len) {
return function mapper(x) {
var currentProp = x;
for (var i = 0; i < len; i++) {
var p = currentProp[args[i]];
Severity: Minor
Found in src/modular/observable/pluck.js - About 25 mins to fix

Function next has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

DelayRelativeObserver.prototype.next = function (notification) {
var shouldRun;
if (notification.value.kind === 'E') {
this._s.q = [];
this._s.q.push(notification);
Severity: Minor
Found in src/modular/observable/delay.js - About 25 mins to fix

Function heapify has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

PriorityQueue.prototype.heapify = function (index) {
+index || (index = 0);
if (index >= this.length || index < 0) { return; }
var left = 2 * index + 1,
right = 2 * index + 2,
Severity: Minor
Found in src/modular/internal/priorityqueue.js - About 25 mins to fix

Function next has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

LastObserver.prototype.next = function (x) {
var shouldYield = false;
if (this._obj.predicate) {
var res = tryCatch(this._obj.predicate)(x, this._i++, this._s);
if (res === errorObj) { return this._o.onError(res.e); }
Severity: Minor
Found in src/modular/observable/last.js - About 25 mins to fix

Function next has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

ScanObserver.prototype.next = function (x) {
!this._hv && (this._hv = true);
if (this._ha) {
this._a = tryCatch(this._fn)(this._a, x, this._i, this._p);
} else {
Severity: Minor
Found in src/modular/observable/scan.js - About 25 mins to fix

Function delay has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function delay () {
var source = arguments[0], firstArg = arguments[1];
if (typeof firstArg === 'number' || firstArg instanceof Date) {
var dueTime = firstArg, scheduler = arguments[2];
Scheduler.isScheduler(scheduler) || (scheduler = Scheduler.async);
Severity: Minor
Found in src/modular/observable/delay.js - About 25 mins to fix
Severity
Category
Status
Source
Language