Showing 13 of 24 total issues
File rethink.js
has 544 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* jshint undef: true, unused: true, latedef: nofunc*/
/*eslint no-use-before-define:0, no-extra-parens:0, consistent-this:0*/
'use strict';
var r;
Function autoupdate
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
RethinkDB.prototype.autoupdate = function(models, done) {
debug('autoupdate');
var _this = this;
if((!done) && ('function' === typeof models)) {
Function autoupdate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
RethinkDB.prototype.autoupdate = function(models, done) {
debug('autoupdate');
var _this = this;
if((!done) && ('function' === typeof models)) {
- 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 initializeDataSource
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.initialize = function initializeDataSource(dataSource, callback) {
debug('initialize');
var s = dataSource.settings;
Function createAllPromise
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createAllPromise = function(model, filter) {
var _this = this;
if(!filter) {
filter = {};
Function isActual
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
RethinkDB.prototype.isActual = function(cb) {
debug('isActual');
var _this = this;
r.db(_this.database).tableList().run()
Function save
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
RethinkDB.prototype.save = function(model, data, callback, strict, returnObject) {
debug('save');
var _this = this;
if(strict === undefined) {
Function buildFilter
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildFilter(where) {
var filter = [];
Object.keys(where).forEach(function(k) {
Function createIndices
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createIndices(model) {
var properties = _this._models[model].properties;
var settings = _this._models[model].settings;
var indexCollection = _.extend({}, properties, settings);
Function promises
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var promises = Object.keys(_this._models).map(function(model) {
if(!actual) {
cb(null, false);
return;
}
Function createAllPromise
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var createAllPromise = function(model, filter) {
var _this = this;
if(!filter) {
filter = {};
- 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 initializeDataSource
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.initialize = function initializeDataSource(dataSource, callback) {
debug('initialize');
var s = dataSource.settings;
- 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 save
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
RethinkDB.prototype.save = function(model, data, callback, strict, returnObject) {