Showing 8 of 42 total issues
Builder
has 126 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class Builder {
constructor (connection = null, grammar = null) {
this.bindings = {
select: [],
join: [],
File Builder.js
has 828 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Database from './Database'
import Expression from './Expression'
import {
isString,
isBoolean,
Grammar
has 94 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class Grammar {
constructor () {
this.tablePrefix = ''
this.operators = []
this.selectComponents = [
File Grammar.js
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Expression from './Expression'
import { isString, isNull, isUndefined, isObject } from './DataType'
import { upperCaseFirstLetter } from './Utilities'
export default class Grammar {
Function where
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
where (column, operator = null, value = null, boolean = 'and') {
if (Array.isArray(column)) {
return this.addArrayOfWheres(column, boolean)
}
Function where
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
where (column, operator = null, value = null, boolean = 'and') {
if (Array.isArray(column)) {
return this.addArrayOfWheres(column, boolean)
}
- 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 constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor (connection = null, grammar = null) {
this.bindings = {
select: [],
join: [],
where: [],
Avoid too many return
statements within this function. Open
Open
return this