linagora/openpaas-esn

View on GitHub

Showing 726 of 2,177 total issues

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

  function leave(objectType, collaboration, userAuthor, userTarget, callback) {
Severity: Minor
Found in backend/core/collaboration/member/index.js - About 35 mins to fix

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

      function cancelMembershipInvitation(objectType, collaboration, membership, manager, callback) {
    Severity: Minor
    Found in backend/core/collaboration/member/index.js - About 35 mins to fix

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

          _,
          $q,
          esnUserNotificationProviders,
          CounterFactory,
          ESN_USER_NOTIFICATION_UNREAD_REFRESH_TIMER

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

        module.exports.userMessageToTimelineEntry = function(message, verb, user, shares, date) {
        Severity: Minor
        Found in backend/core/activitystreams/helpers.js - About 35 mins to fix

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

          function recordAvatar(id, contentType, opts, readable, callback) {
          Severity: Minor
          Found in backend/core/image/index.js - About 35 mins to fix

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

              function cancelMembershipRequest(objectType, collaboration, membership, user, callback) {
            Severity: Minor
            Found in backend/core/collaboration/member/index.js - About 35 mins to fix

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

                  var removeStateListener = $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {

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

                    $stateParams,
                    $rootScope,
                    esnSearchContextService,
                    esnSearchQueryService,
                    esnI18nService

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

                      $parse,
                      profilePopoverCardService,
                      touchscreenDetectorService,
                      matchmedia,
                      ESN_MEDIA_QUERY_SM_XS

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

                          function link(scope, element, attrs, ctrl, transclude) {
                    Severity: Minor
                    Found in frontend/js/modules/subheader/sub-header.directive.js - About 35 mins to fix

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

                          $q,
                          _,
                          moment,
                          esnConfig,
                          ESN_DATETIME_TIME_FORMATS
                      Severity: Minor
                      Found in frontend/js/modules/datetime/datetime.service.js - About 35 mins to fix

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

                        module.exports = dependencies => {
                          const { Model } = dependencies('people');
                        
                          return ({ source }) => {
                            const { id, fullName, firstName, lastName, emails, phones } = parseContact(source);
                        Severity: Minor
                        Found in modules/linagora.esn.contact/backend/lib/people/denormalizer.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 canLeave has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function canLeave(req, res, next) {
                          if (!req.collaboration) {
                            return res.status(400).json({error: 400, message: 'Bad Request', details: 'Missing collaboration'});
                          }
                        
                        
                        Severity: Minor
                        Found in backend/webserver/middleware/collaboration.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

                        module.exports = dependencies => {
                          const jobQueue = dependencies('jobqueue');
                          const contactModule = dependencies('contact');
                          const logger = dependencies('logger');
                          const {
                        Severity: Minor
                        Found in modules/linagora.esn.contact.import/backend/lib/import.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 canWriteUserConfig has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function canWriteUserConfig(req, res, next) {
                          const modules = req.body;
                        
                          const hasUnwritableConfig = modules.some(module => {
                            if (!module || !Array.isArray(module.configurations)) {
                        Severity: Minor
                        Found in backend/webserver/middleware/configuration.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 getMembershipRequests has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function getMembershipRequests(req, res) {
                          const collaboration = req.collaboration;
                        
                          if (!req.isCollaborationManager) {
                            return res.status(403).json({error: {code: 403, message: 'Forbidden', details: 'Only collaboration managers can get requests'}});
                        Severity: Minor
                        Found in backend/webserver/controllers/collaborations.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 profileToUser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports.profileToUser = function(profile, user) {
                          user = user || {};
                          user.firstname = profile.name.givenName ? profile.name.givenName : '';
                          user.lastname = profile.name.familyName ? profile.name.familyName : '';
                          user.description = profile._json.bio ? profile._json.bio : '';
                        Severity: Minor
                        Found in modules/linagora.esn.login.oauth/backend/lib/provision/facebook.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 translate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function translate(baseUser, payload) {
                          const userEmail = payload.username; // we use email as username to authenticate
                          const domainId = payload.domainId;
                          const payloadUser = payload.user;
                          const mapping = payload.mapping;
                        Severity: Minor
                        Found in backend/core/user/index.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 count has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function count(options) {
                          var defer = q.defer();
                          var query = {};
                        
                          if (options.type) {
                        Severity: Minor
                        Found in backend/core/resource-link/index.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 validateAction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function validateAction(value) {
                          if (!value.url) { return false; }
                          if (!value.display) { return false; }
                          if (!value.display.label) { return false; }
                          if (!value.display.text) { return false; }
                        Severity: Minor
                        Found in backend/core/db/mongo/schemas/action.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