cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

Function mutatedGenesData has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function mutatedGenesData(_selectedGenesMap, _selectedSampleUids) {
      genePanelMap = window.iviz.datamanager.updateGenePanelMap(genePanelMap, _selectedSampleUids);

      selectedGeneData.length = 0;
      var numOfCases_ = content.getCases().length;
Severity: Major
Found in app/scripts/views/components/dataTable/tableView.js - About 2 hrs to fix

    Function Survival has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      iViz.view.component.Survival = function() {
        var content_ = this;
        var opts_ = {
          downloadIsEnabled: true
        };
    Severity: Major
    Found in app/scripts/views/components/survivalChart/main.js - About 2 hrs to fix

      Function init has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          content.init = function(_data, opts) {
            opts_ = $.extend(true, {}, opts);
            chartId_ = opts_.chartId;
            data_ = _.filter(_data, function(datum) {
              return !isNaN(datum.FRACTION_GENOME_ALTERED) && !isNaN(datum.MUTATION_COUNT);
      Severity: Major
      Found in app/scripts/views/components/scatterPlot/scatterPlot.js - About 2 hrs to fix

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

              groups.push({
                type: 'patient',
                id: vm_.groupCount.toString(),
                selectedcases: [],
                hasfilters: false,
        Severity: Major
        Found in app/scripts/main.js and 1 other location - About 2 hrs to fix
        app/scripts/main.js on lines 152..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 89.

        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

              groups.push({
                type: 'sample',
                id: vm_.groupCount.toString(),
                selectedcases: [],
                hasfilters: false,
        Severity: Major
        Found in app/scripts/main.js and 1 other location - About 2 hrs to fix
        app/scripts/main.js on lines 140..149

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 89.

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

            extractCnaData: function(_cnaData, _allSamples) {
              var _cnaMeta = {};
              var _allCNAGenes = {};
              var _cnaMetaIndex = 0;
              var self = this;
        Severity: Major
        Found in app/scripts/main.js - About 2 hrs to fix

          Function updateDataObject has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              updateDataObject: function(type, attrIds) {
                var def = new $.Deferred();
                var self_ = this;
                var isPatientAttributes = (type === 'patient');
                var _data = isPatientAttributes ? data_.groups.patient.data : data_.groups.sample.data;
          Severity: Major
          Found in app/scripts/main.js - About 2 hrs to fix

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

                function initCanvasDownloadData() {
                  content.setDownloadData('svg', {
                    title: opts_.title,
                    chartDivId: opts_.chartId,
                    fileName: opts_.title
            Severity: Major
            Found in app/scripts/views/components/scatterPlot/scatterPlot.js and 1 other location - About 2 hrs to fix
            app/scripts/views/components/survivalChart/main.js on lines 78..89

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

            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 initCanvasDownloadData() {
                  content_.setDownloadData('svg', {
                    title: opts_.title,
                    chartDivId: opts_.chartId,
                    fileName: opts_.title
            Severity: Major
            Found in app/scripts/views/components/survivalChart/main.js and 1 other location - About 2 hrs to fix
            app/scripts/views/components/scatterPlot/scatterPlot.js on lines 210..221

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

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

                function barChartCanvasDownload(data, downloadOpts) {
                  var _svgElement = '';
                  var _svg = $('#' + data.chartId + '>svg').clone();
                  var _svgWidth = Number(_svg.attr('width'));
                  var _svgHeight = Number(_svg.attr('height')) + 20;
            Severity: Major
            Found in app/scripts/controller/util.js - About 2 hrs to fix

              Function update has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  content.update = function(_selectedSampleUIDs, _selectedRows) {
                    var selectedMap_ = {};
                    var includeMutationCount = false;
                    if (_selectedRows !== undefined) {
                      selectedRows = _selectedRows;
              Severity: Major
              Found in app/scripts/views/components/dataTable/tableView.js - About 2 hrs to fix

                Function stat has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    stat: function() {
                      var _result = {};
                      _result.origin = window.cohortIdsList;
                      _result.filters = {};
                      var self = this;
                Severity: Major
                Found in app/scripts/main.js - About 2 hrs to fix

                  File barChartTemplate.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    Function getPatientClinicalData has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var getPatientClinicalData = 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

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

                                      if (_metaObj.datatype === 'NUMBER') {
                                        _metaObj.view_type = 'bar_chart';
                                        _metaObj.layout = [-1, 2, 'h'];
                                      } else if (_metaObj.datatype === 'STRING') {
                                        _metaObj.view_type = 'pie_chart';
                      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 228..234

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

                      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 (_metaObj.datatype === 'NUMBER') {
                                        _metaObj.view_type = 'bar_chart';
                                        _metaObj.layout = [-1, 2, 'h'];
                                      } else if (_metaObj.datatype === 'STRING') {
                                        _metaObj.view_type = 'pie_chart';
                      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 282..288

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

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

                            getLayoutMatrix: function(layoutMatrix, chart) {
                              var self_ = this;
                              var neighborIndex;
                              var foundSpace = false;
                              var layout = chart.layout;
                      Severity: Major
                      Found in app/scripts/views/mainTemplate.js - About 2 hrs to fix

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

                                    if (typeof genePanelMap[item.gene] !== 'undefined') {
                                      freq = iViz.util.calcFreq(datum.cases, genePanelMap[item.gene].sampleNum);
                                    } else {
                                      freq = iViz.util.calcFreq(datum.cases, numOfCases_);
                                    }
                        Severity: Major
                        Found in app/scripts/views/components/dataTable/tableView.js and 1 other location - About 2 hrs to fix
                        app/scripts/views/components/dataTable/tableView.js on lines 304..308

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

                        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 (typeof genePanelMap[item.gene] !== 'undefined') {
                                      freq = iViz.util.calcFreq(datum.cases, genePanelMap[item.gene].sampleNum);
                                    } else {
                                      freq = iViz.util.calcFreq(datum.cases, numOfCases_);
                                    }
                        Severity: Major
                        Found in app/scripts/views/components/dataTable/tableView.js and 1 other location - About 2 hrs to fix
                        app/scripts/views/components/dataTable/tableView.js on lines 328..332

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

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

                                    addChart: function(attrId) {
                                      var self_ = this;
                                      var attrData = self_.charts[attrId];
                                      var _attrAdded = false;
                                      var _group = {};
                        Severity: Major
                        Found in app/scripts/vueCore.js - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language