Showing 503 of 787 total issues
Function removeColumn
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async removeColumn(tableName, columnName, options) {
options = options || {};
const [results] = await this.sequelize.query(
this.queryGenerator.getForeignKeyQuery(
Function delete
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async delete(instance, tableName, identifier, options) {
const cascades = [];
const sql = this.queryGenerator.deleteQuery(tableName, identifier, {}, instance.constructor);
options = { ...options };
Function has
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async has(sourceInstance, instances, options) {
if (!Array.isArray(instances)) {
instances = [instances];
}
Function changeColumnQuery
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
changeColumnQuery(tableName, attributes) {
const attrString = [],
constraintString = [];
let commentString = '';
Function normalizeAttribute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
normalizeAttribute(attribute) {
if (!_.isPlainObject(attribute)) {
attribute = { type: attribute };
}
Function formatBindParameters
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static formatBindParameters(sql, values, dialect) {
const stringReplaceFunc = value => (typeof value === 'string' ? value.replace(/\0/g, '\\0') : value);
let bindParam;
if (Array.isArray(values)) {
Function createTable
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async createTable(tableName, attributes, options, model) {
let sql = '';
options = { ...options };
Function removeColumnQuery
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeColumnQuery(tableName, attributes) {
attributes = this.attributesToSQL(attributes);
let backupTableName;
if (typeof tableName === 'object') {
Consider simplifying this complex logical expression. Open
if (
(!options || (options && !options.raw)) &&
!(value instanceof Date) &&
!!value &&
value !== Infinity &&
Consider simplifying this complex logical expression. Open
if (
options.raw &&
!(this._options && this._options.include) &&
!(options && options.attributes) &&
!this.constructor._hasDateAttributes &&
Consider simplifying this complex logical expression. Open
if (
!options.raw &&
// True when sequelize method
(value instanceof Utils.SequelizeMethod ||
// Check for data type type comparators
Consider simplifying this complex logical expression. Open
if (
!!constraintName &&
foreignKeyReference.tableCatalog === database &&
(schema ? foreignKeyReference.tableSchema === schema : true) &&
foreignKeyReference.referencedTableName === references.model &&
Consider simplifying this complex logical expression. Open
if (
options.attributes &&
!options.raw &&
this.primaryKeyAttribute &&
!options.attributes.includes(this.primaryKeyAttribute) &&
Function bulkInsertQuery
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
bulkInsertQuery(tableName, attrValueHashes, options, attributes) {
const quotedTable = this.quoteTable(tableName);
options = options || {};
attributes = attributes || {};
- 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 removeHook
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
removeHook(hookType, name) {
const isReference = typeof name === 'function' ? true : false;
if (!this.hasHook(hookType)) {
return this;
- 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 _logQuery
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_logQuery(sql, debugContext, parameters) {
const { connection, options } = this;
const benchmark = this.sequelize.options.benchmark || options.benchmark;
const logQueryParameters = this.sequelize.options.logQueryParameters || options.logQueryParameters;
const startTime = Date.now();
- 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 formatBindParameters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static formatBindParameters(sql, values, dialect, replacementFunc, options) {
if (!values) {
return [sql, []];
}
- 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 createTable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async createTable(tableName, attributes, options, model) {
let sql = '';
options = { ...options };
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async create(sourceInstance, values, options = {}) {
if (Array.isArray(options)) {
options = {
fields: options
};
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
constructor(
message: string,
type?: keyof typeof Origins | string,
path?: string,
value?: string,
- 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"