cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

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

                if (!_.isArray(_metaObj.priority)) {
                  iViz.priorityManager
                    .setClinicalAttrPriority(_metaObj.attr_id, Number(_metaObj.priority));
                  _metaObj.priority =
                    iViz.priorityManager
Severity: Major
Found in app/scripts/model/dataProxy.js and 1 other location - About 2 hrs to fix
app/scripts/model/dataProxy.js on lines 272..278

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

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

  function mergeGrps(inputGrp1, inputGrp2) {
    var _ptr_1 = 0; // index indicator/pointer for group1
    var _ptr_2 = 0; // index indicator/pointer for group2

    // Stop when either pointer reach the end of the array
Severity: Minor
Found in app/scripts/views/components/survivalChart/components/logRankTest.js - About 2 hrs to fix

    Function getMutData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          getMutData: function(progressFunction) {
            var fetch_promise = new $.Deferred();
            var fetch_promises = [];
            var _mutDataStudyIdArr = [];
            var _mutationProfiles = this.mutationProfileIdsMap;
    Severity: Minor
    Found in app/scripts/model/dataProxy.js - About 1 hr to fix

      Function extractMutationData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          extractMutationData: function(_mutationData, _allSamples) {
            var _mutGeneMeta = {};
            var _allMutGenes = _.pluck(_mutationData, 'gene_symbol');
            var _mutGeneMetaIndex = 0;
            var self = this;
      Severity: Minor
      Found in app/scripts/main.js - About 1 hr to fix

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

                      if (_allStudyIds.length > 1) {
                        _result.groups.patient.attr_meta =
                          self.sortByNumOfStudies(_.values(_patientAttributes));
                        _result.groups.sample.attr_meta =
                          self.sortByNumOfStudies(_.values(_sampleAttributes));
        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 579..584

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

        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 {
                        _result.groups.patient.attr_meta =
                          self.sortByClinicalPriority(_.values(_patientAttributes));
                        _result.groups.sample.attr_meta =
                          self.sortByClinicalPriority(_.values(_sampleAttributes));
        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 574..579

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

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

            function initReactTable(_reloadData, _selectedSampleUids, _selectedMap) {
              if (_reloadData) {
                reactTableData = initReactData(_selectedMap, _selectedSampleUids);
              }
              var _opts = {
        Severity: Minor
        Found in app/scripts/views/components/dataTable/tableView.js - About 1 hr to fix

          Function getCnaData has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                getCnaData: function(progressFunction) {
                  var _ajaxCnaData = {};
                  var fetch_promises = [];
                  var self = this;
                  var _cnaProfiles = self.cnaProfileIdsMap;
          Severity: Minor
          Found in app/scripts/model/dataProxy.js - About 1 hr to fix

            Function updateLayoutMatrix has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  updateLayoutMatrix: function() {
                    var self_ = this;
                    var _charts = _.values(this.$root.charts);
                    _charts.sort(function(a, b) {
                      return iViz.priorityManager.comparePriorities(a.priority, b.priority, false);
            Severity: Minor
            Found in app/scripts/views/mainTemplate.js - About 1 hr to fix

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

                  ready: function() {
                    var _self = this;
                    var _attrId = _self.attributes.attr_id;
                    var _cluster = _self.ndx.dimension(function(d) {
                      if (typeof d[_attrId] === 'undefined') {
              Severity: Minor
              Found in app/scripts/views/components/pieChart/pieChartTemplate.js - About 1 hr to fix

                Function drawMarker has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function drawMarker(_slice) {
                      var _path = $(_slice).find('path');
                      var _pointsInfo = _path
                        .attr('d')
                        .split(/[\s,MLHVCSQTAZ]/);
                Severity: Minor
                Found in app/scripts/views/components/pieChart/pieChart.js - About 1 hr to fix

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

                                  configs.styles.vars.width = {
                                    one: content.util.pxStringToNumber(data['grid-w-1']) || 195,
                                    two: content.util.pxStringToNumber(data['grid-w-2']) || 400
                                  };
                  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 824..827

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

                  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

                        content.setDownloadData('svg', {
                          title: v.data.display_name,
                          chartDivId: v.opts.chartDivId,
                          chartId: v.opts.chartId,
                          fileName: v.data.display_name,
                  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 276..282

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

                  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

                        content.setDownloadData('pdf', {
                          title: v.data.display_name,
                          chartDivId: v.opts.chartDivId,
                          chartId: v.opts.chartId,
                          fileName: v.data.display_name,
                  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 269..275

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

                  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

                                  configs.styles.vars.height = {
                                    one: content.util.pxStringToNumber(data['grid-h-1']) || 170,
                                    two: content.util.pxStringToNumber(data['grid-h-2']) || 350
                                  };
                  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 820..823

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

                  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

                      template: '<div id={{chartDivId}} ' +
                      'class="grid-item grid-item-h-1 grid-item-w-1" ' +
                      ':attribute-id="attributes.attr_id" ' +
                      '@mouseenter="mouseEnter($event)" @mouseleave="mouseLeave($event)">' +
                      '<chart-operations :has-chart-title="hasChartTitle" ' +
                  Severity: Major
                  Found in app/scripts/views/components/pieChart/pieChartTemplate.js and 1 other location - About 1 hr to fix
                  app/scripts/views/components/header/breadCrumbTemplate.js on lines 7..23

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

                  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 (data_.hasNA) {
                              maxNumBarPoint = opts_.xFakeDomain[opts_.xFakeDomain.length - 2];
                            } else {
                              maxNumBarPoint = opts_.xFakeDomain[opts_.xFakeDomain.length - 1];
                            }
                  Severity: Major
                  Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 1 hr to fix
                  app/scripts/controller/util.js on lines 805..809

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

                  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

                      template: '<span class="breadcrumb_container" ' +
                      'v-if="attributes.filter.length > 0">' +
                      '<span>{{attributes.display_name}}</span><span ' +
                      'v-if="(filtersToSkipShowing.indexOf(attributes.attr_id) === -1) && ' +
                      '(specialTables.indexOf(attributes.attr_id) === -1)" class="breadcrumb_items">' +
                  Severity: Major
                  Found in app/scripts/views/components/header/breadCrumbTemplate.js and 1 other location - About 1 hr to fix
                  app/scripts/views/components/pieChart/pieChartTemplate.js on lines 7..23

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

                  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 (data_.hasNA) {
                            formattedValue = opts_.xDomain[opts_.xDomain.length - 3];
                          } else {
                            formattedValue = opts_.xDomain[opts_.xDomain.length - 2];
                          }
                  Severity: Major
                  Found in app/scripts/controller/util.js and 1 other location - About 1 hr to fix
                  app/scripts/views/components/barChart/barChart.js on lines 343..347

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

                  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

                  Consider simplifying this complex logical expression.
                  Open

                            if (_.isObject(configs_)) {
                              fetch_promise.resolve(configs_);
                            } else {
                              $.getJSON(window.cbioResourceURL + 'configs.json?' + window.appVersion)
                                .then(function(data) {
                  Severity: Critical
                  Found in app/scripts/model/dataProxy.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language