Showing 32 of 47 total issues
Function convertFieldDefinitionType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function convertFieldDefinitionType(fieldDefinitionType: any, errDesc: any, converted?: any): any {
converted = converted || {
nonNullTypeList: false,
listType: false,
nonNullTypeField: 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 replaceItems
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function replaceItems<H extends HookContext = HookContext>(context: H, items: any): void {
// @ts-ignore
if (context.params && context.params._actOn === 'dispatch') {
context.dispatch = items;
return;
- 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 processRecord
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function processRecord(store: any, query: any, depth: any, rec: any, type: any, j: any): any {
Function populateItem
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
options: any,
context: HookContext,
item: any,
includeSchema: any,
depth: number,
Function populateItemArray
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
options: any,
context: HookContext,
items: any,
includeSchema: any,
depth: number,
Function populateAddChild
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
options: any,
context: HookContext,
parentItem: any,
childSchema: any,
depth: any,
Function processRecords
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function processRecords(store: any, query: any, recs: any, type: any, depth = 0): any {
Avoid too many return
statements within this function. Open
return context;
Avoid too many return
statements within this function. Open
return context;
Function populateAddChild
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function populateAddChild(
options: any,
context: HookContext,
parentItem: any,
childSchema: any,
- 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 getItems
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getItems<H extends HookContext = HookContext>(context: H): any {
// @ts-ignore
if (context.params && context.params._actOn === 'dispatch') return context.dispatch;
const items = context.type === 'before' ? context.data : context.result;
- 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 addNewErrorDflt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function addNewErrorDflt(errorMessages: any, ajvError: any, itemsLen: any, index: any) {
const leader = itemsLen === 1 ? '' : `in row ${index + 1} of ${itemsLen}, `;
let message;
if (ajvError.dataPath) {
- 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"