greenelab/adage-server

View on GitHub

Showing 82 of 230 total issues

Function controller has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function(Experiment, Sample, $log) {
      var ctrl = this;

      ctrl.$onInit = function() {
        ctrl.experiment = {
Severity: Major
Found in interface/src/app/experiment/experimentDetail.component.js - About 2 hrs to fix

    Function build_search_kwargs has 17 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def build_search_kwargs(self,
    Severity: Major
    Found in adage/adage/search_backend.py - About 2 hrs to fix

      Function controller has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function($log, Heatmap, HeatmapSpec, Sample) {
            var ctrl = this;
      
            // objects needed for Vega
            ctrl.heatmapSpec = HeatmapSpec;
      Severity: Major
      Found in interface/src/app/heatmap/heatmap.component.js - About 2 hrs to fix

        Function calculateEnrichments has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var calculateEnrichments = function(geneGenesets, allGenesetInfo,
                                                    totalGeneNum, cutoff) {
                  var N = totalGeneNum;
        
                  // This will be the number of genes from the high weight gene list
        Severity: Minor
        Found in interface/src/app/signature/signature.js - About 2 hrs to fix

          Function controller has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function(Sample, Experiment, $log) {
                var ctrl = this;
                ctrl.makeHref = Experiment.makeHref;
          
                ctrl.$onInit = function() {
          Severity: Minor
          Found in interface/src/app/sample/sampleDetail.component.js - About 1 hr to fix

            Function EnrichedSignatureController has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              function EnrichedSignatureController($stateParams, Signature, Participation,
                Gene, MlModelTracker, MathFuncts, pValueCutoff, pValueDigits, $scope, $q,
                $log, errGen) {
                var self = this;
                self.isValidModel = false;
            Severity: Minor
            Found in interface/src/app/gene/enriched_signatures.js - About 1 hr 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

            Function AnalysisCtrl has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function AnalysisCtrl($scope, $log, $q, $state, $stateParams,
              SampleBin, Sample) {
              $scope.isValidModel = false;
              // Do nothing if mlmodel in URL is falsey. The error will be taken
              // care of by "<ml-model-validator>" component.
            Severity: Minor
            Found in interface/src/app/analyze/analysis/analysis.js - About 1 hr to fix

              Function calculateEnrichments has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var calculateEnrichments = function(typeName, genesBySignatures) {
                    var m = genesInUrl.length,
                      N = self.geneNum,
                      pValueArray = [],
                      matchedGenesBySignature = [],
              Severity: Minor
              Found in interface/src/app/gene/enriched_signatures.js - About 1 hr to fix

                Function controller has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      function($scope, $state, Gene, SelectedGenesFactory, CommonGeneFuncts) {
                        var numResultsToReturn = 10;
                        $scope.errors = null;
                        $scope.autocompleteQuery = '';
                        $scope.selectedGenes = SelectedGenesFactory.returnGenes();
                Severity: Minor
                Found in interface/src/app/gene/searchFew/searchFew.js - About 1 hr to fix

                  Function link has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        link: function($scope) {
                          $scope.queryStatus = 'Connecting to the server ...';
                  
                          $scope.topMode = true;
                          $scope.topNum = 3;
                  Severity: Minor
                  Found in interface/src/app/signature/signature.js - About 1 hr to fix

                    Function controller has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function($log, Genesets, Gene, errGen) {
                          var self = this;
                    
                          self.search = {};
                    
                    
                    Severity: Minor
                    Found in interface/src/app/tribe_client/genesets.js - About 1 hr to fix

                      Function SearchCtrl has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function SearchCtrl($scope, $log, $location, Search) {
                          $scope.results = [];
                          $scope.search = {
                            query: {
                              text: '',
                      Severity: Minor
                      Found in interface/src/app/analyze/search/search.js - About 1 hr to fix

                        Function get_annotations has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def get_annotations(request=None, **kwargs):
                                """
                                Return a tab-delimited file containing all samples for every Experiment
                                with Sample properties for each and all annotations (by default) or, if
                                `annotation_types` is specified, return only those annotation types for
                        Severity: Minor
                        Found in adage/analyze/api.py - About 1 hr 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

                        Function controller has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              function($scope, SelectedGenesFactory) {
                                $scope.currentPage = 1;
                                $scope.itemsPerPage = 10;
                                $scope.totalResults = 0;
                                $scope.maxSize = 10;
                        Severity: Minor
                        Found in interface/src/app/gene/searchMany/searchMany.js - About 1 hr to fix

                          Function mapSignaturesToSignatureInfo has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                var mapSignaturesToSignatureInfo = function() {
                                  // (2a) next, we build an array (replacing `volcanoData.source`)
                                  //      comprised of `signatureObject`s by walking through the
                                  //      `firstSampleSignatures` and constructing a `signatureObject` for
                                  //      each. [outer .map()]
                          Severity: Minor
                          Found in interface/src/app/analyze/analysis/sampleBin.js - About 1 hr to fix

                            Function handleExperimentResponse has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    var handleExperimentResponse = function(response) {
                                      // enhanceExpData: a function that enhances the given experiment.
                                      // The enhancements include:
                                      // (1) Convert entries in sample_set from sample URI to sample ID,
                                      //     and delete samples that are not related to current signature;
                            Severity: Minor
                            Found in interface/src/app/signature/signature.js - About 1 hr to fix

                              Function searchGenesets has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    self.searchGenesets = function() {
                                      self.searchStatus = 'Searching for gene sets...';
                                      var qparams = {
                                        'query': self.search.query,
                                        'organism__scientific_name': self.organism,
                              Severity: Minor
                              Found in interface/src/app/tribe_client/genesets.js - About 1 hr to fix

                                Function VolcanoPlotViewCtrl has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function VolcanoPlotViewCtrl(SampleBin, $stateParams) {
                                    var ctrl = this;
                                    ctrl.isValidModel = false;
                                    // Do nothing if mlmodel in URL is falsey. The error will be taken
                                    // care of by "<ml-model-validator>" component.
                                Severity: Minor
                                Found in interface/src/app/volcano-plot/view.js - About 1 hr to fix

                                  Function setSpec has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    this.setSpec = function(activities) {
                                      var activityArr = [];
                                      var samples = Object.keys(activities);
                                      samples.forEach(function(sampleID, index) {
                                        activityArr.push({
                                  Severity: Minor
                                  Found in interface/src/app/signature/signature.js - About 1 hr to fix

                                    Function showEdgeTip has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            function showEdgeTip(data) {
                                              geneTip.hide(); // Hide gene-tip window (if any) first.
                                              var weightPrecision = 3;
                                              var htmlText = 'Edge weight: ';
                                              htmlText += data.weight.toFixed(weightPrecision);
                                    Severity: Minor
                                    Found in interface/src/app/gene/network/network.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language