entropy-source/pseudo-random

View on GitHub

Showing 6 of 6 total issues

Function fill has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const fill = (prng, array, i, j) => {
    switch (array.constructor) {
        case ArrayBuffer: {
            return _fill(nextUint8, new Uint8Array(array), i, j);
        }
Severity: Major
Found in src/fill.js - About 2 hrs to fix

    Function genBit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function* genBit(prng) {
        for (const x of prng) {
            yield (x >>> 0) & 1;
            yield (x >>> 1) & 1;
            yield (x >>> 2) & 1;
    Severity: Minor
    Found in src/genBit.js - About 1 hr to fix

      Avoid too many return statements within this function.
      Open

                  return _fill(nextBigUint64, prng, array, i, j);
      Severity: Major
      Found in src/fill.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return _fill(nextFloat64, prng, array, i, j);
        Severity: Major
        Found in src/fill.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return _fill(nextBigInt64, prng, array, i, j);
          Severity: Major
          Found in src/fill.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return _fill(nextFloat32, prng, array, i, j);
            Severity: Major
            Found in src/fill.js - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language