gadael/gadael

View on GitHub

Showing 364 of 761 total issues

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

exports = module.exports = function(params) {

    var mongoose = params.mongoose;


Severity: Minor
Found in schema/Right_Renewal.js - About 1 day 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 202 lines of code (exceeds 25 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: Major
Found in schema/Request_AbsenceElem.js - About 1 day to fix

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

    exports = module.exports = function(params) {
    
        const mongoose = params.mongoose;
    
        const ruleTypes = [
    Severity: Major
    Found in schema/Right_Rule.js - About 1 day to fix

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

      exports = module.exports = function(app, passport) {
      
          let loginservices = app.config.company.loginservices;
          let User = app.db.models.User;
          let gt = app.utility.gettext;
      Severity: Major
      Found in modules/passport.js - About 7 hrs to fix

        Function init has 187 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            return function init(decimalAdjust, gettext) {
        
        
                /**
                 * Create graph values
        Severity: Major
        Found in public/js/services/beneficiary.js - About 7 hrs to fix

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

          exports = module.exports = (app) => {
              return new OAuthServer({
                  useErrorHandler: true,
                  model: {
                      /**
          Severity: Major
          Found in modules/oauth.js - About 7 hrs to fix

            Function requestEdit has 181 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                return function requestEdit(gettextCatalog) {
                    /**
                     * Duration in milliseconds updated on every period changes
                     * @var {int}
                     */
            Severity: Major
            Found in public/js/services/request-edit.js - About 7 hrs to fix

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

              exports = module.exports = function(params) {
              
                  var mongoose = params.mongoose;
              
                  var eventSchema = new mongoose.Schema({
              Severity: Major
              Found in schema/CalendarEvent.js - About 7 hrs to fix

                File absence-edit.js has 448 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                define(['angular', 'services/request-edit'], function(angular, loadRequestEdit) {
                    'use strict';
                
                    return function(gettextCatalog) {
                        var RequestEdit = loadRequestEdit(gettextCatalog);
                Severity: Minor
                Found in public/js/services/absence-edit.js - About 6 hrs to fix

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

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

                    File Company.api.js has 428 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    'use strict';
                    
                    const models = require('../models');
                    const helmet = require('helmet');
                    const routes = require('../rest/routes');
                    Severity: Minor
                    Found in api/Company.api.js - About 6 hrs to fix

                      Function getInfos has 155 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.getInfos = function(req, res) {
                      
                      
                          let gt = req.app.utility.gettext;
                      
                      
                      Severity: Major
                      Found in rest/Common.js - About 6 hrs to fix

                        Function pages has 153 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        exports = module.exports = function pages(server) {
                        
                            function createUser() {
                                return new Promise((resolve, reject) => {
                                    server.post('/rest/admin/users', {
                        Severity: Major
                        Found in doc/create_screenshots/pages.js - About 6 hrs to fix

                          File Calendar.js has 412 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          'use strict';
                          
                          const ical = require('ical');
                          const util = require('util');
                          const latinize = require('latinize');
                          Severity: Minor
                          Found in schema/Calendar.js - About 5 hrs to fix

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

                            exports = module.exports = function(params) {
                            
                                const mongoose = params.mongoose;
                            
                                const ruleTypes = [
                            Severity: Minor
                            Found in schema/Right_Rule.js - About 5 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 37 (exceeds 5 allowed). Consider refactoring.
                            Open

                            exports = module.exports = function(app, passport) {
                            
                                let loginservices = app.config.company.loginservices;
                                let User = app.db.models.User;
                                let gt = app.utility.gettext;
                            Severity: Minor
                            Found in modules/passport.js - About 5 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 37 (exceeds 5 allowed). Consider refactoring.
                            Open

                            exports = module.exports = function(services, app) {
                            
                                let service = new services.list(app);
                            
                                let collaborators = {};
                            Severity: Minor
                            Found in api/services/user/collaborators/list.js - About 5 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

                            File save.js has 397 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            'use strict';
                            
                            const saveAbsence = require('./../../user/requests/saveAbsence');
                            const Services = require('restitute').service;
                            const util = require('util');
                            Severity: Minor
                            Found in api/services/admin/compulsoryleaves/save.js - About 5 hrs to fix

                              Function createRenewalChart has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  return function createRenewalChart(gettextCatalog, $filter) {
                              
                                      return function renewalChart($scope, beneficiariesResource)
                                      {
                                          $scope.renewalChart = {
                              Severity: Major
                              Found in public/js/services/renewalChart.js - About 5 hrs to fix

                                Function renewalChart has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        return function renewalChart($scope, beneficiariesResource)
                                        {
                                            $scope.renewalChart = {
                                
                                                availableHours: 0,
                                Severity: Major
                                Found in public/js/services/renewalChart.js - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language