Showing 29 of 150 total issues
Function fft
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function fft (size, input, output, dir) {
if (arguments.length > 1) return fft(size)(input, dir, output)
var cached = tables(size)
return function process (dir, input, 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 forward
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function forward (bufferSize, buffer, trans, spectrum, table) {
var n = bufferSize,
x = trans,
n2, n4, n8, nn,
t1, t2, t3, t4,
Function forward
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export default function forward (bufferSize, buffer, trans, spectrum, table) {
var n = bufferSize,
x = trans,
n2, n4, n8, nn,
t1, t2, t3, t4,
- 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 inverse
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function inverse (bufferSize, buffer, output) {
var n = bufferSize
var x = output || new Float64Array(bufferSize)
var TWO_PI = 2 * Math.PI
var n2, n4, n8, nn,
Function inverse
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export default function inverse (bufferSize, buffer, output) {
var n = bufferSize
var x = output || new Float64Array(bufferSize)
var TWO_PI = 2 * Math.PI
var n2, n4, n8, nn,
- 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 fft
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function fft (dir, m, x, y) {
var n, i, i1, j, k, i2, l, l1, l2
var c1, c2, tx, ty, t1, t2, u1, u2, z
/* Calculate the number of points */
Function fft
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function fft (dir, m, x, y) {
var n, i, i1, j, k, i2, l, l1, l2
var c1, c2, tx, ty, t1, t2, u1, u2, z
/* Calculate the number of points */
- 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 fft
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fft (size, input, output, dir) {
if (arguments.length > 1) return fft(size)(input, dir, output)
var cached = tables(size)
return function process (dir, input, output) {
Function compute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function compute (real, imag, samples, power, dir) {
/* Computes in-place complex-to-complex FFT */
/* Reverse bits */
var j = 0
for (var i = 0; i < (samples - 1); 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 process
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function process (dir, input, output) {
// check direction
if (dir !== 'forward' && dir !== 'inverse') throw Error('Direction must be "forward" or "inverse" but was: ' + dir)
var inverse = dir === 'inverse'
Function compute
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compute (real, imag, samples, power, dir) {
/* Computes in-place complex-to-complex FFT */
/* Reverse bits */
var j = 0
for (var i = 0; i < (samples - 1); i++) {
Function process
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process (dir, tables, input, output) {
const { size, cosTable, sinTable, reverseTable } = tables
if (!input.real) input = { real: input, imag: new Float32Array(size) }
const rs = input.real
Function process
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function process (dir, tables, input, output) {
const { size, cosTable, sinTable, reverseTable } = tables
if (!input.real) input = { real: input, imag: new Float32Array(size) }
const rs = input.real
- 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 DFT
has 40 lines of code (exceeds 25 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
Function compute
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compute (x, y, n, m) {
var i = 0, j = 0, k = 0, n1 = 0, n2 = 0, a = 0;
var c = 0, s = 0, t1 = 0, t2 = 0;
// Bit-reverse
Function compute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function compute (x, y, n, m) {
var i = 0, j = 0, k = 0, n1 = 0, n2 = 0, a = 0;
var c = 0, s = 0, t1 = 0, t2 = 0;
// Bit-reverse
- 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 player
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function player ({
buffer,
loop = false,
context = ac,
labels = ['Play', 'Stop'],
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
function process (re, im, N) {
var c, s, tre, tim
for (var i = 0; i < N; i++) {
for (var j = 0, h = i, k = N; (k >>= 1); h >>= 1) {
j = (j << 1) | (h & 1);
- 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 recalcPhases
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function recalcPhases (frames, { size, factor, hop }, omega) {
var ha = hop // hop analysis
var hs = hop * factor // hop synthesis
var numFrames = frames.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 stft
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function stft (input, window, output, inputSize, fftSize, hopSize) {