jiskattema/spot

View on GitHub

Showing 2,641 of 2,641 total issues

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

    if (app.CSVComment === '#') {
      this.query('#CSV-comment-pound').checked = true;
    } else if (app.CSVComment === '!') {
      this.query('#CSV-comment-exclamation').checked = true;
    } else if (app.CSVComment === '/') {
Severity: Major
Found in src/pages/datasets.js and 1 other location - About 5 hrs to fix
src/pages/datasets.js on lines 93..103

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

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

  derived: {
    minvalAsText: {
      deps: ['model.minval', 'model.isDatetime'],
      fn: function () {
        if (this.model.isDatetime) {
Severity: Major
Found in src/pages/configure-partition/partition-datetime.js and 1 other location - About 4 hrs to fix
src/pages/configure-partition/partition-duration.js on lines 7..28

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

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

  derived: {
    minvalAsText: {
      deps: ['model.minval', 'model.isDuration'],
      fn: function () {
        if (this.model.isDuration) {
Severity: Major
Found in src/pages/configure-partition/partition-duration.js and 1 other location - About 4 hrs to fix
src/pages/configure-partition/partition-datetime.js on lines 8..29

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

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

function update (view) {
  if (!view.isInitialized) {
    return;
  }

Severity: Major
Found in src/widgets/views/chartjs1d.js - About 4 hrs to fix

    Function prettyPrintDuration has a Cognitive Complexity of 32 (exceeds 5 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 4 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 updateBubbles has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function updateBubbles (view) {
      var filter = view.model.filter;
      var chartData = view._config.data;
    
      var partitionA = filter.partitions.get(1, 'rank');
    Severity: Major
    Found in src/widgets/views/chartjs2d.js - About 4 hrs to fix

      Function renderContent has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

            if (perItem) {
              chartData.datasets[j].backgroundColor = [];
              chartData.datasets[j].borderColor = [];
              for (i = 0; i < x; i++) {
                chartData.datasets[j].backgroundColor[i] = colors.getColor(0).css();
        Severity: Major
        Found in src/widgets/views/util.js and 1 other location - About 3 hrs to fix
        src/widgets/views/util.js on lines 104..115

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

        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 (perItem) {
              chartData.datasets[j].backgroundColor = [];
              chartData.datasets[j].borderColor = [];
              for (i = 0; i < x; i++) {
                chartData.datasets[j].backgroundColor[i] = colors.getColor(0).css();
        Severity: Major
        Found in src/widgets/views/util.js and 1 other location - About 3 hrs to fix
        src/widgets/views/util.js on lines 135..145

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

        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 (aggregate) {
            errorYFn = function (group) {
              if (group.cc !== misval) {
                return parseFloat(group.cc) || 0;
              }
        Severity: Major
        Found in src/widgets/views/chartjs1d.js and 1 other location - About 3 hrs to fix
        src/widgets/views/chartjs2d.js on lines 221..231

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

        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 (aggregate) {
            errorYFn = function (group) { return group['dd']; };
          } else {
            errorYFn = function (group) { return null; };
            if (view._config.options.errorDir === 'vertical') {
        Severity: Major
        Found in src/widgets/views/chartjs2d.js and 1 other location - About 3 hrs to fix
        src/widgets/views/chartjs1d.js on lines 145..160

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

        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

                dataset.facets.forEach(function (facet, i) {
                  if (i < 20) {
                    facet.isActive = true;
        
                    if (facet.isCategorial) {
        Severity: Major
        Found in src/app.js and 1 other location - About 3 hrs to fix
        src/app.js on lines 603..613

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

        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

                  dataset.facets.forEach(function (facet, i) {
                    if (i < 20) {
                      facet.isActive = true;
        
                      if (facet.isCategorial) {
        Severity: Major
        Found in src/app.js and 1 other location - About 3 hrs to fix
        src/app.js on lines 511..521

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

        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

        File datasets.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var Spot = require('spot-framework');
        var PageView = require('./base');
        var templates = require('../templates');
        var app = require('ampersand-app');
        var $ = require('jquery');
        Severity: Minor
        Found in src/pages/datasets.js - About 3 hrs to fix

          File analyze.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var app = require('ampersand-app');
          var $ = require('jquery');
          var PageView = require('./base');
          var templates = require('../templates');
          var WidgetFrameView = require('./analyze/widget-frame');
          Severity: Minor
          Found in src/pages/analyze.js - About 3 hrs to fix

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

                'click [data-hook~=group-durationrange-button]': function () {
                  var partition = this.model;
                  partition.reset();
            
                  this.queryByHook('group-startduration-input').dispatchEvent(new window.Event('input'));
            Severity: Major
            Found in src/pages/configure-partition/partition-duration.js and 2 other locations - About 3 hrs to fix
            src/pages/configure-partition/partition-continuous.js on lines 54..61
            src/pages/configure-partition/partition-datetime.js on lines 51..58

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

            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

            function deinitChart (view) {
              if (view._chartjs) {
                view._chartjs.destroy();
                delete view._chartjs;
              }
            Severity: Major
            Found in src/widgets/views/chartjs2d.js and 2 other locations - About 3 hrs to fix
            src/widgets/views/chartjs.js on lines 69..81
            src/widgets/views/chartjs1d.js on lines 21..33

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

            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

            function deinitChart (view) {
              if (view._chartjs) {
                view._chartjs.destroy();
                delete view._chartjs;
              }
            Severity: Major
            Found in src/widgets/views/chartjs.js and 2 other locations - About 3 hrs to fix
            src/widgets/views/chartjs1d.js on lines 21..33
            src/widgets/views/chartjs2d.js on lines 50..62

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

            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

                'click [data-hook~=group-datetimerange-button]': function () {
                  var partition = this.model;
                  partition.reset();
            
                  this.queryByHook('group-startdate-input').dispatchEvent(new window.Event('input'));
            Severity: Major
            Found in src/pages/configure-partition/partition-datetime.js and 2 other locations - About 3 hrs to fix
            src/pages/configure-partition/partition-continuous.js on lines 54..61
            src/pages/configure-partition/partition-duration.js on lines 46..53

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

            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

            function deinitChart (view) {
              if (view._chartjs) {
                view._chartjs.destroy();
                delete view._chartjs;
              }
            Severity: Major
            Found in src/widgets/views/chartjs1d.js and 2 other locations - About 3 hrs to fix
            src/widgets/views/chartjs.js on lines 69..81
            src/widgets/views/chartjs2d.js on lines 50..62

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

            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