cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

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

        } else if (this.attributes.view_type === 'table') {
          if (this.specialTables.indexOf(this.attributes.attr_id) === -1) {
            this.filters.$remove(val);
          } else {
            this.filters = [];
Severity: Major
Found in app/scripts/views/components/header/breadCrumbTemplate.js and 1 other location - About 1 hr to fix
app/scripts/views/components/header/breadCrumbTemplate.js on lines 39..54

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

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

        _.each(patientAttr_, function(_attr) {
          if (attr[_attr.attr_id] === undefined &&
            _attr.view_type !== 'survival') {
            attr[_attr.attr_id] = _attr.display_name;
          }
Severity: Major
Found in app/scripts/main.js and 1 other location - About 1 hr to fix
app/scripts/main.js on lines 679..684

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

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

        _.each(sampleAttr_, function(_attr) {
          if (attr[_attr.attr_id] === undefined &&
            _attr.view_type !== 'scatter_plot') {
            attr[_attr.attr_id] = _attr.display_name;
          }
Severity: Major
Found in app/scripts/main.js and 1 other location - About 1 hr to fix
app/scripts/main.js on lines 686..691

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

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

        } else if (this.attributes.view_type === 'pie_chart') {
          if (
            this.filtersToSkipShowing.indexOf(this.attributes.attr_id) === -1) {
            this.filters.$remove(val);
          } else {
Severity: Major
Found in app/scripts/views/components/header/breadCrumbTemplate.js and 1 other location - About 1 hr to fix
app/scripts/views/components/header/breadCrumbTemplate.js on lines 48..54

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

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

    _self.elem_.svg.append('g')
      .style('stroke-width', 1)
      .style('fill', 'none')
      .style('stroke', 'black')
      .attr('class', 'survival-curve-y-axis-class')
app/scripts/views/components/survivalChart/components/curve.js on lines 45..52

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

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

    _self.elem_.svg.append('g')
      .style('stroke-width', 1)
      .style('fill', 'none')
      .style('stroke', 'black')
      .attr('class', 'survival-curve-x-axis-class')
app/scripts/views/components/survivalChart/components/curve.js on lines 61..67

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

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

    function initTsvDownloadData() {
      var data = [];
      var _cases = _.sortBy(chartInst_.dimension().top(Infinity), function(item) {
        return isNaN(item[data_.attrId]) ? Infinity : -item[data_.attrId];
      });
Severity: Minor
Found in app/scripts/views/components/barChart/barChart.js - About 1 hr to fix

    Function getCaseLists has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function(self, fetch_promise) {
              var _responseStudyCaseList = {};
              var _sampleLists = [];
    
              _.each(self.getCancerStudyIds(), function(studyId) {
    Severity: Minor
    Found in app/scripts/model/dataProxy.js - About 1 hr to fix

      Function openCases has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          openCases: function() {
            var _selectedCasesMap = {};
            var _patientData = data_.groups.patient.data;
            $.each(vm_.selectedpatientUIDs, function(key, patientUID) {
              var _caseDataObj = _patientData[patientUID];
      Severity: Minor
      Found in app/scripts/main.js - About 1 hr to fix

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

                  _.each(group, function(item) {
                    if (item) {
                      for (var j = 0; j < 2; j++) {
                        layoutB.push(item.matrix[j]);
                      }
        Severity: Major
        Found in app/scripts/views/mainTemplate.js and 1 other location - About 1 hr to fix
        app/scripts/views/mainTemplate.js on lines 151..157

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

        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

                      val = Math.ceil((d[data_.attrId] - opts_.startPoint) / opts_.gutter) *
                        opts_.gutter + opts_.startPoint - opts_.gutter / 2;
        Severity: Major
        Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 1 hr to fix
        app/scripts/views/components/barChart/barChart.js on lines 79..80

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

        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

                                tooltip.find('.saved .message .view-vs').click(function(event) {
                                  event.preventDefault();
                                  window.open(window.cbioURL + 'study?id=' +
                                    self_.savedVS.id);
                                });
        Severity: Major
        Found in app/scripts/views/components/virtualStudy/virtualStudy.js and 1 other location - About 1 hr to fix
        app/scripts/views/components/virtualStudy/virtualStudy.js on lines 240..243

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

        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

                      val = Math.ceil((d[data_.attrId] - opts_.startPoint) / opts_.gutter) *
                        opts_.gutter + opts_.startPoint + opts_.gutter / 2;
        Severity: Major
        Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 1 hr to fix
        app/scripts/views/components/barChart/barChart.js on lines 85..86

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

        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

                  _.each(group, function(item) {
                    if (item) {
                      for (var j = 2; j < 4; j++) {
                        layoutB.push(item.matrix[j]);
                      }
        Severity: Major
        Found in app/scripts/views/mainTemplate.js and 1 other location - About 1 hr to fix
        app/scripts/views/mainTemplate.js on lines 143..149

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

        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

                                tooltip.find('.saved .message .query-vs').click(function(event) {
                                  event.preventDefault();
                                  window.open(window.cbioURL + 'index.do?cancer_study_id=' + self_.savedVS.id)
                                });
        Severity: Major
        Found in app/scripts/views/components/virtualStudy/virtualStudy.js and 1 other location - About 1 hr to fix
        app/scripts/views/components/virtualStudy/virtualStudy.js on lines 235..239

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

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

                    show: function() {
                      var tooltip = $('.iviz-virtual-study-btn-qtip .qtip-content');
                      var showThis = this;
                      self_.updateSavingMessage(tooltip, 'Loading');
                      self_.updateStats = true;
        Severity: Minor
        Found in app/scripts/views/components/virtualStudy/virtualStudy.js - About 1 hr to fix

          Function getMutationCount has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function(self, fetch_promise) {
                    var fetch_promises = [];
                    var _ajaxMutationCountData = {};
                    $.when(self.getGeneticProfiles()).then(function(_profiles) {
                      var _mutationProfiles = _.filter(_profiles, function(_profile) {
          Severity: Minor
          Found in app/scripts/model/dataProxy.js - About 1 hr to fix

            Function getDataWithAttrs has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                getDataWithAttrs: function(type, attrIds) {
                  var def = new $.Deferred();
                  var isPatientAttributes = (type === 'patient');
                  var hasAttrDataMap = isPatientAttributes ? data_.groups.patient.has_attr_data : data_.groups.sample.has_attr_data;
                  var attrDataToGet = [];
            Severity: Minor
            Found in app/scripts/main.js - About 1 hr to fix

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

                iViz.view.component.SurvivalCurve.prototype.removePval = function() {
                  var _self = this;
                  _self.elem_.svg.selectAll('.pval').remove();
                };
              app/scripts/views/components/survivalChart/components/curve.js on lines 335..338

              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/pieChart/pieChartTemplate.js and 2 other locations - About 1 hr to fix
              app/scripts/views/components/barChart/barChartTemplate.js on lines 115..120
              app/scripts/views/components/dataTable/tableViewTemplate.js on lines 161..166

              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

              Severity
              Category
              Status
              Source
              Language