Showing 256 of 374 total issues
Function 23
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./polling-jsonp":23,"./polling-xhr":24,"./websocket":26,"xmlhttprequest":27}],23:[function(require,module,exports){
(function (global){
/**
* Module requirements.
Function 2
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./utils":2,"extend":6}],2:[function(require,module,exports){
var log = console.log;
require('date-format-lite');
require('fast-class');
require('array-sugar');
Function 3
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"array-sugar":3,"date-format-lite":4,"elapsed":5,"fast-class":7}],3:[function(require,module,exports){
(function (arr) {
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n); //thx to http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric
}
Consider simplifying this complex logical expression. Open
if (stringifySupported) {
// A test function object with a custom `toJSON` method.
(value = function () {
return 1;
}).toJSON = value;
Function 9
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
},{}],9:[function(require,module,exports){
/**
* Expose `debug()` as the module.
*/
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function expressionRewriting
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
ko.expressionRewriting = (function () {
var javaScriptReservedWords = ["true", "false", "null", "undefined"];
// Matches something that can be assigned to--either an isolated identifier or something ending with a property accessor
// This is designed to be simple and avoid false negatives, but could produce false positives (e.g., a+b.c).
Function 5
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
},{}],5:[function(require,module,exports){
function Elapsed (from, to) {
this.from = from;
this.to = to || new Date();
if (!(this.from instanceof Date && this.to instanceof Date)) return;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File index.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
var ioc = require('socket.io/node_modules/socket.io-client');
require('../../lib/common/utils.js');
var Msg = require('../../lib/common/Msg.js');
var ko = require('knockout');
var stringformat = require('stringformat');
Function 26
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../transport":21,"component-inherit":28,"debug":9,"engine.io-parser":29,"parseqs":39,"xmlhttprequest":27}],26:[function(require,module,exports){
/**
* Module dependencies.
*/
Function lex
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
var lex = function () {
var source = Source, length = source.length, value, begin, position, isSigned, charCode;
while (Index < length) {
charCode = source.charCodeAt(Index);
switch (charCode) {
Function 22
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
},{"component-emitter":17,"engine.io-parser":29}],22:[function(require,module,exports){
(function (global){
/**
* Module dependencies
*/
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function update
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
'update': function (element, valueAccessor, allBindings) {
function selectedOptions() {
return ko.utils.arrayFilter(element.options, function (node) { return node.selected; });
}
Function 48
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],48:[function(require,module,exports){
(function (global){
/*global Blob,File*/
/**
Function 26
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
},{"../transport":21,"component-inherit":28,"debug":9,"engine.io-parser":29,"parseqs":39,"xmlhttprequest":27}],26:[function(require,module,exports){
/**
* Module dependencies.
*/
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onPartialStatus
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
'onPartialStatus': function(status) {
//console.warn('partial status', status);
switch (status && status.what) {
case 'agent':
update.call(this, this.agents);
Function onPartialStatus
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
'onPartialStatus': function(status) {
//console.warn('partial status', status);
switch (status && status.what) {
case 'agent':
update.call(this, this.agents);
Function applyMask
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyMask(mask) {
var x, y, r3x, r3y;
switch (mask) {
case 0:
Function setDomNodeChildrenFromArrayMapping
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
ko.utils.setDomNodeChildrenFromArrayMapping = function (domNode, array, mapping, options, callbackAfterAddingNodes) {
// Compare the provided array against the previous one
array = array || [];
options = options || {};
var isFirstExecution = ko.utils.domData.get(domNode, lastMappingResultDomDataKey) === undefined;
Function evaluateImmediate
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function evaluateImmediate(suppressChangeNotification) {
if (_isBeingEvaluated) {
if (pure) {
throw Error("A 'pure' computed must not be called recursively");
}
Function applyBindingsToNodeInternal
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyBindingsToNodeInternal(node, sourceBindings, bindingContext, bindingContextMayDifferFromDomParentElement) {
// Prevent multiple applyBindings calls for the same node, except when a binding value is specified
var alreadyBound = ko.utils.domData.get(node, boundElementDomDataKey);
if (!sourceBindings) {
if (alreadyBound) {