abtExp/vecto

View on GitHub

Showing 27 of 48 total issues

Function min has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function min({ ar1, ar2 = null, axis = 0 }) {
    let minElems = [];
    if (ar2 === null) {
        let shape = calcShape(ar1),
            elems = axisOps(shape, axis);
Severity: Minor
Found in util/min.js - 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 fill has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function fill(shape, initializer = 'linear', ...args) {
    const { calcSize, arrange } = require('./core');
    initializer = initializer || 'zeros';
    let arr = [],
        size = calcSize(shape, 'shape');
Severity: Minor
Found in lib/fill.js - 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 max has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function max({ ar1, ar2 = null, axis = 0 }) {
    let maxElems = [],
        opShape = [];

    if (ar2 === null) {
Severity: Minor
Found in util/max.js - 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 fill has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

module.exports = function fill(shape, initializer = 'linear', ...args) {
    const { calcSize, arrange } = require('./core');
    initializer = initializer || 'zeros';
    let arr = [],
        size = calcSize(shape, 'shape');
Severity: Minor
Found in lib/fill.js - About 1 hr to fix

    Function clip has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function clip(arr, min_val, max_val) {
        const { arrange, calcShape, flatten } = require('./core');
        let a = flatten(arr),
            min = [],
            max = [],
    Severity: Minor
    Found in lib/clip.js - 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 exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(arr, axis = null) {
        const shape = arr.shape || calcShape(arr);
    
        arr = arr.data || flatten(arr);
    
    
    Severity: Minor
    Found in util/argmin.js - 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 exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(arr, axis = null) {
        const shape = arr.shape || calcShape(arr);
    
        arr = arr.data || flatten(arr);
    
    
    Severity: Minor
    Found in util/argmax.js - 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 sum has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    function sum(arr1, arr2 = null, axis = 0) {
        let ar1 = flatten(arr1),
            ar2 = arr2 !== null ? flatten(arr2) : null,
            s1 = calcShape(arr1),
            s2 = ar2 ? calcShape(arr2) : null,
    Severity: Minor
    Found in util/sum.js - 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 clip has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function clip(arr, min_val, max_val) {
        const { arrange, calcShape, flatten } = require('./core');
        let a = flatten(arr),
            min = [],
            max = [],
    Severity: Minor
    Found in lib/clip.js - About 1 hr to fix

      Function exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = (shape, axis) => {
          let nComp = axis < shape.length - 1 ? shape[shape.length - 1] : 1,
              jumpLen = 1,
              inc = 1,
              j = 0,
      Severity: Minor
      Found in util/axisOps.js - 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 exports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = (shape, axis) => {
          let nComp = axis < shape.length - 1 ? shape[shape.length - 1] : 1,
              jumpLen = 1,
              inc = 1,
              j = 0,
      Severity: Minor
      Found in util/axisOps.js - About 1 hr to fix

        Function exports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = (s1, s2, ar1, ar2, dtype = 'float32') => {
            ar1 = formArr(ar1, dtype);
            ar2 = formArr(ar2, dtype);
            let r1 = s1[0],
                c1 = s1[1],
        Severity: Minor
        Found in util/matmul.js - About 1 hr to fix

          Function exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function(arr, axis = null) {
              const shape = arr.shape || calcShape(arr);
          
              arr = arr.data || flatten(arr);
          
          
          Severity: Minor
          Found in util/argmax.js - About 1 hr to fix

            Function exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(arr, axis = null) {
                const shape = arr.shape || calcShape(arr);
            
                arr = arr.data || flatten(arr);
            
            
            Severity: Minor
            Found in util/argmin.js - About 1 hr to fix

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

              function divide(arr1, arr2) {
                  if (Array.isArray(arr1) && Array.isArray(arr2)) {
                      if (calcShape(arr1).toString() === calcShape(arr2).toString()) {
                          let t1 = flatten(arr1),
                              t2 = flatten(arr2);
              Severity: Minor
              Found in util/divide.js - 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 prepare has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function prepare(type) {
                  let r1 = parseInt(Math.random() * 100) || 1,
                      c1 = parseInt(Math.random() * 100) || 1,
                      r2 = c1,
                      c2 = parseInt(Math.random() * 100) || 1;
              Severity: Minor
              Found in benchmarking.js - About 1 hr to fix

                Function prepare has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                function prepare(type) {
                    let r1 = parseInt(Math.random() * 100) || 1,
                        c1 = parseInt(Math.random() * 100) || 1,
                        r2 = c1,
                        c2 = parseInt(Math.random() * 100) || 1;
                Severity: Minor
                Found in benchmarking.js - About 55 mins 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 broadcast has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = function broadcast(s1, s2) {
                    let [len, sarr, larr] = s1.length > s2.length ? [s1.length, s2, s1] : [s2.length, s1, s2],
                        sar = fill([len], 'linear', 1), opShape, k = 0;
                
                    for (let i = len - sarr.length; i < len; i++) {
                Severity: Minor
                Found in util/broadcast.js - About 55 mins 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 exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = (s1, s2, ar1, ar2, dtype = 'float32') => {
                    ar1 = formArr(ar1, dtype);
                    ar2 = formArr(ar2, dtype);
                    let r1 = s1[0],
                        c1 = s1[1],
                Severity: Minor
                Found in util/matmul.js - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                          if (innerButton && innerButton.classList.contains('opened')) {
                            innerButton.classList.remove('opened');
                            innerButton.classList.add('closed');
                          }
                Severity: Major
                Found in docs/script/test-summary.js - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language