gadael/gadael

View on GitHub

Showing 364 of 761 total issues

Function getNextButtonJob has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function getNextButtonJob($scope, user, accountRights) {

            return function() {
                // hide the period selection
                $scope.periodSelection = false;
Severity: Major
Found in public/js/services/absence-edit.js - About 3 hrs to fix

    Function getInitTask has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        rightSchema.statics.getInitTask = function(company) {
    
            let model = this;
    
    
    
    Severity: Major
    Found in schema/Right.js - About 3 hrs to fix

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

      exports = module.exports = function(req, res) {
          var workflow = new (require('events').EventEmitter)();
      
          workflow.httpstatus = 200;
      
      
      Severity: Minor
      Found in modules/workflow.js - About 3 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 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

            service.getResultPromise = function(params) {
        
                var filter = {
                    _id: params.id
                };
        Severity: Major
        Found in api/services/user/requests/get.js - About 3 hrs to fix

          Function exports has a Cognitive Complexity of 24 (exceeds 5 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: Minor
          Found in schema/RightCollection.js - About 3 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 a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          exports = module.exports = function(params) {
          
              var mongoose = params.mongoose;
          
              var eventSchema = new mongoose.Schema({
          Severity: Minor
          Found in schema/CalendarEvent.js - About 3 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 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function convertOvertimeQuantity has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function convertOvertimeQuantity(service, params) {
                const gt = service.app.utility.gettext;
                const AccountModel = service.app.db.models.Account;
                const OvertimeModel = service.app.db.models.Overtime;
                const RightModel = service.app.db.models.Right;
            Severity: Major
            Found in api/services/admin/overtimesummary/save.js - About 3 hrs to fix

              File calendar.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              define(['moment'], function(moment) {
                  'use strict';
              
                  return function loadCalendarService($locale, $q, $routeParams) {
              
              
              Severity: Minor
              Found in public/js/services/calendar.js - About 3 hrs to fix

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

                exports = module.exports = function(params) {
                    var mongoose = params.mongoose;
                    var absenceElemSchema = new mongoose.Schema({
                        quantity: { type: Number, required: true },         // quantity equal to duration of period in the planning (only duration of worked schedule)
                        consumedQuantity: { type: Number, required: true }, // quantity removed from vacation right according to Right.consumption
                Severity: Minor
                Found in schema/Request_AbsenceElem.js - About 3 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 LoadRestListService has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    return function LoadRestListService(ResourceFactory, RestResource) {
                
                        /**
                         * the returned object will be the one used in controller
                         * to create the resource from url or create a new one
                Severity: Major
                Found in public/js/services/rest.js - About 3 hrs to fix

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

                  exports = module.exports = function(params) {
                  
                      var mongoose = params.mongoose;
                      var typeSchema = new mongoose.Schema({
                          name: { type: String, unique: true },
                  Severity: Major
                  Found in schema/Type.js - About 3 hrs to fix

                    Function getExpress has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        getExpress: function getExpress(config, models) {
                    
                            let mongoStore = connectMongodbSession(session);
                    
                    
                    
                    Severity: Major
                    Found in api/Company.api.js - About 3 hrs to fix

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

                      exports = module.exports = function(services, app) {
                      
                          let service = new services.get(app);
                      
                          const gt = app.utility.gettext;
                      Severity: Minor
                      Found in api/services/user/consumption/get.js - About 3 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 resetPassword has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.resetPassword = function(req, res) {
                      
                          let User = req.app.db.models.User;
                          let gt = req.app.utility.gettext;
                          let workflow = req.app.utility.workflow(req, res);
                      Severity: Major
                      Found in rest/login.js - About 3 hrs to fix

                        Function saveCompulsoryLeave has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function saveCompulsoryLeave(service, params) {
                        
                            const gt = service.app.utility.gettext;
                        
                            /**
                        Severity: Major
                        Found in api/services/admin/compulsoryleaves/save.js - About 3 hrs to fix

                          Function getUserRequests has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function getUserRequests(user, from, to, types) {
                          
                              let calendar;
                          
                          
                          
                          Severity: Major
                          Found in api/services/admin/exports/sage.js - About 3 hrs to fix

                            Function createRequest has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function createRequest(userId) {
                            
                                    let fieldsToSet;
                            
                                    let Request = service.app.db.models.Request;
                            Severity: Major
                            Found in api/services/admin/compulsoryleaves/save.js - About 2 hrs to fix

                              Function prepareRequestFields has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function prepareRequestFields(service, params, user)
                              {
                              
                              
                                  return getApprovalSteps(user)
                              Severity: Major
                              Found in api/services/user/requests/save.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language