cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

Function getSampleClinicalData has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var getSampleClinicalData = function(self, attr_ids) {
      var def = new $.Deferred();
      var fetch_promises = [];
      var clinical_data = {};
      if (_.isArray(attr_ids)) {
Severity: Major
Found in app/scripts/model/dataProxy.js - About 2 hrs to fix

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

        ready: function() {
          var _self = this;
          var callbacks = {};
          var attrId = this.attributes.attr_id;
    
    
    Severity: Major
    Found in app/scripts/views/components/dataTable/tableViewTemplate.js - About 2 hrs to fix

      Function getTickFormat has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          content.getTickFormat = function(v, logScale, data_, opts_) {
            var _returnValue = v;
            var index = 0;
            var e = d3.format('.1e');// convert small data to scientific notation format
            var formattedValue = '';
      Severity: Major
      Found in app/scripts/controller/util.js - About 2 hrs to fix

        Function initDCPieChart has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function initDCPieChart() {
              if (v.opts.hasOwnProperty('chartId') &&
                v.data.hasOwnProperty('ndx') &&
                v.data.hasOwnProperty('attr_id')) {
                var width = v.opts.width || 130;
        Severity: Major
        Found in app/scripts/views/components/pieChart/pieChart.js - About 2 hrs to fix

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

                _.each(_allSamples, function(samples, studyId) {
                  _.each(samples, function(sampleId) {
                    tableData_.cna_details.allSamples.push({
                      "molecularProfileId": window.iviz.datamanager.getCNAProfileIdByStudyId(studyId),
                      "sampleId": sampleId
          Severity: Major
          Found in app/scripts/main.js and 1 other location - About 2 hrs to fix
          app/scripts/main.js on lines 440..447

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

          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(_allSamples, function(samples, studyId) {
                  _.each(samples, function(sampleId) {
                    tableData_.mutated_genes.allSamples.push({
                      "molecularProfileId": window.iviz.datamanager.getMutationProfileIdByStudyId(studyId),
                      "sampleId": sampleId
          Severity: Major
          Found in app/scripts/main.js and 1 other location - About 2 hrs to fix
          app/scripts/main.js on lines 512..519

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

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

                      setSelectedCases: function(selectionType, selectedCases) {
                        var radioVal = selectionType;
                        var selectedCaseUIDs = [];
                        var unmappedCaseIDs = [];
          
          
          Severity: Major
          Found in app/scripts/vueCore.js - About 2 hrs to fix

            Function SurvivalChartProxy has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              iViz.data.SurvivalChartProxy = function(_data, _attrId) {
                var datumArr_ = [];
            
                // convert raw data
                var _totalNum = 0;
            Severity: Major
            Found in app/scripts/views/components/survivalChart/proxy.js - About 2 hrs to fix

              Function getConfigs has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function(self, fetch_promise) {
                        if (_.isObject(configs_)) {
                          fetch_promise.resolve(configs_);
                        } else {
                          $.getJSON(window.cbioResourceURL + 'configs.json?' + window.appVersion)
              Severity: Major
              Found in app/scripts/model/dataProxy.js - About 2 hrs to fix

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

                    template: '<div class="chart-header" id="{{chartId}}-chart-header">' +
                    '<div class="chart-title" ' +
                    ':class="[showOperations?chartTitleActive:chartTitle]" ' +
                    'v-if="hasChartTitle">' +
                    '<span class="chart-title-span" id="{{chartId}}-title">{{displayName}}' +
                Severity: Major
                Found in app/scripts/views/components/chartOperationsHeader.js and 1 other location - About 2 hrs to fix
                app/scripts/views/components/barChart/barChartTemplate.js on lines 7..27

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

                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-w-2 grid-item-h-1 bar-chart" ' +
                    ':attribute-id="attributes.attr_id" @mouseenter="mouseEnter" ' +
                    ':layout-number="attributes.layout" ' +
                    '@mouseleave="mouseLeave">' +
                Severity: Major
                Found in app/scripts/views/components/barChart/barChartTemplate.js and 1 other location - About 2 hrs to fix
                app/scripts/views/components/chartOperationsHeader.js on lines 7..27

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

                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.showPieIcon) {
                          this.$nextTick(function() {
                            $('#' + this.chartId + '-chart-header .fa-pie-chart').qtip($.extend(true, this.titleIconQtipOpts, {
                              content: {
                                text: 'Convert table to pie chart'
                Severity: Major
                Found in app/scripts/views/components/chartOperationsHeader.js and 1 other location - About 2 hrs to fix
                app/scripts/views/components/chartOperationsHeader.js on lines 148..156

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

                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.showTableIcon) {
                          this.$nextTick(function() {
                            $('#' + this.chartId + '-chart-header .fa-table').qtip($.extend(true, this.titleIconQtipOpts, {
                              content: {
                                text: 'Convert pie chart to table'
                Severity: Major
                Found in app/scripts/views/components/chartOperationsHeader.js and 1 other location - About 2 hrs to fix
                app/scripts/views/components/chartOperationsHeader.js on lines 158..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 80.

                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(categories, function(category) {
                          if (dataForCategories.hasOwnProperty(category.name)) {
                            groups.push({
                              name: category.name,
                              caseIds: dataForCategories[category.name],
                Severity: Major
                Found in app/scripts/views/components/pieChart/pieChartTemplate.js and 1 other location - About 2 hrs to fix
                app/scripts/views/components/dataTable/tableViewTemplate.js on lines 152..160

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 80.

                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(categories, function(category) {
                          if (dataForCategories.hasOwnProperty(category.name)) {
                            groups.push({
                              name: category.name,
                              caseIds: dataForCategories[category.name],
                Severity: Major
                Found in app/scripts/views/components/dataTable/tableViewTemplate.js and 1 other location - About 2 hrs to fix
                app/scripts/views/components/pieChart/pieChartTemplate.js on lines 102..110

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

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

                    content.getColors = function() {
                      return [
                        '#2986e2', '#dc3912', '#f88508', '#109618',
                        '#990099', '#0099c6', '#dd4477', '#66aa00',
                        '#b82e2e', '#316395', '#994499', '#22aa99',
                Severity: Major
                Found in app/scripts/controller/util.js - About 2 hrs to fix

                  Function downloadCaseData has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      downloadCaseData: function() {
                        var _def = new $.Deferred();
                        var sampleUIds_ = vm_.selectedsampleUIDs;
                        var attr = {};
                        var self = this;
                  Severity: Major
                  Found in app/scripts/main.js - About 2 hrs to fix

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

                                $('#' + chartId + '-pdf', api.elements.tooltip).click(function() {
                                  iViz.util.download(self.chartCtrl.getChartType(), 'pdf', self.chartCtrl.getDownloadData('pdf'));
                                });
                    Severity: Major
                    Found in app/scripts/views/components/chartOperationsHeader.js and 1 other location - About 2 hrs to fix
                    app/scripts/views/components/chartOperationsHeader.js on lines 260..262

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

                    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

                                $('#' + chartId + '-svg', api.elements.tooltip).click(function() {
                                  iViz.util.download(self.chartCtrl.getChartType(), 'svg', self.chartCtrl.getDownloadData('svg'));
                                });
                    Severity: Major
                    Found in app/scripts/views/components/chartOperationsHeader.js and 1 other location - About 2 hrs to fix
                    app/scripts/views/components/chartOperationsHeader.js on lines 257..259

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

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                                    if (!_.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 218..224

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language