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;
- 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 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;
- 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 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;
- 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 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,
- 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
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,
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],
- 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 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;
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;
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;
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,
Function gemm
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
dtype: DType,
transx: number,
transy: number,
m: number,
n: number,
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;
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],
Function default
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (this: NDArray): NDArray {
this.square();
const {
shape: [n],
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,
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;
Function constructor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public constructor(
data?: any,
options?: {
shape?: number[];
length?: 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 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
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(
data?: any,
options?: {
shape?: number[];
length?: number;
Function gesv
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
dtype: DType,
n: number,
nrhs: number,
x: TypedArray,
ldx: number,