cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

File curve.js has 325 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';
(function(iViz, dc, _, d3, LogRankTest) {
  iViz.view.component.SurvivalCurve = function(_divId, _data, _opts) {
    var _self = this;

Severity: Minor
Found in app/scripts/views/components/survivalChart/components/curve.js - About 3 hrs to fix

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

                  if (data_.groups.sample.data[_caseIdIndex].cna_details === undefined) {
                    data_.groups.sample.data[_caseIdIndex].cna_details = [_cnaMeta[_uniqueId].index];
                  } else {
                    data_.groups.sample.data[_caseIdIndex].cna_details.push(_cnaMeta[_uniqueId].index);
                  }
    Severity: Major
    Found in app/scripts/main.js and 1 other location - About 3 hrs to fix
    app/scripts/main.js on lines 422..426

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

    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_.groups.sample.data[_caseUIdIndex].mutated_genes === undefined) {
                  data_.groups.sample.data[_caseUIdIndex].mutated_genes = [_mutGeneMeta[_uniqueId].index];
                } else {
                  data_.groups.sample.data[_caseUIdIndex].mutated_genes.push(_mutGeneMeta[_uniqueId].index);
                }
    Severity: Major
    Found in app/scripts/main.js and 1 other location - About 3 hrs to fix
    app/scripts/main.js on lines 493..497

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

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

      vcSession.utils = (function() {
        var virtualCohort_ = {
          name: '',
          description: '',
          filters: '',
    Severity: Major
    Found in app/scripts/session/sessionUtil.js - About 3 hrs to fix

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

          function barChartDownload(fileType, content) {
            switch (fileType) {
            case 'tsv':
              csvDownload(content.fileName || 'data', content.data);
              break;
      Severity: Major
      Found in app/scripts/controller/util.js and 1 other location - About 3 hrs to fix
      app/scripts/controller/util.js on lines 14..34

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

      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

          function pieChartDownload(fileType, content) {
            switch (fileType) {
              case 'tsv':
                csvDownload(content.fileName || 'data', content.data);
                break;
      Severity: Major
      Found in app/scripts/controller/util.js and 1 other location - About 3 hrs to fix
      app/scripts/controller/util.js on lines 337..357

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

      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 (this.invisibleChartFilters.length > 0) {
                  var filtersMap = {};
                  _.each(this.invisibleChartFilters, function(filter) {
                    if (filtersMap[filter] === undefined) {
                      filtersMap[filter] = true;
      Severity: Major
      Found in app/scripts/views/chartGroupTemplate.js and 1 other location - About 3 hrs to fix
      app/scripts/views/chartGroupTemplate.js on lines 61..71

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

      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 (this.invisibleChartFilters.length > 0) {
                  var filtersMap = {};
                  _.each(this.invisibleChartFilters, function(filter) {
                    if (filtersMap[filter] === undefined) {
                      filtersMap[filter] = true;
      Severity: Major
      Found in app/scripts/views/chartGroupTemplate.js and 1 other location - About 3 hrs to fix
      app/scripts/views/chartGroupTemplate.js on lines 114..124

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

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

        iViz.view.component.SurvivalCurve = function(_divId, _data, _opts) {
          var _self = this;
      
          _self.elem_ = '';
          _self.divId_ = _divId;
      Severity: Major
      Found in app/scripts/views/components/survivalChart/components/curve.js - About 3 hrs to fix

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

              getAllCNASamples: function() {
                var samples = {};
                var self = this;
                _.each(Object.keys(self.studyCasesMap), function(studyId) {
                  samples[studyId] = self.data.sampleLists.cna[studyId] || self.data.sampleLists.all[studyId]
        Severity: Major
        Found in app/scripts/model/dataProxy.js and 1 other location - About 3 hrs to fix
        app/scripts/model/dataProxy.js on lines 1200..1207

        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

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

              getAllMutatedGeneSamples: function() {
                var samples = {};
                var self = this;
                _.each(Object.keys(self.studyCasesMap), function(studyId) {
                  samples[studyId] = self.data.sampleLists.sequenced[studyId] || self.data.sampleLists.all[studyId]
        Severity: Major
        Found in app/scripts/model/dataProxy.js and 1 other location - About 3 hrs to fix
        app/scripts/model/dataProxy.js on lines 1208..1215

        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

        Function pieChartCanvasDownload has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function pieChartCanvasDownload(data, downloadOpts) {
              var _svgElement = '';
        
              var _width = getPieWidthInfo(data);
              var _pieLabelString = '';
        Severity: Major
        Found in app/scripts/controller/util.js - About 3 hrs to fix

          Function update-all-filters has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                'update-all-filters': function(updateType_) {
                  var _selectedCasesByFilters = [];
                  var _counterSelectedCasesByFilters = [];
                  var self_ = this;
                  var _hasFilters = false;
          Severity: Major
          Found in app/scripts/views/mainTemplate.js - About 3 hrs to fix

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

                          _.each(data, function(list) {
                            self.data.sampleLists[list.studyId] = self.data.sampleLists[list.studyId] || {};
                            self.data.sampleLists[list.studyId][list.sampleListId] = list.sampleIds.sort();
                          });
            Severity: Major
            Found in app/scripts/model/dataProxy.js and 1 other location - About 3 hrs to fix
            app/scripts/model/dataProxy.js on lines 914..917

            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

                          _.each(data, function(list) {
                            self.data.sampleLists[list.studyId] = self.data.sampleLists[list.studyId] || {};
                            self.data.sampleLists[list.studyId][list.sampleListId] = list.sampleIds.sort();
                          });
            Severity: Major
            Found in app/scripts/model/dataProxy.js and 1 other location - About 3 hrs to fix
            app/scripts/model/dataProxy.js on lines 1093..1096

            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

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

                  } else {
                    chartInst_.xAxis().tickValues(opts_.xDomain);
                    chartInst_.x(d3.scale.linear()
                      .domain([
                        opts_.xDomain[0] - opts_.gutter,
            Severity: Major
            Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 3 hrs to fix
            app/scripts/views/components/barChart/barChart.js on lines 147..154

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

            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 (data_.noGrouping) {
                    chartInst_.xAxis().tickValues(opts_.xFakeDomain);
                    chartInst_.x(d3.scale.linear()
                      .domain([
                        opts_.xFakeDomain[0] - opts_.gutter,
            Severity: Major
            Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 3 hrs to fix
            app/scripts/views/components/barChart/barChart.js on lines 154..161

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

            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

                    $.when.apply($, fetch_promises)
                      .done(function() {
                        fetch_promise.resolve(_ajaxCnaData);
                      })
                      .fail(function() {
            Severity: Major
            Found in app/scripts/model/dataProxy.js and 1 other location - About 3 hrs to fix
            app/scripts/model/dataProxy.js on lines 1378..1389

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

            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

                    $.when.apply($, fetch_promises)
                      .done(function() {
                        fetch_promise.resolve(_mutDataStudyIdArr);
                      })
                      .fail(function() {
            Severity: Major
            Found in app/scripts/model/dataProxy.js and 1 other location - About 3 hrs to fix
            app/scripts/model/dataProxy.js on lines 1287..1298

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

            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

                      $.get(window.cbioURL + 'api/studies')
                        .done(function(response) {
                          _.each(response, function(study) {
                            study.studyType = 'regular';
                            _self.data.studies[study.studyId] = study;
            Severity: Major
            Found in app/scripts/model/dataProxy.js and 1 other location - About 3 hrs to fix
            app/scripts/model/dataProxy.js on lines 1633..1643

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

            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