Showing 49 of 71 total issues
Function resampleImage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function resampleImage(
srcImage: IThAWImage,
dstWidth: number,
dstHeight: number,
mode: number
Function convolve1D
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
dstBuffer: ThAWImageBufferType,
dstInitialOffset: number,
numDstPixels: number,
dstPixelStride: number,
srcBuffer: ThAWImageBufferType,
Function mapImageByCoordinatesFromBuffer
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
dstBuffer: ThAWImageBufferType,
dstWidth: number,
dstHeight: number,
dstInitialRowOffset: number,
dstRowStride: number,
Function compositeTest
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function compositeTest(srcImage: IThAWImage): IThAWImage {
// const dstImage = generateTestImage_RedGreenGradient(srcImage.width, srcImage.height, fnCreateImage);
const red = 255;
const green = 0;
Function fill
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public fill(
dstRow: number,
dstColumn: number,
width: number,
height: number,
Function fill
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public fill(
dstRow: number,
dstColumn: number,
width: number,
height: 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 resample1DNearestNeighbour
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
dstBuffer: ThAWImageBufferType,
dstInitialOffset: number,
numDstPixels: number,
dstPixelStride: number,
srcBuffer: ThAWImageBufferType,
Function resample1DBilinear
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
dstBuffer: ThAWImageBufferType,
dstInitialOffset: number,
numDstPixels: number,
dstPixelStride: number,
srcBuffer: ThAWImageBufferType,
Function resample1DBicubic
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
dstBuffer: ThAWImageBufferType,
dstInitialOffset: number,
numDstPixels: number,
dstPixelStride: number,
srcBuffer: ThAWImageBufferType,
Function resample1DBilinear
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function resample1DBilinear(
dstBuffer: ThAWImageBufferType,
dstInitialOffset: number,
numDstPixels: number,
dstPixelStride: 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function mapImageByCoordinatesFromBuffer(
dstBuffer: ThAWImageBufferType,
dstWidth: number,
dstHeight: number,
dstInitialRowOffset: number,
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
width: number,
height: number,
bytesPerPixel?: number,
bytesPerLine?: number,
Function dispatchPixelate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function dispatchPixelate(argv: string[]): Promise<void> {
let srcFilePath = defaultSrcFilePath;
let dstFilePath = `test/output-files/pixelate.${dstFileExtension}`;
let pixelWidth = 8;
let pixelHeight = 8;
Function resample1DNearestNeighbour
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resample1DNearestNeighbour(
dstBuffer: ThAWImageBufferType,
dstInitialOffset: number,
numDstPixels: number,
dstPixelStride: number,
Function dispatchGaussianBlur
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function dispatchGaussianBlur(argv: string[]): Promise<void> {
let srcFilePath = defaultSrcFilePath;
let dstFilePath = `test/output-files/gaussian-blur.${dstFileExtension}`;
// let sigma = 1.0;
let sigma = 4.0;
Function doAffineTransformation
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
dstImage: IThAWImage,
srcImage: IThAWImage,
matrix: IAffineTransformationMatrix,
dstLeft?: number,
dstRight?: number,
Function dispatchRotate90DegreesClockwise
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async function dispatchRotate90DegreesClockwise(
argv: string[]
): Promise<void> {
let srcFilePath = defaultSrcFilePath;
let dstFilePath = `test/output-files/rotate90cw.${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 generateTestImage_SingleRGBAColour
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
width: number,
height: number,
red: number,
green: number,
blue: number,
Avoid deeply nested control flow statements. Open
switch (srcImage.bytesPerPixel) {
case 4:
accumulator3 +=
srcImage.data[srcPixelOffset2 + 3];
case 3:
Function dispatchRotate180Degrees
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async function dispatchRotate180Degrees(argv: string[]): Promise<void> {
let srcFilePath = defaultSrcFilePath;
let dstFilePath = `test/output-files/rotate180.${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"