gadael/gadael

View on GitHub

Showing 364 of 761 total issues

File saveAbsence.js has 372 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const util = require('util');


Severity: Minor
Found in api/services/user/requests/saveAbsence.js - About 4 hrs to fix

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

    exports = module.exports = function(services, app)
    {
    
        var service = new services.list(app);
    
    
    Severity: Major
    Found in api/services/account/accountrights/list.js - About 4 hrs to fix

      Function exports has a Cognitive Complexity of 33 (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/calendarevents/list.js - About 4 hrs 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 121 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports = module.exports = function(params) {
          var collectionSchema = new params.mongoose.Schema({
              name: { type: String, required: true, unique: true  },
              timeCreated: { type: Date, default: Date.now },
              attendance: { type: Number, min: 0, max: 100, default: 100 },   // attendance percentage
      Severity: Major
      Found in schema/RightCollection.js - About 4 hrs to fix

        Function site has 120 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports = module.exports = function site(languageCode) {
        
            let headers = {};
            let sessionCookie;
        
        
        Severity: Major
        Found in doc/create_screenshots/site.js - About 4 hrs to fix

          File routes.js has 366 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          define(['angular', 'app'], function(angular, app) {
              'use strict';
          
              return app.config(['$routeProvider', function($routeProvider) {
          
          
          Severity: Minor
          Found in public/js/routes.js - About 4 hrs to fix

            Function createGraphValues has 117 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function createGraphValues(renewals, requestsPromise)
                    {
                        var history = [];
            
                        function round(x) {
            Severity: Major
            Found in public/js/services/beneficiary.js - About 4 hrs to fix

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

              exports = module.exports = function(services, app) {
              
                  var service = new services.list(app);
              
              
              
              Severity: Major
              Found in api/services/user/accountbeneficiaries/list.js - About 4 hrs to fix

                Function saveRequest has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function saveRequest(service, params) {
                
                    const gt = service.app.utility.gettext;
                    const postpone = service.app.utility.postpone;
                
                
                Severity: Major
                Found in api/services/user/requests/save.js - About 4 hrs to fix

                  Function createDistribution has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function createDistribution(renewals, periods, accountRights, matchQuantity) {
                  
                              var totalSeconds = 0;
                              var totalDays = 0;
                  
                  
                  Severity: Major
                  Found in public/js/services/absence-edit.js - About 4 hrs to fix

                    Function saveRequest has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function saveRequest(service, params) {
                    
                        const gt = service.app.utility.gettext;
                        const postpone = service.app.utility.postpone;
                    
                    
                    Severity: Major
                    Found in api/services/manager/waitingrequests/save.js - About 4 hrs to fix

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

                      exports = module.exports = function(app, passport)
                      {
                          var controllers = new fileControllers(app);
                      
                      
                      
                      Severity: Major
                      Found in rest/routes.js - About 4 hrs to fix

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

                        exports = module.exports = function(services, app) {
                        
                            var service = new services.list(app);
                        
                            /**
                        Severity: Major
                        Found in api/services/user/calendarevents/list.js - About 4 hrs to fix

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

                          exports = module.exports = function(user, account) {
                          
                          
                          
                              /**
                          Severity: Major
                          Found in api/services/user/accountbeneficiaries/renewals.js - About 4 hrs to fix

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

                            exports = module.exports = function(params) {
                                var companySchema = new params.mongoose.Schema({
                                    name: { type: String, required: true, unique: true },            // company name, site title
                                    port: { type: Number, default: 3000 },                            // server port
                                    lastname: String,                                                // system owner
                            Severity: Major
                            Found in schema/Company.js - About 4 hrs to fix

                              Function getResultPromise has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  service.getResultPromise = function(params) {
                              
                                      var getExpandedEra = require('../../../../modules/getExpandedEra');
                              
                                      /**
                              Severity: Major
                              Found in api/services/user/calendarevents/list.js - About 4 hrs to fix

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

                                exports = module.exports = function(params) {
                                
                                    const mongoose = params.mongoose;
                                
                                    var defaultHalfDay = new Date();
                                Severity: Minor
                                Found in schema/Calendar.js - About 4 hrs 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 101 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                exports = module.exports = function(service, moment) {
                                
                                    const gt = service.app.utility.gettext;
                                
                                    const NAME              = gt.gettext('Name');
                                Severity: Major
                                Found in api/services/admin/exports/balance.js - About 4 hrs to fix

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

                                  exports = module.exports = function(services, app) {
                                  
                                      let service = new services.get(app);
                                  
                                      const gt = app.utility.gettext;
                                  Severity: Major
                                  Found in api/services/user/consumption/get.js - About 3 hrs to fix

                                    Function processRenewals has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function processRenewals(rightDocument, beneficiary, renewals, moment)
                                        {
                                    
                                            beneficiary.renewals = [];
                                            beneficiary.daysRatio = 1;
                                    Severity: Major
                                    Found in api/services/user/accountbeneficiaries/renewals.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language