jiskattema/spot

View on GitHub

Showing 81 of 2,641 total issues

Consider simplifying this complex logical expression.
Open

    if (i >= 0 && j >= 0 && group.aa !== misval && group.bb !== misval && group.count !== 0) {
      // initialize if necessary
      chartData.datasets[0].data[d] = chartData.datasets[0].data[d] || {};
      chartData.datasets[0].error[d] = chartData.datasets[0].error[d] || {};

Severity: Critical
Found in src/widgets/views/chartjs2d.js - About 1 hr to fix

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

        draw: function () {
          var ctx = this._chart.ctx;
          var vm = this._view;
    
          if (vm.direction === 'none') {
    Severity: Minor
    Found in src/widgets/chartjs-errorbars.js - About 1 hr to fix

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

        render: function () {
          // Reset the CSV parsing dialog.
          // NOTE: we could do this via bindings, but this is easier (less code)
          this.renderWithTemplate(this);
          this.query('#CSV-header-columns').checked = app.CSVHeaders;
      Severity: Minor
      Found in src/pages/datasets.js - About 1 hr to fix

        Function fn has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

              fn: function () {
                var filter = this.collection.parent.filter;
        
                // stop accepting DND
                if (this._sortable) {
        Severity: Minor
        Found in src/pages/analyze/slot.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 render has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          render: function () {
            // Reset the CSV parsing dialog.
            // NOTE: we could do this via bindings, but this is easier (less code)
            this.renderWithTemplate(this);
            this.query('#CSV-header-columns').checked = app.CSVHeaders;
        Severity: Minor
        Found in src/pages/datasets.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 startWelcome has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          startWelcome: function () {
            var welcome = Help();
            welcome.setOption('tooltipClass', 'welcome-dialog');
            welcome.setOptions({
              'showStepNumbers': false,
        Severity: Minor
        Found in src/app.js - About 1 hr to fix

          Function exportData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            exportData: function () {
              var chartsData = [];
          
              var partitionRankToName = {1: 'a', 2: 'b', 3: 'c', 4: 'd'};
              var aggregateRankToName = {1: 'aa', 2: 'bb', 3: 'cc', 4: 'dd', 5: 'ee'};
          Severity: Minor
          Found in src/app.js - About 1 hr to fix

            Function updateErrorBar has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                updateErrorBar: function updateErrorBar (errorBar, element, index, reset) {
                  var dataset = this.getDataset();
                  var meta = this.getMeta();
                  var xScale = this.getScaleForId(meta.xAxisID);
                  var yScale = this.getScaleForId(meta.yAxisID);
            Severity: Minor
            Found in src/widgets/chartjs-errorbars.js - About 1 hr to fix

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

              function drawGraph (view) {
                var filter = view.model.filter;
                var edgeToCount = {};
                var count;
                var type;
              Severity: Minor
              Found in src/widgets/views/sigma.js - About 1 hr to fix

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

                    reader.onload = function (ev) {
                      app.message({
                        text: 'Processing',
                        type: 'ok'
                      });
                Severity: Minor
                Found in src/app.js - About 1 hr to fix

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

                    initialize: function () {
                      var filter = this.collection.parent.filter;
                      this.model.isFilled = false;
                  
                      if (filter) {
                  Severity: Minor
                  Found in src/pages/analyze/slot.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 rotateSetting has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    rotateSetting: function () {
                      var filter = this.collection.parent.filter;
                      filter.releaseDataFilter();
                  
                      if (this.model.type === 'partition') {
                  Severity: Minor
                  Found in src/pages/analyze/slot.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 initChart has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function initChart (view) {
                    // Configure plot
                    view._config = view.model.chartjsConfig();
                    var options = view._config.options;
                  
                  
                  Severity: Minor
                  Found in src/widgets/views/chartjs.js - About 1 hr to fix

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

                        buildLabelDiffs: function () {
                          var me = this;
                          me.labelDiffs = [];
                          var scaleLabelDiffs = [];
                          // Parse common labels once
                    Severity: Minor
                    Found in src/widgets/chartjs-duration-scale.js - About 1 hr to fix

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

                      function addWidgetForFilter (view, filter, editModeHint) {
                        var gridster = view._widgetsGridster;
                        var row = filter.row || 1;
                        var col = filter.col || 1;
                        var sizeX = filter.size_x || 3;
                      Severity: Minor
                      Found in src/pages/analyze.js - About 1 hr to fix

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

                          initialize: function () {
                            this.slots.reset([
                              {
                                description: 'Group by',
                                type: 'partition',
                        Severity: Minor
                        Found in src/widgets/models/barchart.js - About 1 hr to fix

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

                            initialize: function () {
                              this.slots.reset([
                                {
                                  description: 'X axis',
                                  type: 'partition',
                          Severity: Minor
                          Found in src/widgets/models/scatter.js - About 1 hr to fix

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

                              initialize: function () {
                                this.slots.reset([
                                  {
                                    description: 'Group by',
                                    type: 'partition',
                            Severity: Minor
                            Found in src/widgets/models/horizontalbarchart.js - About 1 hr to fix

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

                                tryFillSlot: function (facet, operation) {
                                  var filter = this.collection.parent.filter;
                                  if (!filter || this.isFilled) {
                                    return false;
                                  }
                              Severity: Minor
                              Found in src/widgets/models/slot.js - About 1 hr to fix

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

                                  importRemoteSession: function (sessionUrl) {
                                    // console.log('app.js: Getting the remote session.');
                                    var that = this;
                                
                                    app.busy({enable: true});
                                Severity: Minor
                                Found in src/app.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language