Function methods
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
get methods() {
let _this = this;
return {
File ExtendModel.js
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Created by Stefan Hariton on 6/26/15.
*/
'use strict';
Function methods
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
get methods() {
let _this = this;
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
Function _registerQueryWrappers
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_registerQueryWrappers() {
this._model.setPartition = function(partition) {
this[ExtendModel.PARTITION_KEY] = partition;
};
Function _findUntilLimit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_findUntilLimit(query, limit, _scannedCount = 0, _accumulator = [], _lastKey = null) {
return new Promise((resolve, reject) => {
if (_lastKey) {
query.startKey(_lastKey);
}
Function _applyRumDecorator
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_applyRumDecorator(method, eventName) {
return (...args) => {
if (!this.model.logService) {
return method(...args);
}
Function _registerQueryWrappers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_registerQueryWrappers() {
this._model.setPartition = function(partition) {
this[ExtendModel.PARTITION_KEY] = partition;
};
- 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 _findUntilLimit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_findUntilLimit(query, limit, _scannedCount = 0, _accumulator = [], _lastKey = null) {
Function findAllByPaginated
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
findAllByPaginated: function(fieldName, value, startKey, limit, cb) {
Function inject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
inject(methods = null) {
let predefinedMethods = this.methods;
let predefinedMethodsNames = Object.keys(predefinedMethods);
methods = methods || predefinedMethodsNames;
- 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"