gadael/gadael

View on GitHub

Showing 364 of 761 total issues

Function createRandomUser has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

api.createRandomUser = function(app, email, password, lastname, firstname) {
Severity: Minor
Found in api/User.api.js - About 35 mins to fix

    Function removeOrUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    var removeOrUpdate = function(userDocument, checkedRole, model, updateCallback, noRoleCallback) {
    Severity: Minor
    Found in modules/roles.js - About 35 mins to fix

      Function createBusinessDaysConsRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      api.createBusinessDaysConsRequest = function(app, dtstart, dtend, nbdays, availableQuantity) {
      Severity: Minor
      Found in api/User.api.js - About 35 mins to fix

        Function createRandomAccount has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        api.createRandomAccount = function(app, email, password, lastname, firstname) {
        Severity: Minor
        Found in api/User.api.js - About 35 mins to fix

          Function useGoogleStrategy has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function useGoogleStrategy(request, accessToken, refreshToken, profile, done) {
          Severity: Minor
          Found in modules/passport.js - About 35 mins to fix

            Function createRandomAdmin has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            api.createRandomAdmin = function(app, email, password, lastname, firstname) {
            Severity: Minor
            Found in api/User.api.js - About 35 mins to fix

              Function createRandomManager has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              api.createRandomManager = function(app, email, password, lastname, firstname) {
              Severity: Minor
              Found in api/User.api.js - About 35 mins to fix

                Function createProportionConsRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                api.createProportionConsRequest = function(app, attendance, dtstart, dtend, nbdays) {
                Severity: Minor
                Found in api/User.api.js - About 35 mins to fix

                  Function createEncUser has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  api.createEncUser = function(app, email, password, lastname, firstname) {
                  Severity: Minor
                  Found in api/User.api.js - About 35 mins to fix

                    Function createEncAdmin has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    api.createEncAdmin = function(app, email, password, lastname, firstname) {
                    Severity: Minor
                    Found in api/User.api.js - About 35 mins to fix

                      Function createElement has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function createElement(service, user, elem, collection, setElemProperties)
                      Severity: Minor
                      Found in api/services/user/requests/saveAbsence.js - About 35 mins to fix

                        Function exports has a Cognitive Complexity of 7 (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/collections/list.js - About 35 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 7 (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/accountcollections/delete.js - About 35 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 7 (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/accountschedulecalendars/delete.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports = module.exports = function(period1, period2) {
                            if (period2.to && period1.to) {
                                if (period1.to > period2.from && period1.from < period2.to) {
                                    // the current period overlap one of the existing periods
                                    return false;
                        Severity: Minor
                        Found in modules/testoverlap.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports = module.exports = function(app) {
                        
                            const gt = app.utility.gettext;
                        
                            return function checkParams(service, params) {
                        Severity: Minor
                        Found in modules/requestdateparams.js - About 35 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 validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function validate(service, params) {
                        
                            const gt = service.app.utility.gettext;
                        
                            if (service.needRequiredFields(params, ['dtstart', 'dtend', 'name', 'userCreated', 'collections', 'departments', 'right'])) {
                        Severity: Minor
                        Found in api/services/admin/compulsoryleaves/save.js - About 35 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 7 (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/accountnwdayscalendars/delete.js - About 35 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 saveCollection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function saveCollection(service, params) {
                        
                            const gt = service.app.utility.gettext;
                        
                        
                        
                        Severity: Minor
                        Found in api/services/admin/collections/save.js - About 35 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 saveAbsenceDistribution has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function saveAbsenceDistribution(service, user, params, collection) {
                        
                        
                            if (params.absence.distribution === undefined || params.absence.distribution.length === 0) {
                                return Promise.reject(new Error('Right distribution is mandatory to save an absence request'));
                        Severity: Minor
                        Found in api/services/user/requests/saveAbsence.js - About 35 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

                        Severity
                        Category
                        Status
                        Source
                        Language