gadael/gadael

View on GitHub

Showing 364 of 761 total issues

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

function createController() {
    ctrlFactory.create.call(this, '/rest/anonymous/createfirstadmin');
    var controller = this;

    this.controllerAction = function() {
Severity: Minor
Found in rest/anonymous/createfirstadmin.js - About 1 hr to fix

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

            $scope.addAdjustment = function addAdjustment(renewal) {
                var modalscope = $scope.$new();
    
                modalscope.renewal = renewal;
    
    
    Severity: Minor
    Found in public/js/controllers/admin/beneficiary-edit.js - About 1 hr to fix

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

          function getCollections(accountCollections, refDate) {
      
              var r = {
                  prev: null,
                  current: null,
      Severity: Minor
      Found in public/js/controllers/admin/account-renewalquantity-edit.js - About 1 hr to fix

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

        exports = module.exports = function(service, from, to, types) {
        
        
        
        
        
        Severity: Minor
        Found in api/services/admin/exports/sage.js - About 1 hr to fix

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

          api.create = function(app, parent, name, operator) {
          
              const Charlatan = require('charlatan');
              const DepartmentModel = app.db.models.Department;
          
          
          Severity: Minor
          Found in api/Department.api.js - About 1 hr to fix

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

            api.createRight = function(app, props) {
                let rightModel = app.db.models.Right;
                let right = new rightModel();
            
                if (undefined !== props) {
            Severity: Minor
            Found in api/Right.api.js - About 1 hr to fix

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

              var removeOrUpdate = function(userDocument, checkedRole, model, updateCallback, noRoleCallback) {
              
                  var promise = model.find({ 'user.id': userDocument._id }).exec();
              
                  promise.then(function(roles) {
              Severity: Minor
              Found in modules/roles.js - About 1 hr to fix

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

                exports = module.exports = function(services, app) {
                
                    const dispunits = app.utility.dispunits;
                    var service = new services.list(app);
                
                
                Severity: Minor
                Found in api/services/user/recoverquantities/list.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ($scope.user.$promise) {
                              $scope.user.$promise.then(function() {
                  
                                  $scope.user.isAccount     = ($scope.user.roles && $scope.user.roles.account     !== undefined && $scope.user.roles.account     !== null);
                                  $scope.user.isAdmin     = ($scope.user.roles && $scope.user.roles.admin     !== undefined && $scope.user.roles.admin     !== null);
                  Severity: Major
                  Found in public/js/controllers/admin/user-view.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if ($scope.user.$promise) {
                                $scope.user.$promise.then(function() {
                    
                                    $scope.user.isAccount     = ($scope.user.roles && $scope.user.roles.account     !== undefined && $scope.user.roles.account     !== null);
                                    $scope.user.isAdmin     = ($scope.user.roles && $scope.user.roles.admin     !== undefined && $scope.user.roles.admin     !== null);
                    Severity: Major
                    Found in public/js/controllers/admin/user-edit.js - About 1 hr to fix

                      Function createOnRenewal has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function createOnRenewal(app, rightDocument, renewal, user, dtstart, dtend, nbdays, timeCreated) {
                      Severity: Major
                      Found in api/Request.api.js - About 1 hr to fix

                        Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports = module.exports = function(services, app) {
                        
                            var service = new services.list(app);
                        
                            /**
                        Severity: Minor
                        Found in api/services/admin/users/list.js - About 55 mins 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 exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports = module.exports = function(services, app) {
                        
                            var service = new services.delete(app);
                        
                            const gt = app.utility.gettext;
                        Severity: Minor
                        Found in api/services/admin/beneficiaries/delete.js - About 55 mins 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 exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports = module.exports = function(services, app) {
                        
                            var service = new services.list(app);
                        
                        
                        
                        Severity: Minor
                        Found in api/services/user/adjustments/list.js - About 55 mins 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 exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports = module.exports = function(services, app)
                        {
                        
                            var service = new services.list(app);
                        
                        
                        Severity: Minor
                        Found in api/services/account/accountrights/list.js - About 55 mins 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 exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports = module.exports = function(services, app) {
                        
                            var service = new services.get(app);
                        
                            const gt = app.utility.gettext;
                        Severity: Minor
                        Found in api/services/user/accountbeneficiaries/get.js - About 55 mins 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 getHighestPort has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            getHighestPort: function getHighestPort(app, callback) {
                                this.getCompanies(app).then(companies => {
                        
                                    var max = 0;
                                    for (let dbName in companies) {
                        Severity: Minor
                        Found in api/Company.api.js - About 55 mins 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

                        Avoid deeply nested control flow statements.
                        Open

                                                            if ($scope.accountRights[i].to) {
                                                                $scope.accountRights[i].to = new Date($scope.accountRights[i].to);
                                                            }
                        Severity: Major
                        Found in public/js/controllers/admin/account-rights-edit.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                              if ($scope.accountScheduleCalendars[i].to) {
                                                                  $scope.accountScheduleCalendars[i].to = new Date($scope.accountScheduleCalendars[i].to);
                                                              }
                          Severity: Major
                          Found in public/js/controllers/admin/account-schedulecalendars-edit.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                if ($scope.accountRights[i].from) {
                                                                    $scope.accountRights[i].from = new Date($scope.accountRights[i].from);
                                                                }
                            Severity: Major
                            Found in public/js/controllers/admin/account-rights-edit.js - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language