jiskattema/spot

View on GitHub

Showing 2,641 of 2,641 total issues

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

      var innerDimension = me.isHorizontal() ? me.width - (me.paddingLeft + me.paddingRight) : me.height - (me.paddingTop + me.paddingBottom);
Severity: Major
Found in src/widgets/chartjs-duration-scale.js and 1 other location - About 1 hr to fix
src/widgets/chartjs-duration-scale.js on lines 226..226

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

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

  bindings: {
    'editMode': {
      hook: 'config-view',
      type: 'toggle',
      invert: false
Severity: Major
Found in src/pages/analyze/widget-frame.js and 1 other location - About 1 hr to fix
src/pages/datasets.js on lines 150..164

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

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

      var innerWidth = me.isHorizontal() ? me.width - (me.paddingLeft + me.paddingRight) : me.height - (me.paddingTop + me.paddingBottom);
Severity: Major
Found in src/widgets/chartjs-duration-scale.js and 1 other location - About 1 hr to fix
src/widgets/chartjs-duration-scale.js on lines 366..366

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

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

      Function initChart has 29 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/chartjs1d.js - About 1 hr to fix

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

                  if (moment.isDuration(labelMoment)) {
                    scaleLabelDiffs.push(moment.duration(labelMoment).subtract(me.firstTick).as(me.tickUnit));
                  }
        Severity: Major
        Found in src/widgets/chartjs-duration-scale.js and 1 other location - About 1 hr to fix
        src/widgets/chartjs-duration-scale.js on lines 200..202

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

        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 (moment.isDuration(labelMoment)) {
                      diffsForDataset.push(moment.duration(labelMoment).subtract(me.firstTick).as(me.tickUnit));
                    }
        Severity: Major
        Found in src/widgets/chartjs-duration-scale.js and 1 other location - About 1 hr to fix
        src/widgets/chartjs-duration-scale.js on lines 182..184

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

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

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

                            if (me.isHorizontal()) {
                              labelMoment = me.parseDuration(value.x);
                            } else {
                              labelMoment = me.parseDuration(value.y);
                            }
                Severity: Major
                Found in src/widgets/chartjs-duration-scale.js and 1 other location - About 1 hr to fix
                src/widgets/chartjs-duration-scale.js on lines 148..152

                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

                            if (me.isHorizontal()) {
                              labelMoment = me.parseDuration(value.x);
                            } else {
                              labelMoment = me.parseDuration(value.y);
                            }
                Severity: Major
                Found in src/widgets/chartjs-duration-scale.js and 1 other location - About 1 hr to fix
                src/widgets/chartjs-duration-scale.js on lines 194..198

                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

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

                  search: function () {
                    this.showSearch = !this.showSearch;
                    if (this.showSearch) {
                      this.queryByHook('facet-selector').focus();
                    }
                Severity: Major
                Found in src/pages/configure-dataset.js and 1 other location - About 1 hr to fix
                src/pages/datasets.js on lines 175..180

                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

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

                    'change [data-hook~=group-maximum-input]': function () {
                      this.model.maxval = parseInt(this.queryByHook('group-maximum-input').value);
                      this.parent.resetFilter = true;
                    },
                Severity: Major
                Found in src/pages/configure-partition/partition-continuous.js and 2 other locations - About 1 hr to fix
                src/pages/configure-partition/partition-continuous.js on lines 46..49
                src/pages/configure-partition/partition-continuous.js on lines 63..66

                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

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

                    'change [data-hook~=group-minimum-input]': function () {
                      this.model.minval = parseInt(this.queryByHook('group-minimum-input').value);
                      this.parent.resetFilter = true;
                    },
                Severity: Major
                Found in src/pages/configure-partition/partition-continuous.js and 2 other locations - About 1 hr to fix
                src/pages/configure-partition/partition-continuous.js on lines 50..53
                src/pages/configure-partition/partition-continuous.js on lines 63..66

                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

                Severity
                Category
                Status
                Source
                Language