greenelab/adage-server

View on GitHub

Showing 82 of 230 total issues

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

      function($scope, SelectedGenesFactory, CommonGeneFuncts) {
        $scope.buttonPage = 1;
        $scope.queryResults = $scope.searchResults[$scope.query];

        var selectedGenes = SelectedGenesFactory.returnGenes();
Severity: Minor
Found in interface/src/app/gene/searchMany/searchMany.js - About 1 hr to fix

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

          ctrl.show = function(id) {
            if (!id) {
              $log.warn(
                'adage.experimentDetail.component: show() called with id',
                id
    Severity: Minor
    Found in interface/src/app/experiment/experimentDetail.component.js - About 1 hr to fix

      Function DownloadController has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function DownloadController($window, $log, AnnotationTypes) {
          var self = this;
          self.queryStatus = 'Connecting to the server ...';
          self.fixedTypes = ['experiment', 'sample_name', 'ml_data_source'];
          self.includedTypes = [];
      Severity: Minor
      Found in interface/src/app/download/download.js - About 1 hr to fix

        Function success has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            sidPromise.then(function success(validSamples) {
              Sample.get(
                {'id__in': validSamples, 'limit': 0}, // parameters of GET
                function success(response) {
                  // If no valid sample records are found, report the error.
        Severity: Minor
        Found in interface/src/app/sample_annotation/annotation.js - About 1 hr to fix

          Function success has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          function success(responseObject) {
                            // Function that calculates input gene's expression value
                            // based on the input array of base and comparison sums.
                            var calcGeneExpr = function(geneID, exprTracker) {
                              // Do nothing if the length of exprTracker is not 4, or one
          Severity: Minor
          Found in interface/src/app/gene/network/network.js - About 1 hr to fix

            Function getSignatureSetPromise has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                getSignatureSetPromise: function(pkArr) {
                  // Check for any pk already cached, then retrieve what's missing in
                  // bulk via the set endpoint on the signature API. Return a promise and
                  // supply a callback that populates the cache when the API returns.
                  var cbSampleBin = this; // closure link to SampleBin for callbacks
            Severity: Minor
            Found in interface/src/app/analyze/analysis/sampleBin.js - About 1 hr to fix

              Function create_participations has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  def create_participations(num_signatures, num_genes):
                      """
                      Static method that builds Participation table based on the input
                      number of signatures and number of genes.
                      """
              Severity: Minor
              Found in adage/analyze/tests.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 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function($scope, UserFactory, $uibModal, $rootScope, $window) {
                        UserFactory.getPromise().then(function() {
                          $scope.userObj = UserFactory.getUser();
                        });
              
              
              Severity: Minor
              Found in interface/src/app/tribe_client/directives.js - About 1 hr to fix

                Function updateHeatmapActivity has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var updateHeatmapActivity = function() {
                          // when all promises are fulfilled, we can update vegaData
                          var newActivity = [];
                          var excludeSamples = [];
                
                
                Severity: Minor
                Found in interface/src/app/heatmap.service.js - About 1 hr to fix

                  Function SignatureController has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function SignatureController($stateParams, Signature, $log, errGen) {
                      var self = this;
                      self.isValidModel = false;
                      // Do nothing if the model ID in URL is falsey. The error will be taken
                      // care of by "<ml-model-validator>" component.
                  Severity: Minor
                  Found in interface/src/app/signature/signature_search.js - About 1 hr to fix

                    Function setUp has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def setUp(self):
                            super(APIResourceTestCase, self).setUp()
                            # create a test experiment to retrive with the API
                            self.test_experiment = ModelsTestCase.experiment_data
                            ModelsTestCase.create_test_experiment(
                    Severity: Minor
                    Found in adage/analyze/tests.py - About 1 hr to fix

                      Function getSampleListPromise has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          Sample.getSampleListPromise = function(pkList) {
                            return $q(function(resolve, reject) {
                              var cachedSamples = [];
                              var promisedSampleIDs = [];
                              var newSamplePromises = [];
                      Severity: Minor
                      Found in interface/src/app/sample.service.js - About 1 hr to fix

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

                            controller: ['$scope', 'Gene', function($scope, Gene) {
                              $scope.errors = null;
                        
                              $scope.searchGenes = function() {
                                // Gene.search will query for all of the search terms in qparams,
                        Severity: Minor
                        Found in interface/src/app/gene/searchMany/searchMany.js - About 1 hr to fix

                          Function show has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                ctrl.show = function(id) {
                                  if (!id) {
                                    $log.warn('adage.sampleDetail.component: show() called with id', id);
                                    return;
                                  }
                          Severity: Minor
                          Found in interface/src/app/sample/sampleDetail.component.js - About 1 hr to fix

                            Function searchGenes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    $scope.searchGenes = function(val) {
                                      $scope.loadingGenes = true;
                                      var qparams = {
                                        'query': val,
                                        'organism': $scope.organism
                            Severity: Minor
                            Found in interface/src/app/gene/searchFew/searchFew.js - About 1 hr to fix

                              Function openLoginModal has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                        $scope.openLoginModal = function() {
                                          var modalInstance = $uibModal.open({
                                            templateUrl: 'tribe_client/tribe-login-modal.tpl.html',
                                            controller: [
                                              '$scope', '$uibModalInstance', 'TribeSettings',
                              Severity: Minor
                              Found in interface/src/app/tribe_client/directives.js - About 1 hr to fix

                                Function getEnrichedSignatures has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    var getEnrichedSignatures = function() {
                                      participations.forEach(function(element) {
                                        var sigID = element.signature;
                                        if (!self.signatures[sigID]) {
                                          return;
                                Severity: Minor
                                Found in interface/src/app/gene/enriched_signatures.js - About 1 hr to fix

                                  Function getSampleIDPromise has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      var getSampleIDPromise = function() {
                                        var deferred = $q.defer();
                                        // If 'signature' is found in the URL, get the activity values based on
                                        // signature and sample(s):
                                        if ($stateParams.signature) {
                                  Severity: Minor
                                  Found in interface/src/app/sample_annotation/annotation.js - About 1 hr to fix

                                    Function get has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          get: function() {
                                            $scope.results = [];
                                            $scope.search.query.status = '';
                                            if (!$scope.search.query.text) {
                                              $log.info('Query text is empty, so skipping search.');
                                    Severity: Minor
                                    Found in interface/src/app/analyze/search/search.js - About 1 hr to fix

                                      Function SignatureController has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function SignatureController(Signature, $stateParams, MlModelTracker, $log,
                                                                     errGen) {
                                          var self = this;
                                          if (!$stateParams.id) {
                                            self.statusMessage = 'Please specify signature ID in the URL.';
                                      Severity: Minor
                                      Found in interface/src/app/signature/signature.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language