lib/graph3d/DataGroup.js

Summary

Maintainability
D
1 day
Test Coverage

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

DataGroup.prototype.initDataAsMatrix = function(data) {
  // TODO: store the created matrix dataPoints in the filters instead of
  //       reloading each time.
  var x, y, i, obj;

Severity: Minor
Found in lib/graph3d/DataGroup.js - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function initializeData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

DataGroup.prototype.initializeData = function(graph3d, rawData, style) {
  if (rawData === undefined) return;

  if (Array.isArray(rawData)) {
    rawData = new DataSet(rawData);
Severity: Minor
Found in lib/graph3d/DataGroup.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function initializeData has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DataGroup.prototype.initializeData = function(graph3d, rawData, style) {
  if (rawData === undefined) return;

  if (Array.isArray(rawData)) {
    rawData = new DataSet(rawData);
Severity: Major
Found in lib/graph3d/DataGroup.js - About 2 hrs to fix

    File DataGroup.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var DataSet  = require('../DataSet');
    var DataView = require('../DataView');
    var Range    = require('./Range');
    var Filter = require('./Filter');
    var Settings = require('./Settings');
    Severity: Minor
    Found in lib/graph3d/DataGroup.js - About 2 hrs to fix

      Function _getDataPoints has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      DataGroup.prototype._getDataPoints = function (data) {
        var dataPoints = [];
      
        if (this.style === Settings.STYLE.GRID || this.style === Settings.STYLE.SURFACE) {
          dataPoints = this.initDataAsMatrix(data);
      Severity: Minor
      Found in lib/graph3d/DataGroup.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

      DataGroup.prototype.initDataAsMatrix = function(data) {
        // TODO: store the created matrix dataPoints in the filters instead of
        //       reloading each time.
        var x, y, i, obj;
      
      
      Severity: Minor
      Found in lib/graph3d/DataGroup.js - About 1 hr to fix

        TODO found
        Open

         * TODO: if/when combined settings per axis defined, get rid of this.
        Severity: Minor
        Found in lib/graph3d/DataGroup.js by fixme

        TODO found
        Open

         * TODO: if/when combined settings per axis defined, rewrite this.
        Severity: Minor
        Found in lib/graph3d/DataGroup.js by fixme

        TODO found
        Open

            // TODO: implement Array().indexOf() for Internet Explorer
        Severity: Minor
        Found in lib/graph3d/DataGroup.js by fixme

        TODO found
        Open

          // TODO: store the created matrix dataPoints in the filters instead of
        Severity: Minor
        Found in lib/graph3d/DataGroup.js by fixme

        TODO found
        Open

         * TODO: Pass settings only instead.
        Severity: Minor
        Found in lib/graph3d/DataGroup.js by fixme

        TODO found
        Open

          // TODO: Perhaps it's better if an error is thrown if the values do not agree.
        Severity: Minor
        Found in lib/graph3d/DataGroup.js by fixme

        There are no issues that match your filters.

        Category
        Status