Showing 11 of 20 total issues
GenericModel
has 76 functions (exceeds 20 allowed). Consider refactoring. Open
class GenericModel extends bookshelf.Model {
/**
* The `GenericModel` params
* @description A mix of `bookshelf` and custom options (override this with the desired one)
File GenericModel.js
has 608 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
const ObjectUtils = require('@contartec-team/object-utils')
const validate = require('validate.js')
Function getQueryAll
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
static getQueryAll(params, model, queryBuilder, isWhere = true) {
const queryBoolean = isWhere ?
'where' :
'orWhere'
- 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 getQueryAll
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getQueryAll(params, model, queryBuilder, isWhere = true) {
const queryBoolean = isWhere ?
'where' :
'orWhere'
Function getAll
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getAll(params, fetchOptions = {}) {
const paramsTemp = { ...this.GET_ALL_DEFAULT_PARAMS, ...params }
const fetchOptionsTemp = { ...this.GET_ALL_DEFAULT_FETCH_OPTIONS, ...fetchOptions }
if (typeof(paramsTemp.orderBy) == 'string')
Function serialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
serialize(options) {
const optionsTemp = { ...this._SERIALIZE_OPTIONS, ...options }
let json = super
.serialize(optionsTemp)
- 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 _getAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getAttributes(object) {
let visibleAttributes = {}
if (this._hasVisibleAttributes()) {
const definedAttributes = this.getAttributes()
- 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 _getNotDefinedAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getNotDefinedAttributes(object) {
let notDefinedAttributes = {}
if (this._hasAttributes()) {
for (const attr in object) {
- 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 _getVisibleAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getVisibleAttributes(object) {
let visibleAttributes = {}
if (this._hasVisibleAttributes()) {
for (const attr in object) {
- 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 _getRelateds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getRelateds(object) {
const relateds = {}
if (this._hasRelateds()) {
for (const attr in object) {
- 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 _getHiddenAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getHiddenAttributes(object) {
let hiddenAttributes = {}
if (this._hasHiddenAttributes()) {
for (const attr in object) {
- 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"