Showing 53 of 97 total issues
Function objectsDiffFilter
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const objectsDiffFilter: Filter<DiffContext> = (context) => {
if (context.leftIsArray || context.leftType !== 'object') {
return;
}
Function trivialMatchesPatchFilter
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function trivialMatchesPatchFilter(context) {
if (typeof context.delta === 'undefined') {
context.setResult(context.left).exit();
return;
}
Function backtrack
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const backtrack = function (
matrix: number[][] & {
match?: (
array1: readonly unknown[],
array2: readonly unknown[],
Function prepareContext
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
prepareContext(context: Partial<ConsoleFormatterContext>) {
super.prepareContext(context);
context.indent = function (levels) {
this.indentLevel =
(this.indentLevel || 0) + (typeof levels === 'undefined' ? 1 : levels);
- 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 gist
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
gist: function (id) {
dom.getJson('https://api.github.com/gists/' + id, function (error, data) {
interface GistError {
message?: 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"
Further reading
Function trivialMatchesPatchFilter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function trivialMatchesPatchFilter(context) {
if (typeof context.delta === 'undefined') {
context.setResult(context.left).exit();
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 lengthMatrix
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const lengthMatrix = function (
array1: readonly unknown[],
array2: readonly unknown[],
match: (
array1: readonly unknown[],
Function prepareContext
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareContext(context: Partial<ConsoleFormatterContext>) {
super.prepareContext(context);
context.indent = function (levels) {
this.indentLevel =
(this.indentLevel || 0) + (typeof levels === 'undefined' ? 1 : levels);
Function getJson
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
getJson: function (
url: string,
callback: (error: Error | string | null, data?: unknown) => void,
) {
let request: XMLHttpRequest | null = new XMLHttpRequest();
- 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 lengthMatrix
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const lengthMatrix = function (
array1: readonly unknown[],
array2: readonly unknown[],
match: (
array1: readonly unknown[],
- 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 process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
process(input: TContext) {
if (!this.processor) {
throw new Error('add this pipe to a processor before using it');
}
const debug = this.debug;
- 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 backtrack
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const backtrack = function (
matrix: number[][] & {
match?: (
array1: readonly unknown[],
array2: readonly unknown[],
- 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 clone
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function clone(arg: unknown): unknown {
if (typeof arg !== 'object') {
return arg;
}
if (arg === null) {
- 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 leftright
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
leftright: function (descriptionArg, leftValueArg, rightValueArg) {
try {
const description = decodeURIComponent(descriptionArg || '');
const leftValue = decodeURIComponent(leftValueArg);
const rightValue = decodeURIComponent(rightValueArg);
- 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 datesDiffFilter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const diffFilter: Filter<DiffContext> = function datesDiffFilter(
context,
) {
if (context.left instanceof Date) {
if (context.right instanceof Date) {
- 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 pipe
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
pipe<TContext extends Context<any>>(
name: string | Pipe<TContext>,
pipeArg?: Pipe<TContext>,
) {
let pipe = pipeArg;
- 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 collectChildrenDiffFilter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const collectChildrenDiffFilter: Filter<DiffContext> = (context) => {
if (!context || !context.children) {
return;
}
const length = context.children.length;
- 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 setResult
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setResult(result: Delta) {
if (this.options!.cloneDiffValues && typeof result === 'object') {
const clone =
typeof this.options!.cloneDiffValues === 'function'
? this.options!.cloneDiffValues
- 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 formatAnyChange
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this: AnnotatedFormatter,
context: AnnotatedFormatterContext,
delta: DeltaTypeAnnotationsMap[TDeltaType],
left: unknown,
key: string | undefined,
Function textDeltaReverse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const textDeltaReverse = function (delta: string) {
let i;
let l;
let line;
let lineTmp;
- 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"