Showing 88 of 160 total issues
Function objEquiv
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function objEquiv (a, b) {
if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
return false;
// an identical "prototype" property.
if (a.prototype !== b.prototype) return false;
Function 8
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"expect.js":2}],8:[function(require,module,exports){
function MockHttpHandler() {
this.resources = {};
this.latency = 2;
Function uint8ToBase64
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function uint8ToBase64 (uint8) {
var i,
extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
output = "",
temp, length
Function keys
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Assertion.prototype.keys = function ($keys) {
var str
, ok = true;
$keys = isArray($keys)
Function slice
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.slice = function (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
Function reduce
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function reduce (arr, fun) {
if (Array.prototype.reduce) {
return Array.prototype.reduce.apply(
arr
, Array.prototype.slice.call(arguments, 1)
Function 9
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],9:[function(require,module,exports){
function MockLocalStorage() {
this.values = {};
this.listeners = {};
Function save
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ResourceShadow.prototype.save = function() {
if (this.loading || this.saving) {
// changes will be detected at the end of current process
return;
}
Function save
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ResourceShadow.prototype.save = function() {
if (this.loading || this.saving) {
// changes will be detected at the end of current process
return;
}
Function nextTick
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
process.nextTick = (function () {
var canSetImmediate = typeof window !== 'undefined'
&& window.setImmediate;
var canPost = typeof window !== 'undefined'
&& window.postMessage && window.addEventListener
Function byteLength
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.byteLength = function (str, encoding) {
var ret
str = str + ''
switch (encoding || 'utf8') {
case 'ascii':
Function b64ToByteArray
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function b64ToByteArray (b64) {
var i, j, l, tmp, placeHolders, arr
if (b64.length % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
Function read
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.read = function(buffer, offset, isLE, mLen, nBytes) {
var e, m,
eLen = nBytes * 8 - mLen - 1,
eMax = (1 << eLen) - 1,
eBias = eMax >> 1,
Function throwException
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Assertion.prototype.throwException = function (fn) {
expect(this.obj).to.be.a('function');
var thrown = false
, not = this.flags.not;
Function 7
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
},{}],7:[function(require,module,exports){
(function (global){
global.when = function(){
var args = Array.prototype.slice.apply(arguments);
- 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 setLocalStorageValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
ResourceShadow.prototype.setLocalStorageValue = function(data) {
var json;
if (data === null || typeof data === 'undefined') {
json = null;
} else {
- 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 checkIEEE754
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function checkIEEE754 (buf, value, offset, ext, max, min) {
Avoid deeply nested control flow statements. Open
Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
Function checkInt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function checkInt (buf, value, offset, ext, max, min) {
Avoid deeply nested control flow statements. Open
Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}