linagora/openpaas-esn

View on GitHub

Showing 726 of 2,177 total issues

Function addMembership has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function addMembership(objectType, collaboration, userAuthor, userTarget, workflow, actor) {
Severity: Minor
Found in backend/webserver/controllers/collaborations.js - About 45 mins to fix

    Function submit has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      function submit(description, cronTime, job, context, opts, callback) {
    Severity: Minor
    Found in modules/linagora.esn.cron/lib/index.js - About 45 mins to fix

      Function store has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function store(req, res) {
      
        var data = req.body;
      
        if (!data.hostname || !data.port || !data.dbname) {
      Severity: Minor
      Found in backend/webserver/controllers/document-store.js - About 45 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 checkMemberAccounts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function checkMemberAccounts(req, res, next) {
        const accountList = req.body.accounts;
      
        const errorMessage = {
          error: {
      Severity: Minor
      Found in backend/webserver/middleware/domain.js - About 45 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 list has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function list(req, res) {
        const user = req.user;
        const query = {};
      
        if (req.query.limit) {
      Severity: Minor
      Found in backend/webserver/controllers/usernotifications.js - About 45 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 getMembers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function getMembers(req, res) {
        const query = {};
      
        if (req.query.limit) {
          const limit = parseInt(req.query.limit, 10);
      Severity: Minor
      Found in backend/webserver/controllers/collaborations.js - About 45 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 Task has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function Task(id, job, delay, context, onComplete, onCancel) {
      Severity: Minor
      Found in modules/linagora.esn.graceperiod/lib/task.js - About 45 mins to fix

        Function profileToUser has a Cognitive Complexity of 8 (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.job_title = profile._json.occupation ? profile._json.occupation : '';
        Severity: Minor
        Found in modules/linagora.esn.login.oauth/backend/lib/provision/google.js - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function(dependencies) {
          const logger = dependencies('logger');
          const esnConfig = dependencies('esn-config');
          const config = dependencies('config')('default');
        
        
        Severity: Minor
        Found in modules/linagora.esn.login.oauth/backend/lib/index.js - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function(dependencies) {
        
          var logger = dependencies('logger');
          var userModule = dependencies('user');
          var config = dependencies('config')('cronjob');
        Severity: Minor
        Found in modules/linagora.esn.contact.import/backend/lib/cron/index.js - About 45 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 validateConnection has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function validateConnection(hostname, port, dbname, username, password, callback) {
        Severity: Minor
        Found in backend/core/db/mongo/index.js - About 45 mins to fix

          Function _createInterface has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            _createInterface(topic) {
              return {
                subscribe: handler => {
                  if (!this.client) {
                    return this._addCache(topic, 'subscribe', handler);
          Severity: Minor
          Found in backend/core/pubsub/pubsub.js - About 45 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 buildConnectionString has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function buildConnectionString(hostname, port, dbname, username, password, connectionOptions) {
          Severity: Minor
          Found in backend/core/db/mongo/index.js - About 45 mins to fix

            Function userMessageCommentToTimelineEntry has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              Function _createInterface has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                _createInterface(topic) {
                  return {
                    subscribe: handler => {
                      this._addCache(topic, ACTION_SUBSCRIBE, handler);
              
              
              Severity: Minor
              Found in backend/core/pubsub/global/rabbit.js - About 45 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 store has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              module.exports.store = function(id, contentType, metadata, stream, options, callback) {
              Severity: Minor
              Found in backend/core/filestore/gridfs.js - About 45 mins to fix

                Function join has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Function unregister has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        var unregister = $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams, options) {
                  Severity: Minor
                  Found in frontend/js/modules/previous-page.js - About 45 mins to fix

                    Function esnDatetimeDatePickerController has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      function esnDatetimeDatePickerController($scope, $element, $compile, $timeout, moment, esnDatetimeService) {
                    Severity: Minor
                    Found in frontend/js/modules/datetime/date-picker/date-picker.controller.js - About 45 mins to fix

                      Function messageActionsController has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          $log,
                          $rootScope,
                          activitystreamAPI,
                          esnMessageService,
                          notificationFactory,
                      Severity: Minor
                      Found in frontend/js/modules/message/actions/message-actions.controller.js - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language