linagora/openpaas-esn

View on GitHub

Showing 726 of 2,177 total issues

Function MultipleAddressBookPaginationProvider has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    $log,
    PageAggregatorService,
    AddressBookPaginationProvider,
    ContactVirtualAddressBookPaginationProvider,
    ContactShellComparator,

    Function ESNSearchResultController has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        _,
        $stateParams,
        $q,
        searchProviders,
        esnSearchQueryService,
    Severity: Major
    Found in frontend/js/modules/search/result/search-result.controller.js - About 1 hr to fix

      Function ESNCollaborationMembershipRequestsWidgetController has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          $rootScope,
          esnCollaborationClientService,
          esnCollaborationMembershipRequestsPaginationProvider,
          infiniteScrollHelper,
          PageAggregatorService,

        Function boxOverlayManager has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          function boxOverlayManager(_, $rootScope, $window, $compile, $http, $templateCache, notificationFactory, ESN_BOX_OVERLAY_MAX_WINDOWS) {
        Severity: Major
        Found in frontend/js/modules/box-overlay/box-overlay-manager.service.js - About 1 hr to fix

          Function directive has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              $compile,
              matchmedia,
              ESN_MEDIA_QUERY_SM_XS,
              ESN_MEDIA_QUERY_MD,
              ESN_HEADER_HEIGHT_MD,
          Severity: Major
          Found in frontend/js/modules/header/sticky/header-sticky.directive.js - About 1 hr to fix

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

            module.exports = function(grunt) {
            
              grunt.registerMultiTask('splitfiles', 'split the files and run separate targets', function() {
                var options = this.options({
                  chunk: 50,
            Severity: Minor
            Found in tasks/tests.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function(dependencies) {
            
              var cron = dependencies('cron');
              var logger = dependencies('logger');
              var config = dependencies('config')('cronjob');
            Severity: Minor
            Found in modules/linagora.esn.digest.daily/lib/index.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function(dependencies) {
            
              var logger = dependencies('logger');
              var configHelpers = dependencies('helpers').config;
            
            

            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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function get(req, res) {
              if (!req.query.objectType) {
                if (!req.query.email || typeof req.query.email !== 'string' || req.query.email.length === 0) {
                  return res.status(400).json({ error: { code: 400, message: 'Bad request', details: 'When no objectType is provided, email is mandatory and must be a non-empty string'}});
                }
            Severity: Minor
            Found in backend/webserver/controllers/avatars.js - About 55 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 getMine has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function getMine(req, res) {
              function streamsCallback(err, streams) {
                if (err) {
                  return res.status(500).json({error: {code: 500, message: 'Server error', details: err.message}});
                }
            Severity: Minor
            Found in backend/webserver/controllers/activitystreams.js - About 55 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 listByCursor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function listByCursor(options = {}) {
              const query = _.isEmpty(options) ? {} : { $and: [] };
            
              if (options.domainIds && options.domainIds.length) {
                query.$and.push({
            Severity: Minor
            Found in backend/core/user/index.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = collaborationModule => {
              return {
                collaborationJoinHandler,
                membershipAcceptedHandler,
                membershipInviteHandler,
            Severity: Minor
            Found in backend/core/collaboration/usernotification.js - About 55 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 run has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                _,
                accountMessageRegistry,
                accountService,
                dynamicDirectiveService,
                socialHelper,
            Severity: Major
            Found in modules/linagora.esn.account/frontend/js/app.run.js - About 50 mins to fix

              Function contactAddressbookSettingsMainController has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  _,
                  contactAddressbookService,
                  CONTACT_ADDRESSBOOK_PUBLIC_RIGHT,
                  CONTACT_SHARING_SHARE_ACCESS,
                  CONTACT_SHARING_SUBSCRIPTION_TYPE,

                Function contactAddressbookSharedConfigurationController has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    $log,
                    _,
                    asyncAction,
                    session,
                    contactAddressbookService,

                  Function ContactShellBuilder has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      $log,
                      $q,
                      ContactShell,
                      ContactShellHelper,
                      contactUpdateDataService,

                    Function addMembershipRequest has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      function addMembershipRequest(objectType, collaboration, userAuthor, userTarget, workflow, actor, callback) {
                    Severity: Major
                    Found in backend/core/collaboration/member/index.js - About 50 mins to fix

                      Function attachmentAlternativeUploaderModalNoUploaderController has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          $q,
                          $filter,
                          $scope,
                          $modal,
                          _,

                        Function followerListController has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          function followerListController($scope, session, userUtils, FollowScrollBuilder, FollowPaginationHelper, _, FOLLOW_PAGE_SIZE) {
                        Severity: Major
                        Found in frontend/js/modules/follow/list/follower-list.controller.js - About 50 mins to fix

                          Function ESNCollaborationMemberController has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              $log,
                              $rootScope,
                              notificationFactory,
                              session,
                              esnCollaborationService,
                            Severity
                            Category
                            Status
                            Source
                            Language