Showing 49 of 71 total issues
Function dispatchCompositeTest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async function dispatchCompositeTest(argv: string[]): Promise<void> {
let srcFilePath = defaultSrcFilePath;
let dstFilePath = `test/output-files/composite-test.${dstFileExtension}`;
if (!fs.existsSync(srcFilePath)) {
- 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 createAffineTransformationMatrix
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
a: number,
b: number,
c: number,
d: number,
e: number,
Avoid deeply nested control flow statements. Open
switch (srcImage.bytesPerPixel) {
case 4:
dstImage.data[dstPixelOffset2 + 3] = result3;
case 3:
dstImage.data[dstPixelOffset2 + 2] = result2;
Function dispatchRotate90DegreesCounterclockwise
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async function dispatchRotate90DegreesCounterclockwise(
argv: string[]
): Promise<void> {
let srcFilePath = defaultSrcFilePath;
let dstFilePath = `test/output-files/rotate90ccw.${dstFileExtension}`;
- 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 createThAWImage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
width: number,
height: number,
bytesPerPixel?: number,
bytesPerLine?: number,
// colourModel?: ColourModel,
Function dispatchDesaturate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function dispatchDesaturate(argv: string[]): Promise<void> {
let srcFilePath = defaultSrcFilePath;
let dstFilePath = `test/output-files/desaturate.${dstFileExtension}`;
for (let i = 0; i < argv.length; i++) {
- 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 compositeImageFromBuffers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function compositeImageFromBuffers(
dstBuffer: ThAWImageBufferType,
dstWidth: number,
dstHeight: number,
dstInitialRowOffset: number,
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(
width: number,
height: number,
bytesPerPixel?: number,
bytesPerLine?: number,
- 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 mapImageByCoordinatesFromBuffer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function mapImageByCoordinatesFromBuffer(
dstBuffer: ThAWImageBufferType,
dstWidth: number,
dstHeight: number,
dstInitialRowOffset: number,
- 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"