Showing 146 of 197 total issues
File document.js
has 1062 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/*!
* Module dependencies.
*/
Function set
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
exports.set = function (path, val, o, special, map, _copying) {
var lookup;
if ('function' === typeof special) {
if (special.length < 2) {
- 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 set
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
Document.prototype.set = function (path, val, type, options) {
if (type && 'Object' === utils.getFunctionName(type.constructor)) {
options = type;
type = undefined;
}
- 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 exports
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
var webpack = require('webpack');
require('time-grunt')(grunt);
var webpack_karma = {
Function $toObject
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
Document.prototype.$toObject = function(options, json) {
var defaultOptions = { transform: true, json: json };
if (options && options.depopulate && !options._skipDepopulateTopLevel && this.$__.wasPopulated) {
// populated paths that we set to a document
- 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 parse
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parse (docs) {
docs.split(/^### /gm).forEach(function (chunk) {
if (!(chunk = chunk.trim())) return;
chunk = chunk.split(/^([^\n]+)\n/);
Function set
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Document.prototype.set = function (path, val, type, options) {
if (type && 'Object' === utils.getFunctionName(type.constructor)) {
options = type;
type = undefined;
}
File schema.js
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/*!
* Module dependencies.
*/
Function Document
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function Document ( data, collectionName, schema, fields, init ){
if ( !(this instanceof Document) ) {
return new Document( data, collectionName, schema, fields, init );
}
- 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 cast
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
DocumentArray.prototype.cast = function (value, doc, init, prev) {
var selected
, subdoc
, i;
- 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 init
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function init (self, obj, doc, prefix) {
prefix = prefix || '';
var keys = Object.keys(obj)
, len = keys.length
- 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 Document
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Document ( data, collectionName, schema, fields, init ){
if ( !(this instanceof Document) ) {
return new Document( data, collectionName, schema, fields, init );
}
Function write
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Binary.prototype.write = function write(string, offset) {
offset = typeof offset === 'number' ? offset : this.position;
// If the buffer is to small let's extend the buffer
if(this.buffer.length < offset + string.length) {
- 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 set
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.set = function (path, val, o, special, map, _copying) {
var lookup;
if ('function' === typeof special) {
if (special.length < 2) {
Function isSelected
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Document.prototype.isSelected = function isSelected (path) {
if (this.$__.selected) {
if ('_id' === path) {
return 0 !== this.$__.selected._id;
- 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 cast
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
ObjectId.prototype.cast = function ( value, doc, init, priorVal ) {
// lazy load
Document || (Document = require('./../document'));
if ( SchemaType._isRef( this, value ) ) {
- 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 exports
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
'use strict';
config.set({
// list of files / patterns to load in the browser
Function cast
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
SchemaBuffer.prototype.cast = function (value, doc, init) {
var ret;
if (SchemaType._isRef(this, value, doc, init)) {
// wait! we may need to cast this to a document
- 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 deferred.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/*
Standalone Deferred
Copyright 2012 Otto Vehviläinen
Function value
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Binary.prototype.value = function value(asRaw) {
asRaw = asRaw == null ? false : asRaw;
// Optimize to serialize for the situation where the data == size of buffer
if(asRaw && typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer) && this.buffer.length == this.position)
- 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"