cBioPortal/iViz

View on GitHub

Showing 1,095 of 1,095 total issues

Avoid deeply nested control flow statements.
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 - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  if (!hasNA && !hasSmallerOutlier && !hasGreaterOutlier &&
                    minNumBarPoint !== '' && maxNumBarPoint !== '') {
                    tempFilters_[0] = minNumBarPoint + '<';
                    tempFilters_[1] = '<=' + maxNumBarPoint;
                  } else if (hasNA && !hasSmallerOutlier) {
    Severity: Major
    Found in app/scripts/views/components/barChart/barChart.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                    if (hasNA) {
                      tempFilters_[0] += 'NA';
                    } else {
                      tempFilters_[0] = tempFilters_[0].slice(0, -2);// remove last coma
                    }
      Severity: Major
      Found in app/scripts/views/components/barChart/barChart.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      if (!hasNA && _filter[0] < opts_.xDomain[startNumIndex] &&
                        _filter[1] > opts_.xDomain[endNumIndex]) {
                        tempFilters_[0] = 'All Numbers';
                      } else if (!hasNA && minNumBarPoint !== '' && maxNumBarPoint !== '') {
                        tempFilters_[0] = minNumBarPoint + '<';
        Severity: Major
        Found in app/scripts/views/components/barChart/barChart.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    } else if (exponentRange === 1) {
                      config.minDomain = Math.pow(10, minExponent - 1);
                      config.xDomain.push(Math.pow(10, minExponent) / 3); // add "<=" marker
                      for (i = minExponent; i <= maxExponent + 1; i++) {
                        config.xDomain.push(Math.pow(10, i));
          Severity: Major
          Found in app/scripts/views/components/barChart/barChart.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                              if (selectedMap_[geneIndex] === undefined) {
                                selectedMap_[geneIndex] = {};
                                if (includeMutationCount) {
                                  selectedMap_[geneIndex].num_muts = 1;
                                }
            Severity: Major
            Found in app/scripts/views/components/dataTable/tableView.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                    } else if (data_.min > 1500 &&
                      opts_.xDomain.length > 7) {
                      // this is the special case for printing out year
                      index = opts_.xDomain.indexOf(v);
                      if (index % 2 === 0) {
              Severity: Major
              Found in app/scripts/controller/util.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                if (item === -1 && _matrix[0] === -1 && _matrix[1] === -1 && _matrix[2] === -1 && _matrix[3] === -1) {
                                  // Found a place for chart
                                  _matrix = [chart.attr_id, chart.attr_id, chart.attr_id, chart.attr_id];
                                  layoutItem.notFull = false;
                                  foundSpace = true;
                Severity: Major
                Found in app/scripts/views/mainTemplate.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if (data_.hasNA) {// has 'NA' tick
                                  endNumIndex = opts_.xDomain.length >= 3 ? opts_.xDomain.length - 3 : endNumIndex;
                                } else {
                                  endNumIndex = opts_.xDomain.length - 2;
                                }
                  Severity: Major
                  Found in app/scripts/views/components/barChart/barChart.js - About 45 mins to fix

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

                                    if (d[data_.attrId] <= opts_.xDomain[i] &&
                                      d[data_.attrId] >= opts_.xDomain[i - 1]) {
                                      _min = opts_.xDomain[i - 1];
                                      _max = opts_.xDomain[i];
                                      val = _min + (_max - _min) / 4;
                    Severity: Minor
                    Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 45 mins to fix
                    app/scripts/views/components/barChart/barChart.js on lines 39..45

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

                    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 (d[data_.attrId] < opts_.xDomain[i] &&
                                  d[data_.attrId] >= opts_.xDomain[i - 1]) {
                                  val = parseInt(Math.pow(10, i / 2 - 0.25), 10);
                                  _min = opts_.xDomain[i - 1];
                                  _max = opts_.xDomain[i];
                    Severity: Minor
                    Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 45 mins to fix
                    app/scripts/views/components/barChart/barChart.js on lines 62..68

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

                    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 (_self.apiStatus.allPhysicalStudies === 'fetched') {
                              _def.resolve(_.filter(_self.data.studies, function(t) {
                                return t.studyType === 'regular';
                              }));
                            } else {
                    Severity: Minor
                    Found in app/scripts/model/dataProxy.js and 1 other location - About 40 mins to fix
                    app/scripts/model/dataProxy.js on lines 1628..1647

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

                    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

                          content.setDownloadData('svg', {
                            title: opts_.displayName,
                            chartDivId: opts_.chartDivId,
                            chartId: opts_.chartId,
                            fileName: opts_.displayName
                    Severity: Minor
                    Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 40 mins to fix
                    app/scripts/views/components/barChart/barChart.js on lines 225..230

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

                    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

                          content.setDownloadData('pdf', {
                            title: opts_.displayName,
                            chartDivId: opts_.chartDivId,
                            chartId: opts_.chartId,
                            fileName: opts_.displayName
                    Severity: Minor
                    Found in app/scripts/views/components/barChart/barChart.js and 1 other location - About 40 mins to fix
                    app/scripts/views/components/barChart/barChart.js on lines 219..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 49.

                    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 (_self.apiStatus.allVirtualStudies === 'fetched') {
                              _def.resolve(_.filter(_self.data.studies, function(t) {
                                return t.studyType === 'vs';
                              }));
                            } else {
                    Severity: Minor
                    Found in app/scripts/model/dataProxy.js and 1 other location - About 40 mins to fix
                    app/scripts/model/dataProxy.js on lines 1673..1692

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

                    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

                    Consider simplifying this complex logical expression.
                    Open

                            } else if ((!data_.noGrouping && _filter[0] < opts_.xDomain[0] && _filter[1] > opts_.xDomain[opts_.xDomain.length - 1]) ||
                              (data_.noGrouping && _filter[0] < opts_.xFakeDomain[0] && _filter[1] > opts_.xFakeDomain[opts_.xFakeDomain.length - 1])) {
                              tempFilters_[0] = 'All';
                            } else {
                              if (data_.noGrouping) {
                    Severity: Major
                    Found in app/scripts/views/components/barChart/barChart.js - About 40 mins to fix

                      Function iViz has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      window.iViz = (function(_, $, cbio, QueryByGeneUtil, QueryByGeneTextArea) {
                      Severity: Minor
                      Found in app/scripts/main.js - About 35 mins to fix

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

                              showLoad: function(newVal) {
                                if (newVal) {
                                  this.initialInfinityLoadingBar();
                                } else {
                                  this.loadingBar.disable = true;
                        Severity: Minor
                        Found in app/scripts/views/components/scatterPlot/scatterPlotTemplate.js and 1 other location - About 35 mins to fix
                        app/scripts/views/components/survivalChart/template.js on lines 66..72

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

                        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

                              showLoad: function(newVal) {
                                if (newVal) {
                                  this.initialInfinityLoadingBar();
                                } else {
                                  this.loadingBar.disable = true;
                        Severity: Minor
                        Found in app/scripts/views/components/survivalChart/template.js and 1 other location - About 35 mins to fix
                        app/scripts/views/components/scatterPlot/scatterPlotTemplate.js on lines 64..70

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

                        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

                                      addAttr({
                                        attr_id: 'has_cna_data',
                                        display_name: 'With CNA Data',
                                        priority: ismskimpact ? 0 : iViz.priorityManager.getDefaultPriority('has_cna_data'),
                                        description: 'If the sample has CNA data'
                        Severity: Minor
                        Found in app/scripts/model/dataProxy.js and 1 other location - About 35 mins to fix
                        app/scripts/model/dataProxy.js on lines 191..196

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

                        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