jiskattema/spot

View on GitHub

Showing 81 of 2,641 total issues

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 normalizeGroup has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function normalizeGroup (data, key) {
      var norm;
      var min = Number.MAX_VALUE;
      var max = -min;
      data.forEach(function (group) {
    Severity: Minor
    Found in src/widgets/views/chartjs2d.js - About 1 hr to fix

      Function initializeCharts has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function initializeCharts (view) {
        var gridster = view._widgetsGridster;
      
        // BUGFIX: can sometimes get called before gridster is fully initialized
        if (!gridster) {
      Severity: Minor
      Found in src/pages/analyze.js - About 1 hr to fix

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

        function normalizeGroup (data, key) {
          var norm;
          var min = Number.MAX_VALUE;
          var max = -min;
          data.forEach(function (group) {
        Severity: Minor
        Found in src/widgets/views/chartjs2d.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 update has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function update (view) {
          if (!view.isInitialized) {
            return;
          }
        
        
        Severity: Minor
        Found in src/widgets/views/scatter.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 tryFillSlot has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          tryFillSlot: function (facet) {
            if (this.model.tryFillSlot(facet)) {
              // Hack-ish feature:
              //  * for bubble plots, add a facet dropped as 'X axis' also as 'Point size'
              //  * for 3d scatter plots, add a facet dropped as 'X axis' also as 'Color by'
        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 prettyPrintDuration has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function prettyPrintDuration (tick) {
          var parts = [];
          var count;
          var remainder = moment.duration(tick);
        
        
        Severity: Minor
        Found in src/widgets/chartjs-duration-scale.js - About 1 hr to fix

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

          module.exports = function (tickValue, index, ticks) {
            // Find the proper tick spacing
            // if we have lots of ticks, don't use the ones
            var delta = Math.abs(ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0]);
          
          
          Severity: Minor
          Found in src/widgets/chartjs-scilinear-formatter.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if (navigator.userAgent.match(/Android/i) ||
                navigator.userAgent.match(/webOS/i) ||
                navigator.userAgent.match(/iPhone/i) ||
                navigator.userAgent.match(/iPad/i) ||
                navigator.userAgent.match(/iPod/i) ||
            Severity: Major
            Found in src/app.js - About 1 hr to fix

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

                renderContent: function () {
                  var widgetNeedsData = false;
              
                  var el = document.getElementById('facetBar');
                  this._facetsSortable = sortablejs.create(el, {
              Severity: Minor
              Found in src/pages/analyze.js - About 55 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                startHelp: function () {
              
                  console.log(app.currentPage.helpTemplate);
                  console.log(app.currentPage.helpHints);
                  console.log(app.currentPage.helpSteps);
              Severity: Minor
              Found in src/app.js - About 55 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function addWidgetForFilter has a Cognitive Complexity of 8 (exceeds 5 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 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function zenodoRequest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                zenodoRequest: async function(zenodoParams) {
              
                  var url_addition = zenodoParams.url_addition;
                  var requestType = zenodoParams.requestType;
                  var bodyData = zenodoParams.bodyData;
              Severity: Minor
              Found in src/app.js - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function initChart has a Cognitive Complexity of 8 (exceeds 5 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 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Consider simplifying this complex logical expression.
              Open

                if (
                  (partitionA.isDatetime || partitionA.isDuration || partitionA.isContinuous) &&
                  (partitionB.isDatetime || partitionB.isDuration || partitionB.isContinuous)) {
                  if (partitionA.selected && partitionA.selected.length > 0) {
                    chartData.datasets[1] = chartData.datasets[1] || {
              Severity: Major
              Found in src/widgets/views/chartjs2d.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                    if (
                      (!app.currentPage.helpTemplate || app.currentPage.helpTemplate === '') &&
                      (!app.currentPage.helpHints || app.currentPage.helpHints() === []) &&
                      (!app.currentPage.helpSteps || app.currentPage.helpTemplate === [])
                    ) {
                Severity: Major
                Found in src/app.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                            if ((e.x !== null && e.x !== undefined && !isNaN(e.x)) || (e.y !== null && e.y !== undefined && !isNaN(e.y))) {
                              errorBar.transition(easingDecimal).draw();
                            }
                  Severity: Major
                  Found in src/widgets/chartjs-errorbars.js - About 40 mins to fix

                    Function addRawValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function addRawValue (string, raw) {
                      if (typeof string !== 'string' || string.length === 0) {
                        string = '';
                      } else {
                        string = string + ', ';
                    Severity: Minor
                    Found in src/pages/configure-facet/facet-define.js - About 25 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function tryFillSlot has a Cognitive Complexity of 6 (exceeds 5 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 25 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function importJSON has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      importJSON: function () {
                        // var fileLoader = this.queryByHook('json-upload-input');
                        var fileLoader = document.getElementById('jsonuploadBtn');
                        var uploadedFile = fileLoader.files[0];
                        var reader = new window.FileReader();
                    Severity: Minor
                    Found in src/app.js - About 25 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Severity
                    Category
                    Status
                    Source
                    Language