Showing 29 of 150 total issues
Function DFT
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function DFT(size, window) {
if (!window) window = fill(winFn, size);
if (window.length !== size)
throw Error(
"Window size must be " + size + " length but is " + window.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 forward
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function forward (bufferSize, buffer, trans, spectrum, table) {
Function compute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function compute (real, imag, samples, power, dir) {
Function toComplex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function toComplex (signal, size) {
if (!signal) {
if (!size) throw Error('A signal is required')
return { real: new Float32Array(size), imag: new Float32Array(size) }
} else if (signal.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 roundTo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function roundTo (dec) {
return function round (arr, n = dec, output) {
const size = arr.length
if (!output) output = new Float64Array(size)
const limit = Math.min(size, output.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 process
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function process (inverse, signal, output) {
let r, i, theta
const { real, imag } = signal
// we take the size of the output. It can be smaller than the source
const size = output.real.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 exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (canvas, data, color, maxStep = 1000) {
var ctx = canvas.getContext('2d')
if (color) ctx.fillStyle = color
var width = canvas.width
var height = canvas.height
- 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 polar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function polar (result, output) {
const { real, imag } = result
const len = real.length
if (!output) output = { magnitudes: zeros(len), phases: zeros(len) }
const { magnitudes, phases } = output
- 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 stft
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function stft (input, window, output, inputSize, fftSize, hopSize) {
const fft = new FFT(fftSize)
const fftOut = fft.createComplexArray()
const frame = new Array(fftSize)
- 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"