Showing 4 of 10 total issues
Function DeepMergeObjects
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static DeepMergeObjects(left: any, right: any): any {
//
// If the left item is an array or an object, then have special ways to
// merge.
if (Array.isArray(left)) {
- 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 setFileAccessQueue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public setFileAccessQueue(): void {
//
// Creating a new queue.
// @note It only allow 1 (one) access at a time.
this._mainObject._fileAccessQueue = queue((task: any, next: (res: ConnectionSavingQueueResult) => void) => {
- 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 BuildCondition
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static BuildCondition(field: string, conf: any): Condition {
//
// Default values.
let type: ConditionTypes = ConditionTypes.Like;
//
- 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 addDocument
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public addDocument(doc: DBDocument): Promise<void> {
//
// This anonymous function takes a value for a index entry and adds the
// given document ID to it.
const addValue = (value: 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"