Showing 503 of 787 total issues
Function _conformInclude
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
static _conformInclude(include, self) {
if (include) {
let model;
if (include._pseudo) return include;
- 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 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(source, target, options) {
super(source, target, options);
if (this.options.through === undefined || this.options.through === true || this.options.through === null) {
throw new AssociationError(
Function _handleQueryResponse
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
_handleQueryResponse(metaData, columnTypes, err, results) {
if (err) {
err.sql = this.sql;
throw this.formatError(err);
}
Function insertQuery
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
insertQuery(table, valueHash, modelAttributes, options) {
options = options || {};
_.defaults(options, this.options);
const modelAttributeMap = {};
Function init
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
static init(attributes, options = {}) {
if (!options.sequelize) {
throw new Error('No Sequelize instance passed');
}
Function formatResults
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
formatResults(data) {
let result = this.instance;
if (this.isBulkUpdateQuery() || this.isBulkDeleteQuery()) {
return data.affectedRows;
- 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 _whereParseSingleValueObject
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
_whereParseSingleValueObject(key, field, prop, value, options) {
if (prop === Op.not) {
if (Array.isArray(value)) {
prop = Op.notIn;
} else if (value !== null && value !== true && value !== false) {
- 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 createTableQuery
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
createTableQuery(tableName, attributes, options) {
options = options || {};
const primaryKeys = [];
const needsMultiplePrimaryKeys =
- 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 generateThroughJoin
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
generateThroughJoin(include, includeAs, parentTableName, topLevelInfo) {
const through = include.through;
const throughTable = through.model.getTableName();
const throughAs = `${includeAs.internalAs}->${through.as}`;
const externalThroughAs = `${includeAs.externalAs}.${through.as}`;
- 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 formatResults
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
formatResults(data) {
let result = this.instance;
if (this.isInsertQuery(data)) {
this.handleInsertQuery(data);
- 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 quote
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
quote(collection, parent, connector) {
// init
const validOrderOptions = [
'ASC',
'DESC',
Sequelize
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class Sequelize {
/**
* Instantiate sequelize with name of database, username and password.
*
* @example
File query.js
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
const AbstractQuery = require('../abstract/query');
const QueryTypes = require('../../query-types');
const sequelizeErrors = require('../../errors');
const _ = require('lodash');
const { logger } = require('../../utils/logger');
Function _run
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
async _run(connection, sql, parameters) {
this.sql = sql;
const { options } = this;
const complete = this._logQuery(sql, debug, parameters);
- 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 _validateIncludedElements
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
static _validateIncludedElements(options, tableNames) {
if (!options.model) options.model = this;
tableNames = tableNames || {};
options.includeNames = [];
- 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 connect
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
async connect(config) {
config.user = config.username;
const connectionConfig = _.pick(config, ['user', 'password', 'host', 'database', 'port']);
connectionConfig.types = {
Function generateThroughJoin
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateThroughJoin(include, includeAs, parentTableName, topLevelInfo) {
const through = include.through;
const throughTable = through.model.getTableName();
const throughAs = `${includeAs.internalAs}->${through.as}`;
const externalThroughAs = `${includeAs.externalAs}.${through.as}`;
Function exports
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = BaseTypes => {
BaseTypes.ABSTRACT.prototype.dialectTypes = 'https://dev.mysql.com/doc/refman/5.7/en/data-types.html';
/**
* types: [buffer_type, ...]
Function _whereParseSingleValueObject
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
_whereParseSingleValueObject(key, field, prop, value, options) {
if (prop === Op.not) {
if (Array.isArray(value)) {
prop = Op.notIn;
} else if (value !== null && value !== true && value !== false) {
File query.js
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
const AbstractQuery = require('../abstract/query');
const sequelizeErrors = require('../../errors');
const parserStore = require('../parserStore')('mssql');
const _ = require('lodash');
const { logger } = require('../../utils/logger');