cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

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

          if (smallerOutlier.length > 0) {
            this.data.min = Number(_.max(smallerOutlier));
            this.data.smallerOutlier = this.data.min;
          }
Severity: Major
Found in app/scripts/views/components/barChart/barChartTemplate.js and 1 other location - About 1 hr to fix
app/scripts/views/components/barChart/barChartTemplate.js on lines 216..219

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

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

        animateTable('#' + v.opts.chartDivId, 'pie', function() {
          vm.$dispatch('update-grid');
          $('#' + v.opts.chartDivId).css('z-index', '1');
        });
Severity: Major
Found in app/scripts/views/components/pieChart/pieChart.js and 1 other location - About 1 hr to fix
app/scripts/views/components/pieChart/pieChart.js on lines 93..96

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

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 (greaterOutlier.length > 0) {
            this.data.max = Number(_.min(greaterOutlier));
            this.data.greaterOutlier = this.data.max;
          }
Severity: Major
Found in app/scripts/views/components/barChart/barChartTemplate.js and 1 other location - About 1 hr to fix
app/scripts/views/components/barChart/barChartTemplate.js on lines 211..214

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

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

        animateTable('#' + v.opts.chartDivId, 'table', function() {
          vm.$dispatch('update-grid');
          $('#' + v.opts.chartDivId).css('z-index', '');
        });
Severity: Major
Found in app/scripts/views/components/pieChart/pieChart.js and 1 other location - About 1 hr to fix
app/scripts/views/components/pieChart/pieChart.js on lines 98..101

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

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 3 locations. Consider refactoring.
Open

        this.$dispatch('create-rainbow-survival', {
          attrId: this.attributes.attr_id,
          subtitle: ' (' + this.attributes.display_name + ')',
          groups: groups,
          groupType: this.attributes.group_type
Severity: Major
Found in app/scripts/views/components/barChart/barChartTemplate.js and 2 other locations - About 1 hr to fix
app/scripts/views/components/dataTable/tableViewTemplate.js on lines 161..166
app/scripts/views/components/pieChart/pieChartTemplate.js on lines 111..116

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

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 3 locations. Consider refactoring.
Open

        this.$dispatch('create-rainbow-survival', {
          attrId: this.attributes.attr_id,
          subtitle: ' (' + this.attributes.display_name + ')',
          groups: groups,
          groupType: this.attributes.group_type
app/scripts/views/components/barChart/barChartTemplate.js on lines 115..120
app/scripts/views/components/pieChart/pieChartTemplate.js on lines 111..116

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

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

  iViz.view.component.SurvivalCurve.prototype.removeNoInfo = function() {
    var _self = this;
    _self.elem_.svg.selectAll('.noInfo').remove();
  };
app/scripts/views/components/survivalChart/components/curve.js on lines 340..343

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

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

      'update-filters': function(redrawGroup) {
        if (!this.clearGroup) {
          if (redrawGroup) {
            dc.redrawAll(this.id);
          }
Severity: Minor
Found in app/scripts/views/chartGroupTemplate.js - About 1 hr to fix

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

        var generateVSDescription_ = function(_studies, _filters) {
          var _desp = '';
          if (_studies.studies.length > 0) {
            _desp = _studies.count + (_studies.count > 1 ? ' samples ' : ' sample ')
              + 'from ' + _studies.studies.length +
    Severity: Minor
    Found in app/scripts/session/sessionUtil.js - About 1 hr to fix

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

          content.updateDataForDownload = function(fileType) {
            if (fileType === 'tsv') {
              initTsvDownloadData();
            } else if (['pdf', 'svg'].indexOf(fileType) !== -1) {
              initCanvasDownloadData();
      Severity: Major
      Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 1 hr to fix
      app/scripts/views/components/pieChart/pieChart.js on lines 132..138

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

      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

            var labelMaxFreq = _.last(_.sortBy(_.pluck(labels, 'sampleRate'),
              function(item) {
                return item.toString().length;
              })).toString().length;
      Severity: Major
      Found in app/scripts/controller/util.js and 2 other locations - About 1 hr to fix
      app/scripts/controller/util.js on lines 39..42
      app/scripts/controller/util.js on lines 43..46

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

      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

            var labelMaxName = _.last(_.sortBy(_.pluck(labels, 'name'),
              function(item) {
                return item.toString().length;
              })).toString().length;
      Severity: Major
      Found in app/scripts/controller/util.js and 2 other locations - About 1 hr to fix
      app/scripts/controller/util.js on lines 43..46
      app/scripts/controller/util.js on lines 47..50

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

      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

          content.updateDataForDownload = function(fileType) {
            if (fileType === 'tsv') {
              initTsvDownloadData();
            } else if (['pdf', 'svg'].indexOf(fileType) !== -1) {
              initCanvasDownloadData();
      Severity: Major
      Found in app/scripts/views/components/pieChart/pieChart.js and 1 other location - About 1 hr to fix
      app/scripts/views/components/barChart/barChart.js on lines 492..498

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

      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

            var labelMaxNumber = _.last(_.sortBy(_.pluck(labels, 'cases'),
              function(item) {
                return item.toString().length;
              })).toString().length;
      Severity: Major
      Found in app/scripts/controller/util.js and 2 other locations - About 1 hr to fix
      app/scripts/controller/util.js on lines 39..42
      app/scripts/controller/util.js on lines 47..50

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

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

              function(self, fetch_promise) {
                $.get(window.cbioURL + 'api/clinical-attributes?projection=SUMMARY&pageSize=100000&pageNumber=0&direction=ASC')
                  .done(function(data) {
                    var attributes = {};
                    _.each(data, function(attribute) {
      Severity: Minor
      Found in app/scripts/model/dataProxy.js - About 1 hr to fix

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

            function initTsvDownloadData() {
              var attrs =
                iViz.util.tableView.getAttributes(type_).filter(function(attr) {
                  return attr.attr_id !== 'uniqueId' && (_.isBoolean(attr.show) ? attr.show : true);
                });
        Severity: Minor
        Found in app/scripts/views/components/dataTable/tableView.js - About 1 hr to fix

          Function ready has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              ready: function() {
                var _self = this;
                var attrId =
                  this.attributes.group_type === 'patient' ? 'patient_uid' : 'sample_uid';
                this.invisibleDimension = this.ndx.dimension(function(d) {
          Severity: Minor
          Found in app/scripts/views/components/survivalChart/template.js - About 1 hr to fix

            Function getCnaFractionData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function(self, fetch_promise) {
                      var _ajaxCnaFractionData = {};
                      var cancer_study_ids = self.getCancerStudyIds();
                      var _studyCasesMap = self.getStudyCasesMap();
                      var fetch_promises = [];
            Severity: Minor
            Found in app/scripts/model/dataProxy.js - About 1 hr to fix

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

                      $.ajax({
                        type: 'POST',
                        url: window.cbioURL + 'api/gene-panel-data/fetch',
                        data: JSON.stringify({
                          "sampleMolecularIdentifiers": map
              Severity: Major
              Found in app/scripts/model/dataProxy.js and 1 other location - About 1 hr to fix
              app/scripts/model/dataProxy.js on lines 1006..1076

              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

                          $.ajax({
                            type: 'POST',
                            url: window.cbioURL + 'api/samples/fetch?projection=SUMMARY',
                            data: JSON.stringify({
                              "sampleIdentifiers": data
              Severity: Major
              Found in app/scripts/model/dataProxy.js and 1 other location - About 1 hr to fix
              app/scripts/model/dataProxy.js on lines 1408..1481

              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

              Severity
              Category
              Status
              Source
              Language