Eye4web/Eye4webZfcUserPm

View on GitHub

Showing 68 of 124 total issues

Avoid deeply nested control flow statements.
Open

                        if (opts.initSelection === undefined) {
                            opts.initSelection = function (element, callback) {
                                var data = [];
                                $(splitVal(element.val(), opts.separator, opts.transformVal)).each(function () {
                                    var obj = { id: this, text: this },
Severity: Major
Found in data/public/select2-3.5.2/select2.js - About 45 mins to fix

    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            PmServiceInterface $pmService,
            NewConversationForm $newConversationForm,
            NewMessageForm $newMessageForm,
            DeleteConversationsForm $deleteConversationsForm,
            ModuleOptionsInterface $options,
    Severity: Minor
    Found in src/Eye4web/ZfcUser/Pm/Controller/PmController.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (equal(opts.id(token), opts.id(selection[i]))) {
                                  dupe = true; break;
                              }
      Severity: Major
      Found in data/public/select2-3.5.2/select2.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (opts.createSearchChoice === undefined) {
                                    opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
                                }
        Severity: Major
        Found in data/public/select2-3.5.2/select2.js - About 45 mins to fix

          Consider simplifying this complex logical expression.
          Open

                          if (selected.length &&
                              (e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) {
                              var selectedChoice = selected;
                              if (e.which == KEY.LEFT && prev.length) {
                                  selectedChoice = prev;
          Severity: Major
          Found in data/public/select2-3.5.2/select2.js - About 40 mins to fix

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

                public function addReceivers(ConversationInterface $conversation, array $receivers, ?UserInterface $author = null)
                {
                    $receivers = array_unique($receivers);
                    
                    $existingReceivers = $this->pmMapper->getReceiversByConversation($conversation);
            Severity: Minor
            Found in src/Eye4web/ZfcUser/Pm/Service/PmService.php - 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

            Avoid too many return statements within this function.
            Open

                                return null;
            Severity: Major
            Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return false;
              Severity: Major
              Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return this.opts.width();
                Severity: Major
                Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                          return;
                  Severity: Major
                  Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return;
                    Severity: Major
                    Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                              return;
                      Severity: Major
                      Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                                return;
                        Severity: Major
                        Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return $this->redirect()->toRoute('eye4web/zfc-user/pm/list');
                          Severity: Major
                          Found in src/Eye4web/ZfcUser/Pm/Controller/PmController.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return $this->redirect()->toRoute('eye4web/zfc-user/pm/read-conversation', ['conversationId' => $conversation->getId()]);
                            Severity: Major
                            Found in src/Eye4web/ZfcUser/Pm/Controller/PmController.php - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                      return;
                              Severity: Major
                              Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                        return;
                                Severity: Major
                                Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                      return;
                                  Severity: Major
                                  Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                            return (this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px');
                                    Severity: Major
                                    Found in data/public/select2-3.5.2/select2.js - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                              return $this->redirect()->toRoute('eye4web/zfc-user/pm/list');
                                      Severity: Major
                                      Found in src/Eye4web/ZfcUser/Pm/Controller/PmController.php - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language