Showing 14 of 32 total issues
Function fastPadding
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function fastPadding(
A: Matrix,
[padHeight, padWidth]: [number, number]
): Matrix {
const width = A.width + padWidth * 2
- 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 fastPadding
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fastPadding(
A: Matrix,
[padHeight, padWidth]: [number, number]
): Matrix {
const width = A.width + padWidth * 2
Function mxConv2
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function mxConv2(
{ data: ref, width: refWidth, height: refHeight }: Matrix,
b: Matrix,
shape: Shape = 'full'
): Matrix {
- 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 weberSsim
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function weberSsim(
pixels1: ImageMatrix,
pixels2: ImageMatrix,
options: Options
): MSSIMMatrix {
Function originalSsim
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function originalSsim(
pixels1: Matrix,
pixels2: Matrix,
options: Options
): Matrix {
Function genSSIM
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
μ12: Matrix,
σ12: Matrix,
μ1Sq: Matrix,
μ2Sq: Matrix,
σ1Sq: Matrix,
Function genUQI
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
μ12: Matrix,
σ12: Matrix,
μ1Sq: Matrix,
μ2Sq: Matrix,
σ1Sq: Matrix,
Function reshape
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
c: Matrix,
shape: Shape,
ma: number,
mb: number,
na: number,
Avoid deeply nested control flow statements. Open
for (let j = 0; j < refWidth; j++) {
data[(i + r1) * cWidth + j + c1] += ref[i * refWidth + j] * br1c1
}
Function sub
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
{ data: ref, width: refWidth }: Matrix,
x: number,
height: number,
y: number,
width: number
Function windowCovariance
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
pixels1: ImageMatrix,
pixels2: ImageMatrix,
sums1: any,
sums2: any,
windowSize: number
Function validateOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function validateOptions(options: Options) {
Object.keys(options).forEach((option) => {
if (!(option in defaults)) {
throw new Error(`"${option}" is not a valid option`)
}
- 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 windowMatrix
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function windowMatrix(
sumMatrix: any,
windowSize: number,
divisor: 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 padMatrix
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function padMatrix(
A: Matrix,
frows: number,
fcols: number,
pad: PaddingValue
- 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"