mateogianolio/vectorious

View on GitHub

Showing 33 of 33 total issues

Function default has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

export default function (this: NDArray): NDArray {
  const {
    shape: [r, c],
    data: d1,
  } = this;
Severity: Minor
Found in src/core/gauss.ts - About 5 hrs to fix

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 default has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

export default function (this: NDArray): [NDArray, NDArray] {
  this.square();

  const [n] = this.shape;

Severity: Minor
Found in src/core/eig.ts - About 5 hrs to fix

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 constructor has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(...args: (NDArray | ArrayLike<any>)[]) {
    this.iters = args.map((arg) => new NDIter(arg));
    this.numiter = args.length;

    let i;
Severity: Minor
Found in src/iterators/multi.ts - About 4 hrs to fix

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 default has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

export default function (this: NDArray): [NDArray, Int32Array] {
  const {
    data: d1,
    shape: [n],
    dtype,
Severity: Minor
Found in src/core/lu_factor.ts - About 3 hrs to fix

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

File index.ts has 329 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { DType, INDArray, TypedArray } from '../types';
import {
  flatten,
  get_dtype,
  get_length,
Severity: Minor
Found in src/core/index.ts - About 3 hrs to fix

    Function default has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function (this: NDArray, x: NDArray): NDArray {
      const { data: d1, dtype } = this;
      const {
        data: d2,
        shape: [n, nrhs],
    Severity: Minor
    Found in src/core/solve.ts - About 3 hrs to fix

    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 default has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (this: NDArray): [NDArray, NDArray] {
      this.square();
    
      const [n] = this.shape;
    
    
    Severity: Major
    Found in src/core/eig.ts - About 2 hrs to fix

      Function constructor has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor(...args: (NDArray | ArrayLike<any>)[]) {
          this.iters = args.map((arg) => new NDIter(arg));
          this.numiter = args.length;
      
          let i;
      Severity: Major
      Found in src/iterators/multi.ts - About 2 hrs to fix

        Function default has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function (this: NDArray): NDArray {
          const {
            shape: [r, c],
            data: d1,
          } = this;
        Severity: Major
        Found in src/core/gauss.ts - About 2 hrs to fix

          Function default has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function (this: NDArray): [NDArray, Int32Array] {
            const {
              data: d1,
              shape: [n],
              dtype,
          Severity: Minor
          Found in src/core/lu_factor.ts - About 1 hr to fix

            Function gemm has 14 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              dtype: DType,
              transx: number,
              transy: number,
              m: number,
              n: number,
            Severity: Major
            Found in src/blas.ts - About 1 hr to fix

              Function range has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const range = (...args: number[]): NDArray => {
                const type: TypedArrayConstructor = Float64Array;
                let backwards: boolean = false;
                let start: number;
                let step: number;
              Severity: Minor
              Found in src/core/range.ts - About 1 hr to fix

                Function default has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function (this: NDArray, x: NDArray): NDArray {
                  const { data: d1, dtype } = this;
                  const {
                    data: d2,
                    shape: [n, nrhs],
                Severity: Minor
                Found in src/core/solve.ts - About 1 hr to fix

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

                  export default function (this: NDArray): NDArray {
                    this.square();
                  
                    const {
                      shape: [n],
                  Severity: Minor
                  Found in src/core/inv.ts - About 1 hr to fix

                    Function default has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function (this: NDArray, x: NDArray): NDArray {
                      // TODO: compare strides instead of blind copy
                      const {
                        shape: [r1, c1],
                        data: d1,
                    Severity: Minor
                    Found in src/core/multiply.ts - About 1 hr to fix

                      Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        constructor(x: NDArray | ArrayLike<any>) {
                          this.x = array(x);
                          const { shape, strides, length } = this.x;
                      
                          this.length = length;
                      Severity: Minor
                      Found in src/iterators/single.ts - About 1 hr to fix

                        Function constructor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          public constructor(
                            data?: any,
                            options?: {
                              shape?: number[];
                              length?: number;
                        Severity: Minor
                        Found in src/core/index.ts - About 1 hr to fix

                        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 default has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function (
                          this: NDArray,
                          begin: number = 0,
                          end: number = this.shape[0],
                          step: number = 1
                        Severity: Minor
                        Found in src/core/slice.ts - About 1 hr to fix

                          Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            public constructor(
                              data?: any,
                              options?: {
                                shape?: number[];
                                length?: number;
                          Severity: Minor
                          Found in src/core/index.ts - About 1 hr to fix

                            Function gesv has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              dtype: DType,
                              n: number,
                              nrhs: number,
                              x: TypedArray,
                              ldx: number,
                            Severity: Major
                            Found in src/lapack.ts - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language