cBioPortal/iViz

View on GitHub

Showing 156 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

                    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

                        Avoid too many return statements within this function.
                        Open

                                  return -1;
                        Severity: Major
                        Found in app/scripts/model/dataProxy.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return '>' + formattedValue;
                          Severity: Major
                          Found in app/scripts/controller/util.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return _returnValue;
                            Severity: Major
                            Found in app/scripts/controller/util.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                        return 1;
                              Severity: Major
                              Found in app/scripts/model/dataProxy.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return b.numOfDatum - a.numOfDatum;
                                Severity: Major
                                Found in app/scripts/model/dataProxy.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language