nemesiscodex/openfonacide

View on GitHub
static/js/dncp/util/ndarray.js

Summary

Maintainability
F
1 mo
Test Coverage

File ndarray.js has 1680 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Numpy like n-dimensional array proccessing class
 * http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html
 * 
 * @author pissang (https://github.com/pissang/)
Severity: Major
Found in static/js/dncp/util/ndarray.js - About 4 days to fix

    Function binaryOperation has 157 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        binaryOperation : function (lo, ro, op, out) {
            // Broadcasting
            // http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html
            var shape = [];
            var isLoScalar = typeof(lo) === 'number';
    Severity: Major
    Found in static/js/dncp/util/ndarray.js - About 6 hrs to fix

      Function insert has 97 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          insert : kwargs(function (obj, values, axis) {
              var data = this._array;
              var isObjScalar = false;
              if (typeof(obj) === 'number') {
                  obj = [obj];
      Severity: Major
      Found in static/js/dncp/util/ndarray.js - About 3 hrs to fix

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

            set : function (index, narray) {
                if (typeof(index) == 'number') {
                    index = index.toString();
                }
                var strides = calculateDimStrides(this._shape);
        Severity: Major
        Found in static/js/dncp/util/ndarray.js - About 2 hrs to fix

          Function get has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              get : function (index, out) {
                  if (typeof(index) == 'number') {
                      index = index.toString();
                  }
                  var strides = calculateDimStrides(this._shape);
          Severity: Major
          Found in static/js/dncp/util/ndarray.js - About 2 hrs to fix

            Function argsort has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                argsort : kwargs(function (axis, order, out) {
                    if (axis < 0) {
                        axis = this._shape.length + axis;
                    }
                    if (!this._size) {
            Severity: Minor
            Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

              Function delete has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  'delete' : kwargs(function (obj, axis) {
                      var data = this._array;
                      if (typeof(obj) === 'number') {
                          obj = [obj];
                      }
              Severity: Minor
              Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                Function _transposelike has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _transposelike : function (axes, out) {
                        var source = this._array;
                        var shape = this._shape.slice();
                        var strides = calculateDimStrides(this._shape);
                        var dim = shape.length;
                Severity: Minor
                Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                  Function std has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      std : kwargs((function () {
                          function withAxis(data, source, offsetStride, axisSize, stride) {
                              var cursor = 0;
                              for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                  for (var i = 0; i < stride; i++) {
                  Severity: Minor
                  Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                    Function var has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        'var' : kwargs((function () {
                            function withAxis(data, source, offsetStride, axisSize, stride) {
                                var cursor = 0;
                                for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                    for (var i = 0; i < stride; i++) {
                    Severity: Minor
                    Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                      Function ptp has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          ptp : kwargs((function () {
                              function withAxis(data, source, offsetStride, axisSize, stride) {
                                  var cursor = 0;
                                  for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                      for (var i = 0; i < stride; i++) {
                      Severity: Minor
                      Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                        Function parseRange has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function parseRange(index, dimSize) {
                            if (index.indexOf(':') >= 0) {
                                // Range indexing;
                                var res = index.split(/\s*:\s*/);
                        
                        
                        Severity: Minor
                        Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                          Function argmax has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              argmax : kwargs((function () {
                                  function withAxis(data, source, offsetStride, axisSize, stride) {
                                      var cursor = 0;
                                      for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                          for (var i = 0; i < stride; i++) {
                          Severity: Minor
                          Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                            Function repeat has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                repeat : kwargs(function (repeats, axis, out) {
                                    var shape;
                                    // flattened input array
                                    if (typeof(axis) === 'undefined') {
                                        shape = [this._size];
                            Severity: Minor
                            Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                              Function argmin has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  argmin : kwargs((function () {
                                      function withAxis(data, source, offsetStride, axisSize, stride) {
                                          var cursor = 0;
                                          for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                              for (var i = 0; i < stride; i++) {
                              Severity: Minor
                              Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

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

                                        var setPiece = function (axis, offset) {
                                            var range = ranges[axis];
                                            var stride = strides[axis];
                                            if (axis < len-1) {
                                                if (range[2] > 0) {
                                Severity: Minor
                                Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

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

                                      sort : kwargs(function (axis, order) {
                                          if (axis < 0) {
                                              axis = this._shape.length + axis;
                                          }
                                          var compareFunc;
                                  Severity: Minor
                                  Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                    Function _withPreprocess2 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        _withPreprocess2 : function (axis, out, funcWithAxis, funcFlatten) {
                                            var source = this._array;
                                            if (!this._size) {
                                                return;
                                            }
                                    Severity: Minor
                                    Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                      Function min has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          min : kwargs((function () {
                                              function withAxis(data, source, offsetStride, axisSize, stride) {
                                                  var cursor = 0;
                                                  for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                      for (var i = 0; i < stride; i++) {
                                      Severity: Minor
                                      Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                        Function max has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            max : kwargs((function () {
                                                function withAxis(data, source, offsetStride, axisSize, stride) {
                                                    var cursor = 0;
                                                    for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                        for (var i = 0; i < stride; i++) {
                                        Severity: Minor
                                        Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

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

                                              _withPreprocess1 : function (axis, out, funcWithAxis, funcFlatten) {
                                                  var source = this._array;
                                                  if (!this._size) {
                                                      return;
                                                  }
                                          Severity: Minor
                                          Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

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

                                                mean : kwargs((function () {
                                                    function withAxis(data, source, offsetStride, axisSize, stride) {
                                                        var cursor = 0;
                                                        for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                            for (var i = 0; i < stride; i++) {
                                            Severity: Minor
                                            Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

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

                                                  prod : kwargs((function () {
                                                      function withAxis(data, source, offsetStride, axisSize, stride) {
                                                          var cursor = 0;
                                                          for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                              for (var i = 0; i < stride; i++) {
                                              Severity: Minor
                                              Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

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

                                                    sum : kwargs((function () {
                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                            var cursor = 0;
                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                for (var i = 0; i < stride; i++) {
                                                Severity: Minor
                                                Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

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

                                                          function getPiece(axis, offset) {
                                                              var range = ranges[axis];
                                                              var stride = strides[axis];
                                                              if (axis < len-1) {
                                                                  if (range[2] > 0) {
                                                  Severity: Minor
                                                  Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                                    Function cumsum has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        cumsum : kwargs((function () {
                                                            function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                    for (var i = 0; i < stride; i++) {
                                                                        var idx = offset + i;
                                                    Severity: Minor
                                                    Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                                      Function cumprod has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          cumprod : kwargs((function () {
                                                              function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                  for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                      for (var i = 0; i < stride; i++) {
                                                                          var idx = offset + i;
                                                      Severity: Minor
                                                      Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                                        Function _parseRanges has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            _parseRanges : function (index) {
                                                                var rangesStr = index.split(/\s*,\s*/);
                                                                
                                                                // Parse range of each axis
                                                                var ranges = [];
                                                        Severity: Minor
                                                        Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                                          Function map has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                              map : function (mappedMin, mappedMax) {
                                                                  var input = this._array;
                                                                  var output = this._array;
                                                          
                                                                  var min = input[0];
                                                          Severity: Minor
                                                          Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                        if (isScalar) {
                                                                                            data[i*stride + j + offset] = source;
                                                                                        } else {
                                                                                            data[i*stride + j + offset] = source[cursor++];
                                                                                        }
                                                            Severity: Major
                                                            Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                      switch (op) {
                                                                                          case E_ADD: res = _a + _b; break;
                                                                                          case E_SUB: res = _a - _b; break;
                                                                                          case E_MUL: res = _a * _b; break;
                                                                                          case E_DIV: res = _a / _b; break;
                                                              Severity: Major
                                                              Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                        switch (op) {
                                                                                            case E_ADD: res = _a + _b; break;
                                                                                            case E_SUB: res = _a - _b; break;
                                                                                            case E_MUL: res = _a * _b; break;
                                                                                            case E_DIV: res = _a / _b; break;
                                                                Severity: Major
                                                                Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                              if (isScalar) {
                                                                                                  data[i*stride + j + offset] = source;
                                                                                              } else {
                                                                                                  data[i*stride + j + offset] = source[cursor++];
                                                                                              }
                                                                  Severity: Major
                                                                  Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            switch (op) {
                                                                                                case E_ADD: res = _a + _b; break;
                                                                                                case E_SUB: res = _a - _b; break;
                                                                                                case E_MUL: res = _a * _b; break;
                                                                                                case E_DIV: res = _a / _b; break;
                                                                    Severity: Major
                                                                    Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                              switch (op) {
                                                                                                  case E_ADD: res = _a + _b; break;
                                                                                                  case E_SUB: res = _a - _b; break;
                                                                                                  case E_MUL: res = _a * _b; break;
                                                                                                  case E_DIV: res = _a / _b; break;
                                                                      Severity: Major
                                                                      Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

                                                                        Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                        Open

                                                                                function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                        Severity: Minor
                                                                        Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                          Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                          Open

                                                                                  function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                          Severity: Minor
                                                                          Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                            Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                            Open

                                                                                    function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                            Severity: Minor
                                                                            Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                              Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                              Open

                                                                                      function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                              Severity: Minor
                                                                              Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                Open

                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                Severity: Minor
                                                                                Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                  Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                  Open

                                                                                          function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                  Severity: Minor
                                                                                  Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                    Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                    Open

                                                                                            function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                    Severity: Minor
                                                                                    Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                      Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                      Open

                                                                                              function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                      Severity: Minor
                                                                                      Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                        Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                        Open

                                                                                                function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                        Severity: Minor
                                                                                        Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                          Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                          Open

                                                                                                  function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                          Severity: Minor
                                                                                          Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                            Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                            Open

                                                                                                    function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                            Severity: Minor
                                                                                            Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                              Function withAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                              Open

                                                                                                      function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                              Severity: Minor
                                                                                              Found in static/js/dncp/util/ndarray.js - About 35 mins to fix

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                    argmin : kwargs((function () {
                                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                                            var cursor = 0;
                                                                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                                                                for (var i = 0; i < stride; i++) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 736..773

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 313.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                    argmax : kwargs((function () {
                                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                                            var cursor = 0;
                                                                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                                                                for (var i = 0; i < stride; i++) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 781..818

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 313.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                    max : kwargs((function () {
                                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                                            var cursor = 0;
                                                                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                                                                for (var i = 0; i < stride; i++) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 695..728

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 285.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                    min : kwargs((function () {
                                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                                            var cursor = 0;
                                                                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                                                                for (var i = 0; i < stride; i++) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 653..686

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 285.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                    cumprod : kwargs((function () {
                                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                                                                for (var i = 0; i < stride; i++) {
                                                                                                                    var idx = offset + i;
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1208..1236

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 280.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                    cumsum : kwargs((function () {
                                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                                                                for (var i = 0; i < stride; i++) {
                                                                                                                    var idx = offset + i;
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1244..1272

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 280.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                            if(isRoScalar) {
                                                                                                                for (var c = 0; c < offsetRepeats; c++) {
                                                                                                                    for (var i = 0; i < offsetStride; i++) {
                                                                                                                        _a = loData[idx]; _b = roData;
                                                                                                                        switch (op) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1517..1557

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 249.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                            if (isLoScalar) {
                                                                                                                for (var c = 0; c < offsetRepeats; c++) {
                                                                                                                    for (var i = 0; i < offsetStride; i++) {
                                                                                                                        _a = loData; _b = roData[idx];
                                                                                                                        switch (op) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1475..1515

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 249.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                    prod : kwargs((function () {
                                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                                            var cursor = 0;
                                                                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                                                                for (var i = 0; i < stride; i++) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 826..854

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 244.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                    sum : kwargs((function () {
                                                                                                        function withAxis(data, source, offsetStride, axisSize, stride) {
                                                                                                            var cursor = 0;
                                                                                                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                                                                                                for (var i = 0; i < stride; i++) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 day to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 862..890

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 244.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                            if (axis < len-1) {
                                                                                                                if (range[2] > 0) {
                                                                                                                    for (var i = range[0]; i < range[1]; i += range[2]) {
                                                                                                                        getPiece(axis+1,  offset + stride * i);
                                                                                                                    }
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 5 hrs to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1799..1831

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 137.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                            if (axis < len-1) {
                                                                                                                if (range[2] > 0) {
                                                                                                                    for (var i = range[0]; i < range[1]; i += range[2]) {
                                                                                                                        setPiece(axis+1,  offset + stride * i);
                                                                                                                    }
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 5 hrs to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1721..1745

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 137.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                                } else {
                                                                                                                    for (var i = range[0]; i > range[1]; i += range[2]) {
                                                                                                                        for (var j = 0; j < stride; j++) {
                                                                                                                            if (isScalar) {
                                                                                                                                data[i*stride + j + offset] = source;
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 4 hrs to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1810..1820

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 126.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                                if (range[2] > 0) {
                                                                                                                    for (var i = range[0]; i < range[1]; i += range[2]) {
                                                                                                                        for (var j = 0; j < stride; j++) {
                                                                                                                            if (isScalar) {
                                                                                                                                data[i*stride + j + offset] = source;
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 4 hrs to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1820..1830

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 126.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                                if (range[2] > 0) {
                                                                                                                    for (var i = range[0]; i < range[1]; i += range[2]) {
                                                                                                                        for (var j = 0; j < stride; j++) {
                                                                                                                            data[cursor++] = source[i*stride + j + offset];
                                                                                                                        }
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 2 hrs to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1738..1744

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 92.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                                } else {
                                                                                                                    for (var i = range[0]; i > range[1]; i += range[2]) {
                                                                                                                        for (var j = 0; j < stride; j++) {
                                                                                                                            data[cursor++] = source[i*stride + j + offset];
                                                                                                                        }
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 2 hrs to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1732..1738

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 92.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                        if (!out) {
                                                                                                            out = new NDArray(this._dtype);
                                                                                                            out.initFromShape(shape);
                                                                                                        } else {
                                                                                                            if (!arrayEqual(shape, out._shape)) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 hr to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1436..1443

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 73.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                        if (!out) {
                                                                                                            out = new NDArray(this._dtype);
                                                                                                            out.initFromShape(shape);
                                                                                                        } else {
                                                                                                            if (! arrayEqual(shape, out._shape)) {
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 hr to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 490..497

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 73.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                                    for (var j = 0; j < axisSize; j++) {
                                                                                                                        var diff = source[idx] - mean;
                                                                                                                        moments += diff * diff;
                                                                                                                        idx += stride;
                                                                                                                    }
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 hr to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1003..1007

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 56.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                                    for (var j = 0; j < axisSize; j++) {
                                                                                                                        var diff = source[idx] - mean;
                                                                                                                        moments += diff * diff;
                                                                                                                        idx += stride;
                                                                                                                    }
                                                                                                Severity: Major
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 1 hr to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 951..955

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 56.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                            for (var i = 0; i < len; i++) {
                                                                                                                var diff = source[i] - mean;
                                                                                                                moments += diff * diff;
                                                                                                            }
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 40 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1020..1023

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 49.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                            for (var i = 0; i < len; i++) {
                                                                                                                var diff = source[i] - mean;
                                                                                                                moments += diff * diff;
                                                                                                            }
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 40 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 968..971

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 49.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                        if (isLoScalar) {
                                                                                                            diffAxis = ro._shape.length-1;
                                                                                                            isLoLarger = false;
                                                                                                            loData = lo;
                                                                                                            roData = ro._array;
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 40 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1455..1465

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 48.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                        } else if(isRoScalar) {
                                                                                                            diffAxis = lo._shape.length-1;
                                                                                                            isLoLarger = true;
                                                                                                            roData = ro;
                                                                                                            loData = lo._array;
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 40 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1450..1465

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 48.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                                } else if(ro._shape[cr] == 1) {
                                                                                                                    shape.unshift(lo._shape[cl]);
                                                                                                                    roBroadCasted = ro.repeat(lo._shape[cl], cr);
                                                                                                                } else if(ro._shape[cr] == lo._shape[cl]) {
                                                                                                                    shape.unshift(lo._shape[cl]);
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 35 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1413..1423

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 47.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                                if (lo._shape[cl] == 1) {
                                                                                                                    shape.unshift(ro._shape[cr]);
                                                                                                                    loBroadCasted = lo.repeat(ro._shape[cr], cl);
                                                                                                                } else if(ro._shape[cr] == 1) {
                                                                                                                    shape.unshift(lo._shape[cl]);
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 35 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1416..1423

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 47.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                        if (out && !arrayEqual(this._shape, out._shape)) {
                                                                                                            throw new Error(broadcastErrorMsg(this._shape, out._shape));
                                                                                                        }
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 35 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 601..603

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 46.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                Open

                                                                                                        if (out && !arrayEqual(this._shape, out._shape)) {
                                                                                                            throw new Error(broadcastErrorMsg(this._shape, out._shape));
                                                                                                        }
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 1 other location - About 35 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1152..1154

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 46.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                Open

                                                                                                                for (var j = 0; j < axisSize; j++) {
                                                                                                                    data[idx] = indexList[j];
                                                                                                                    idx += stride;
                                                                                                                }
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 2 other locations - About 30 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 511..514
                                                                                                static/js/dncp/util/ndarray.js on lines 1119..1122

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 45.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                Open

                                                                                                                for (var j = 0; j < axisSize; j++) {
                                                                                                                    tmp[j] = source[idx];
                                                                                                                    idx += stride;
                                                                                                                }
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 2 other locations - About 30 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 511..514
                                                                                                static/js/dncp/util/ndarray.js on lines 1191..1194

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 45.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                Open

                                                                                                                    for (var j = 0; j < repeats; j++) {
                                                                                                                        data[idxRepeated] = source[idx];
                                                                                                                        idxRepeated += stride;
                                                                                                                    }
                                                                                                Severity: Minor
                                                                                                Found in static/js/dncp/util/ndarray.js and 2 other locations - About 30 mins to fix
                                                                                                static/js/dncp/util/ndarray.js on lines 1119..1122
                                                                                                static/js/dncp/util/ndarray.js on lines 1191..1194

                                                                                                Duplicated Code

                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                Tuning

                                                                                                This issue has a mass of 45.

                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                Refactorings

                                                                                                Further Reading

                                                                                                There are no issues that match your filters.

                                                                                                Category
                                                                                                Status