linagora/openpaas-esn

View on GitHub

Showing 726 of 2,177 total issues

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

module.exports = function(dependencies) {

  var logger = dependencies('logger');
  var collaborationModule = dependencies('collaboration');
  var messageModule = dependencies('message');
Severity: Major
Found in modules/linagora.esn.digest.daily/lib/daily.js - About 7 hrs to fix

    File avatar.js has 485 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    angular.module('esn.avatar', [
      'esn.constants',
      'mgcrea.ngStrap',
    Severity: Minor
    Found in frontend/js/modules/avatar.js - About 7 hrs to fix

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

        function profilePopoverCardService(
          $rootScope,
          $compile,
          $modal,
          $log,

        File contact-show.controller.spec.js has 470 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        /* global sinon, chai: false */
        
        var expect = chai.expect;

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

          module.exports = function() {
          
            function getFormattedName(json) {
              if (json.title[0]) {
                return json.title[0];
          Severity: Minor
          Found in modules/linagora.esn.contact.import.google/backend/lib/mapping.js - About 7 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 47 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function(dependencies) {
          
            var logger = dependencies('logger');
            var pubsub = dependencies('pubsub');
            var registry = require('./registry')(dependencies);
          Severity: Minor
          Found in modules/linagora.esn.cron/lib/index.js - About 7 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 getTracker has 177 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports.getTracker = function(type) {
          
            var Tracker = getModel(type);
            if (!Tracker) {
              throw new Error(type + ' is not a valid tracker type');
          Severity: Major
          Found in backend/core/activitystreams/tracker.js - About 7 hrs to fix

            File box-overlay.spec.js has 460 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict';
            
            /* global chai: false, sinon: false */
            
            var expect = chai.expect;
            Severity: Minor
            Found in frontend/js/modules/box-overlay/box-overlay.spec.js - About 7 hrs to fix

              File websocket.js has 457 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              angular.module('esn.websocket', ['esn.authentication', 'esn.session', 'esn.socketio', 'esn.http'])
                .factory('IoAction', function($timeout) {
                  function getNgCallback(callback) {
              Severity: Minor
              Found in frontend/js/modules/websocket.js - About 7 hrs to fix

                File index.js has 443 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                'use strict';
                
                const _ = require('lodash');
                const async = require('async');
                const localpubsub = require('../../pubsub').local;
                Severity: Minor
                Found in backend/core/collaboration/member/index.js - About 6 hrs to fix

                  File controller.js has 434 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  'use strict';
                  
                  const q = require('q');
                  const PATH = 'addressbooks';
                  
                  

                    Function boxOverlayProvider has 159 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function boxOverlayProvider() {
                        this.$get = function($window, $rootScope, $timeout, $q, boxOverlayManager, BoxOverlayStateManager, deviceDetector, DEVICES, ESN_BOX_OVERLAY_EVENTS) {
                          return BoxOverlayFactory;
                    
                          function BoxOverlayFactory(config) {
                    Severity: Major
                    Found in frontend/js/modules/box-overlay/box-overlay.provider.js - About 6 hrs to fix

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

                      module.exports = dependencies => {
                        const logger = dependencies('logger');
                        const elasticsearch = dependencies('elasticsearch');
                        const pubsub = dependencies('pubsub');
                        const listener = require('./listener')(dependencies);
                      Severity: Major
                      Found in modules/linagora.esn.contact/backend/lib/search/index.js - About 6 hrs to fix

                        Function $get has 157 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.$get = function($window, $rootScope, $timeout, $q, boxOverlayManager, BoxOverlayStateManager, deviceDetector, DEVICES, ESN_BOX_OVERLAY_EVENTS) {
                              return BoxOverlayFactory;
                        
                              function BoxOverlayFactory(config) {
                                var scope = angular.extend($rootScope.$new(), config);
                        Severity: Major
                        Found in frontend/js/modules/box-overlay/box-overlay.provider.js - About 6 hrs to fix

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

                          module.exports = function(dependencies) {
                          
                            var lib = {};
                          
                            var emailTokenModel = require('../backend/db/models/email-recipient-token');
                          Severity: Major
                          Found in modules/linagora.esn.messaging.email/lib/index.js - About 6 hrs to fix

                            Function ContactsHelper has 150 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function ContactsHelper(
                                  $filter,
                                  esnDatetimeService,
                                  contactAddressbookDisplayService,
                                  CONTACT_ATTRIBUTES_ORDER
                            Severity: Major
                            Found in modules/linagora.esn.contact/frontend/app/contact/helper.service.js - About 6 hrs to fix

                              File contact-live-update.service.spec.js has 411 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              'use strict';
                              
                              /* global chai: false */
                              /* global sinon: false */
                              
                              

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

                                module.exports = function(dependencies) {
                                
                                  var logger = dependencies('logger');
                                  var pubsub = dependencies('pubsub');
                                  var registry = require('./registry')(dependencies);
                                Severity: Major
                                Found in modules/linagora.esn.cron/lib/index.js - About 5 hrs to fix

                                  Function esnDatetimeService has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function esnDatetimeService(
                                      $q,
                                      _,
                                      moment,
                                      esnConfig,
                                  Severity: Major
                                  Found in frontend/js/modules/datetime/datetime.service.js - About 5 hrs to fix

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

                                    function init(dependencies) {
                                      const logger = dependencies('logger');
                                      const pubsub = dependencies('pubsub').global;
                                      const io = dependencies('wsserver').io;
                                    
                                    
                                    Severity: Minor
                                    Found in modules/linagora.esn.contact/backend/ws/contact.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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language