Showing 10 of 32 total issues
Function buildSelect
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
buildSelect(query) {
var sql = 'SELECT ',
columns = query.query.columns,
cols = [],
joins = query.query.join;
- 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 _buildQwhereClause
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_buildQwhereClause(query, wheres, from) {
for(var where of wheres) {
if(from && from.alias) {
where.column = where.column.replace(from.alias + '.', '');
}
- 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 getColumns
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
getColumns(table) {
var self = this;
return this.getConnection()
.then(function(connection) {
Function buildSelect
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildSelect(query) {
var sql = 'SELECT ',
columns = query.query.columns,
cols = [],
joins = query.query.join;
Function Wherable
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Wherable = function(parent) {
return class extends parent {
/**
* The where function will add a filter to the query.
*
Function _buildQwhereClause
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_buildQwhereClause(query, wheres, from) {
for(var where of wheres) {
if(from && from.alias) {
where.column = where.column.replace(from.alias + '.', '');
}
Function select
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
select(name, alias) {
this.last = 'select';
if(name.toString() === '[object Object]') {
for(var index in name) {
- 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 getInstance
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getInstance(instance) {
if(!this.instances[instance]) {
var config = this.config[instance];
if(!config) {
- 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 _buildWhereClause
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_buildWhereClause(wheres) {
var sql = '';
if(wheres.length) {
sql += ' WHERE';
- 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 _buildHavingClause
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_buildHavingClause(havings) {
var sql = '';
if(havings.length) {
sql += ' HAVING';
- 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"