cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

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

          $.get(window.cbioURL + 'api-legacy/proxy/session/virtual_study')
            .done(function(virtualStudies) {
              _.each(virtualStudies, function(study) {
                study.studyType = 'vs';
                _self.data.studies[study.id] = 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 1678..1688

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

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

                if (configs_.tableAttrs.indexOf(_metaObj.attr_id) !== -1) {
                  _metaObj.view_type = 'table';
                  _metaObj.layout = [-1, 4];
                  _metaObj.type = 'pieLabel';
                  _metaObj.options = {
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 289..297

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

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 (configs_.tableAttrs.indexOf(_metaObj.attr_id) !== -1) {
                  _metaObj.view_type = 'table';
                  _metaObj.layout = [-1, 4];
                  _metaObj.type = 'pieLabel';
                  _metaObj.options = {
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 235..243

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

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

          var getSamplesCall = function() {
            var def = new $.Deferred();
            var data = [];
            _.each(self.getCancerStudyIds(), function(studyId) {
              data = data.concat(_.map(self.studyCasesMap[studyId].samples, function(sample) {
Severity: Major
Found in app/scripts/model/dataProxy.js - About 3 hrs to fix

    Function processBarchartData has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          processBarchartData: function(_data) {
            var _self = this;
            var _dataIssue = false;
            var smallerOutlier = {};
            var greaterOutlier = {};
    Severity: Major
    Found in app/scripts/views/components/barChart/barChartTemplate.js - About 3 hrs to fix

      Function getGenePanelMap has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            getGenePanelMap: function(hugoSymbols, map) {
              var _def = new $.Deferred();
              var panelSamplesMap = {};
              var geneSampleMap = {};
              var isProfiledPanelId = 'profiled';
      Severity: Major
      Found in app/scripts/model/dataProxy.js - About 3 hrs to fix

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

                } else if (attrId === 'cna_details') {
                  $.when(window.iviz.datamanager.getCnaData(progressFunc))
                    .then(function(_data) {
                      def.resolve(self.extractCnaData(_data, window.iviz.datamanager.getAllCNASamples()));
                    }, function() {
        Severity: Major
        Found in app/scripts/main.js and 1 other location - About 3 hrs to fix
        app/scripts/main.js on lines 526..540

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

        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 (attrId === 'mutated_genes') {
                  $.when(window.iviz.datamanager.getMutData(progressFunc))
                    .then(function(_data) {
                      def.resolve(self.extractMutationData(_data, window.iviz.datamanager.getAllMutatedGeneSamples()));
                    }, function() {
        Severity: Major
        Found in app/scripts/main.js and 1 other location - About 3 hrs to fix
        app/scripts/main.js on lines 533..540

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

        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 3 locations. Consider refactoring.
        Open

                    $('#iviz-header-left-case-download').qtip({
                      content: {text: 'Download clinical data for the selected cases.'},
                      style: {classes: 'qtip-light qtip-rounded qtip-shadow'},
                      show: {event: 'mouseover'},
                      hide: {fixed: true, delay: 100, event: 'mouseout'},
        Severity: Major
        Found in app/scripts/vueCore.js and 2 other locations - About 3 hrs to fix
        app/scripts/vueCore.js on lines 347..357
        app/scripts/vueCore.js on lines 369..379

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

        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[_caseIdIndex].cna_details === undefined) {
                        data_.groups.sample.data[_caseIdIndex].cna_details = [_cnaMetaIndex];
                      } else {
                        data_.groups.sample.data[_caseIdIndex].cna_details.push(_cnaMetaIndex);
                      }
        Severity: Major
        Found in app/scripts/main.js and 1 other location - About 3 hrs to fix
        app/scripts/main.js on lines 413..417

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

        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 3 locations. Consider refactoring.
        Open

                    $('#iviz-header-left-patient-select').qtip({
                      content: {text: 'View the selected patients.'},
                      style: {classes: 'qtip-light qtip-rounded qtip-shadow'},
                      show: {event: 'mouseover'},
                      hide: {fixed: true, delay: 100, event: 'mouseout'},
        Severity: Major
        Found in app/scripts/vueCore.js and 2 other locations - About 3 hrs to fix
        app/scripts/vueCore.js on lines 358..368
        app/scripts/vueCore.js on lines 369..379

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

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

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

        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 3 locations. Consider refactoring.
        Open

                    $('#iviz-form').qtip({
                      content: {text: 'Query the selected samples.'},
                      style: {classes: 'qtip-light qtip-rounded qtip-shadow'},
                      show: {event: 'mouseover'},
                      hide: {fixed: true, delay: 100, event: 'mouseout'},
        Severity: Major
        Found in app/scripts/vueCore.js and 2 other locations - About 3 hrs to fix
        app/scripts/vueCore.js on lines 347..357
        app/scripts/vueCore.js on lines 358..368

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

        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

                case 'OS_SURVIVAL':
                  var _osStatus = getPriority('OS_STATUS');
                  var _osMonths = getPriority('OS_MONTHS');
                  if (_osStatus === 0 || _osMonths === 0) {
                    priority = 0;
        Severity: Major
        Found in app/scripts/controller/priorityManager.js and 1 other location - About 2 hrs to fix
        app/scripts/controller/priorityManager.js on lines 27..37

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

        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 (selectedNumBar[0] >= opts_.xDomain[i + 1] && selectedNumBar[0] < opts_.xDomain[i + 2]) {
                        // left point is closer to the upward tick
                        minNumBarPoint = opts_.xDomain[i + 1];
                      } else {
                        if ((_filter[0] - opts_.xDomain[i]) > (opts_.xDomain[i + 1] - _filter[0])) {
        Severity: Major
        Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 2 hrs to fix
        app/scripts/views/components/barChart/barChart.js on lines 367..379

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

        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 (selectedNumBar[selectedNumBar.length - 1] >= opts_.xDomain[i - 1] &&
                        selectedNumBar[selectedNumBar.length - 1] < opts_.xDomain[i]) {
                        // right point is closer to the downward tick
                        maxNumBarPoint = opts_.xDomain[i];
                      } else {
        Severity: Major
        Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 2 hrs to fix
        app/scripts/views/components/barChart/barChart.js on lines 352..363

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

        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

                case 'DFS_SURVIVAL':
                  var _dfsStatus = getPriority('DFS_STATUS');
                  var _dfsMonths = getPriority('DFS_MONTHS');
                  if (_dfsStatus === 0 || _dfsMonths === 0) {
                    priority = 0;
        Severity: Major
        Found in app/scripts/controller/priorityManager.js and 1 other location - About 2 hrs to fix
        app/scripts/controller/priorityManager.js on lines 38..48

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

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

            content.update = function(_sampleIds) {
              var _selectedData = [];
              var _unselectedData = [];
        
              var _tmpSelectedSampleIdMap = {};
        Severity: Major
        Found in app/scripts/views/components/scatterPlot/scatterPlot.js - About 2 hrs to fix

          File chartOperationsHeader.js has 286 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

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

              iViz.priorityManager = (function() {
                var content = {};
                var clinicalAttrsPriority = {};
                var defaultPriority = 1;
            
            
            Severity: Major
            Found in app/scripts/controller/priorityManager.js - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language