Showing 56 of 82 total issues
Function perform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
async perform() {
const { timezone } = this._params;
const scopeFilters = await scopeManager.getScopeForUser(this._user, this._model.name, true);
const queryOptions = new QueryOptions(this._model);
- 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
Avoid deeply nested control flow statements. Open
Open
if (conditionValue !== null) {
condition[field.field] = conditionValue;
pushCondition(condition, field.field);
}
Avoid deeply nested control flow statements. Open
Open
if (field.type === 'Number') {
const value = parseInt(params.search, 10) || 0;
if (value) {
condition = opts.Sequelize.where(column, ' = ', value);
hasExtendedConditions = true;
Avoid deeply nested control flow statements. Open
Open
if (params.search.match(REGEX_UUID)) {
condition[field.field] = params.search;
pushCondition(condition, field.field);
}
Function ResourcesExporter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function ResourcesExporter(model, options, params, association, user) {
Function HasManyDissociator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function HasManyDissociator(model, association, options, params, data) {
Function HasManyAssociator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function HasManyAssociator(model, association, opts, params, data) {
Avoid too many return
statements within this function. Open
Open
return currentPreviousInterval;
Avoid too many return
statements within this function. Open
Open
return [new ApimapFieldTypeDetector({ type: column.type.type }, options).perform()];
Avoid too many return
statements within this function. Open
Open
return null;
Avoid too many return
statements within this function. Open
Open
return 'Time';
Avoid too many return
statements within this function. Open
Open
return 'Date';
Avoid too many return
statements within this function. Open
Open
return 'Point';
Avoid too many return
statements within this function. Open
Open
return 'Number';
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return 'Json';