cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

File virtualStudy.js has 408 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';
(function(Vue, $, vcSession, iViz, _) {
  Vue.component('virtualStudy', {
    template:
    '<div class="virtual-study">' +
Severity: Minor
Found in app/scripts/views/components/virtualStudy/virtualStudy.js - About 5 hrs to fix

    File Gruntfile.js has 404 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Generated on 2016-01-02 using
    // generator-webapp 1.1.0
    'use strict';
    
    // # Globbing
    Severity: Minor
    Found in Gruntfile.js - About 5 hrs to fix

      Function getAttributes has 140 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          content.getAttributes = function(type) {
            var _attr = [];
            switch (type) {
              case 'mutatedGene':
                _attr = [
      Severity: Major
      Found in app/scripts/views/components/dataTable/tableView.js - About 5 hrs to fix

        Function initDc_ has 140 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var initDc_ = function(logScale) {
              var tickVal = [];
              var i = 0;
              var barSet = {};
        
        
        Severity: Major
        Found in app/scripts/views/components/barChart/barChart.js - About 5 hrs to fix

          Function getStudyToSampleToPatientMap has 139 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function(self, fetch_promise) {
                    var study_to_sample_to_patient = {};
                    var _sample_uid = 0;
                    var _patient_uid = 0
                    var getSamplesCall = function() {
          Severity: Major
          Found in app/scripts/model/dataProxy.js - About 5 hrs to fix

            File mainTemplate.js has 392 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * Created by Karthik Kalletla on 4/13/16.
             */
            'use strict';
            (function(Vue, dc, iViz, Packery, Draggabilly, _) {
            Severity: Minor
            Found in app/scripts/views/mainTemplate.js - About 5 hrs to fix

              Function render has 129 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          render: function(event, api) {
                            var tooltip = $('.iviz-virtual-study-btn-qtip .qtip-content');
                            tooltip.find('.save-cohort').click(function() {
                              self_.hideDialog(tooltip);
                              self_.showLoading(tooltip);
              Severity: Major
              Found in app/scripts/views/components/virtualStudy/virtualStudy.js - About 5 hrs to fix

                Function LogRankTest has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                window.LogRankTest = (function(jStat) {
                  var datum = {
                    time: '',  // num of months
                    num_of_failure_1: 0,
                    num_of_failure_2: 0,
                Severity: Minor
                Found in app/scripts/views/components/survivalChart/components/logRankTest.js - About 5 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                File template.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * @author Yichao Sun on 5/18/16.
                 */
                'use strict';
                (function(Vue, dc, iViz, _) {
                Severity: Minor
                Found in app/scripts/views/components/survivalChart/template.js - About 4 hrs to fix

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

                        if (inputGrp1[_ptr_1].time < inputGrp2[_ptr_2].time) {
                          _datum = jQuery.extend(true, {}, datum);
                          _datum.time = inputGrp1[_ptr_1].time;
                          if (inputGrp1[_ptr_1].status === 1) {
                            _datum.num_of_failure_1 = 1;
                  app/scripts/views/components/survivalChart/components/logRankTest.js on lines 35..66

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

                  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 (inputGrp1[_ptr_1].time > inputGrp2[_ptr_2].time) {
                          _datum = jQuery.extend(true, {}, datum);
                          _datum.time = inputGrp2[_ptr_2].time;
                          if (inputGrp2[_ptr_2].status === 1) {
                            _datum.num_of_failure_2 = 1;
                  app/scripts/views/components/survivalChart/components/logRankTest.js on lines 23..66

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

                  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 (_.isArray(self.data.sampleLists[studyId][studyId + '_all'])) {
                                    _responseStudyCaseList[studyId].allSampleIds = iViz.util.intersection(self.data.sampleLists[studyId][studyId + '_all'], self.studyCasesMap[studyId].samples);
                                    self.data.sampleLists.all[studyId] = _responseStudyCaseList[studyId].allSampleIds;
                                  }
                  Severity: Major
                  Found in app/scripts/model/dataProxy.js and 1 other location - About 4 hrs to fix
                  app/scripts/model/dataProxy.js on lines 930..933

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

                  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 (_.isArray(self.data.sampleLists[studyId][studyId + '_cna'])) {
                                    _responseStudyCaseList[studyId].cnaSampleIds = iViz.util.intersection(self.data.sampleLists[studyId][studyId + '_cna'], self.studyCasesMap[studyId].samples);
                                    self.data.sampleLists.cna[studyId] = _responseStudyCaseList[studyId].cnaSampleIds;
                                  }
                  Severity: Major
                  Found in app/scripts/model/dataProxy.js and 1 other location - About 4 hrs to fix
                  app/scripts/model/dataProxy.js on lines 934..937

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

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

                  window.LogRankTest = (function(jStat) {
                    var datum = {
                      time: '',  // num of months
                      num_of_failure_1: 0,
                      num_of_failure_2: 0,
                  Severity: Major
                  Found in app/scripts/views/components/survivalChart/components/logRankTest.js - About 4 hrs to fix

                    Function updatePlotGroups has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          updatePlotGroups: function(hasFilters) {
                            var _type = this.attributes.group_type;
                            var attrId = _type === 'patient' ? 'patient_uid' : 'sample_uid';
                            var groupId = this.attributes.group_id;
                            var _selectedCases = [];
                    Severity: Major
                    Found in app/scripts/views/components/survivalChart/template.js - About 4 hrs to fix

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

                          ready: function() {
                            $('#' + this.chartId + '-download').qtip('destroy', true);
                            $('#' + this.chartId + '-download-icon-wrapper').qtip('destroy', true);
                            $('#' + this.chartId + '-title').qtip('destroy', true);
                            var chartId = this.chartId;
                      Severity: Major
                      Found in app/scripts/views/components/chartOperationsHeader.js - About 4 hrs to fix

                        File tableViewTemplate.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /**
                         * Created by Karthik Kalletla on 6/20/16.
                         */
                        'use strict';
                        (function(Vue, dc, iViz, $, QueryByGeneTextArea, _) {
                        Severity: Minor
                        Found in app/scripts/views/components/dataTable/tableViewTemplate.js - About 4 hrs to fix

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

                                data.push({
                                  x: _.pluck(_unselectedData, 'FRACTION_GENOME_ALTERED'),
                                  y: _.pluck(_unselectedData, 'MUTATION_COUNT'),
                                  text: _unselectedDataQtips,
                                  mode: 'markers',
                          Severity: Major
                          Found in app/scripts/views/components/scatterPlot/scatterPlot.js and 1 other location - About 4 hrs to fix
                          app/scripts/views/components/scatterPlot/scatterPlot.js on lines 161..175

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

                          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

                                data.push({
                                  x: _.pluck(_selectedData, 'FRACTION_GENOME_ALTERED'),
                                  y: _.pluck(_selectedData, 'MUTATION_COUNT'),
                                  text: _selectedDataQtips,
                                  mode: 'markers',
                          Severity: Major
                          Found in app/scripts/views/components/scatterPlot/scatterPlot.js and 1 other location - About 4 hrs to fix
                          app/scripts/views/components/scatterPlot/scatterPlot.js on lines 146..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 115.

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

                              init: function(_rawDataJSON, configs,_selectableIds) {
                                vm_ = iViz.vue.manage.getInstance();
                                var selectableIdsSet = {}
                                _.each(_selectableIds, function(id){
                                  selectableIdsSet[id] = true;
                          Severity: Major
                          Found in app/scripts/main.js - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language