gadael/gadael

View on GitHub

Showing 364 of 761 total issues

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

exports = module.exports = function(params) {

    var mongoose = params.mongoose;


Severity: Major
Found in schema/Right_Renewal.js - About 3 days to fix

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

    exports = module.exports = function(params) {
        const mongoose = params.mongoose;
        const accountSchema = new mongoose.Schema({
            user: {
              id: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true, unique: true },
    Severity: Major
    Found in schema/User_Account.js - About 3 days to fix

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

      exports = module.exports = function(params) {
      
          const dispunits = params.app.utility.dispunits;
          const mongoose = params.mongoose;
      
      
      Severity: Major
      Found in schema/Right.js - About 2 days to fix

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

        exports = module.exports = function(params) {
        
            let mongoose = params.mongoose;
            let userSchema = new mongoose.Schema({
                password: { type: String, select: false },
        Severity: Major
        Found in schema/User.js - About 2 days to fix

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

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

          exports = module.exports = function(params) {
          
              const mongoose = params.mongoose;
          
              var requestSchema = new mongoose.Schema({
          Severity: Major
          Found in schema/Request.js - About 2 days to fix

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

            exports = module.exports = function(params) {
            
                const mongoose = params.mongoose;
            
                var defaultHalfDay = new Date();
            Severity: Major
            Found in schema/Calendar.js - About 2 days to fix

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

              exports = module.exports = function(params) {
              
                  const dispunits = params.app.utility.dispunits;
                  const mongoose = params.mongoose;
              
              
              Severity: Minor
              Found in schema/Right.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

              File Right_Renewal.js has 687 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              const consumptionHistory = require('../modules/consumptionHistory');
              const util = require('util');
              
              
              Severity: Major
              Found in schema/Right_Renewal.js - About 1 day to fix

                File User_Account.js has 666 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                'use strict';
                
                const jurassic = require('jurassic');
                const util = require('util');
                const userAccountCustomize = require('./plugins/userAccountCustomize');
                Severity: Major
                Found in schema/User_Account.js - About 1 day to fix

                  Function loadCalendarService has 298 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      return function loadCalendarService($locale, $q, $routeParams) {
                  
                          /**
                           * Object for calendar day
                           */
                  Severity: Major
                  Found in public/js/services/calendar.js - About 1 day to fix

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

                        calendarSchema.statics.getInitTask = function(company) {
                    
                            let model = this;
                    
                            const gt = params.app.utility.gettext;
                    Severity: Major
                    Found in schema/Calendar.js - About 1 day to fix

                      Function createDefaults has 277 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function createDefaults() {
                      
                                  let allCalendars = [
                                  {
                                      _id: '5740adf51cf1a569643cc101',
                      Severity: Major
                      Found in schema/Calendar.js - About 1 day to fix

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

                        exports = module.exports = function(params) {
                            const mongoose = params.mongoose;
                            const accountSchema = new mongoose.Schema({
                                user: {
                                  id: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true, unique: true },
                        Severity: Minor
                        Found in schema/User_Account.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 saveRequests has 271 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function saveRequests(service, params) {
                        
                            const gt = service.app.utility.gettext;
                            const postpone = service.app.utility.postpone;
                        
                        
                        Severity: Major
                        Found in api/services/admin/compulsoryleaves/save.js - About 1 day to fix

                          File Right.js has 590 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          'use strict';
                          
                          const SpecialRightIndex = require('../api/specialrights/index');
                          
                          
                          
                          Severity: Major
                          Found in schema/Right.js - About 1 day to fix

                            File User.js has 577 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            'use strict';
                            
                            const bcrypt = require('bcryptjs');
                            const Charlatan = require('charlatan');
                            const util = require('util');
                            Severity: Major
                            Found in schema/User.js - About 1 day to fix

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

                              module.exports = function(grunt) {
                              
                                  'use strict';
                              
                                  let pkg = require('./package.json');
                              Severity: Major
                              Found in Gruntfile.js - About 1 day to fix

                                File Request.js has 539 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                'use strict';
                                
                                
                                /**
                                 * array map function to get Id from the document or ID
                                Severity: Major
                                Found in schema/Request.js - About 1 day to fix

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

                                  exports = module.exports = function(params) {
                                  
                                      let mongoose = params.mongoose;
                                      let userSchema = new mongoose.Schema({
                                          password: { type: String, select: false },
                                  Severity: Minor
                                  Found in schema/User.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language