jiskattema/spot

View on GitHub

Showing 2,641 of 2,641 total issues

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 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 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

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

                    xAxes: [{
                      stacked: true,
                      position: 'bottom',
                      scaleLabel: {
                        display: true,
          Severity: Major
          Found in src/widgets/models/barchart.js and 1 other location - About 1 hr to fix
          src/widgets/models/barchart.js on lines 69..81

          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 63.

          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

                    yAxes: [{
                      stacked: true,
                      position: 'left',
                      scaleLabel: {
                        display: true,
          Severity: Major
          Found in src/widgets/models/barchart.js and 1 other location - About 1 hr to fix
          src/widgets/models/barchart.js on lines 56..68

          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 63.

          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 (aggregate) {
              bubbleColorFn = normalizeGroup(filter.data, 'aa');
              chartData.datasets[0].spotAxes.c = aggregate.operation + ' ' + aggregate.label;
            }
          Severity: Major
          Found in src/widgets/views/chartjs2d.js and 1 other location - About 1 hr to fix
          src/widgets/views/chartjs2d.js on lines 206..209

          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 62.

          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 (aggregate) {
              bubbleRadiusFn = normalizeGroup(filter.data, 'bb');
              chartData.datasets[0].spotAxes.r = aggregate.operation + ' ' + aggregate.label;
            }
          Severity: Major
          Found in src/widgets/views/chartjs2d.js and 1 other location - About 1 hr to fix
          src/widgets/views/chartjs2d.js on lines 200..203

          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 62.

          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

          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

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

                reader.onprogress = function (ev) {
                  if (ev.lengthComputable) {
                    // ev.loaded and ev.total are ProgressEvent properties
                    app.progress(parseInt(100.0 * ev.loaded / ev.total));
                  }
            Severity: Major
            Found in src/app.js and 1 other location - About 1 hr to fix
            src/app.js on lines 638..643

            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 61.

            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

                reader.onprogress = function (ev) {
                  if (ev.lengthComputable) {
                    // ev.loaded and ev.total are ProgressEvent properties
                    app.progress(parseInt(100.0 * ev.loaded / ev.total));
                  }
            Severity: Major
            Found in src/app.js and 1 other location - About 1 hr to fix
            src/app.js on lines 552..557

            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 61.

            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

            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 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 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 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 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

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

                          bindings: {
                            'model.isLockedDown': {
                              type: 'toggle',
                              hook: 'add-datasets-div',
                              invert: true
                        Severity: Major
                        Found in src/pages/datasets.js and 1 other location - About 1 hr to fix
                        src/pages/analyze/widget-frame.js on lines 64..78

                        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 59.

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language