Eye4web/Eye4webZfcUserPm

View on GitHub

Showing 124 of 124 total issues

Function val has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        val: function (val, triggerChange) {
            var oldData, self=this;

            if (arguments.length === 0) {
                return this.getVal();
Severity: Minor
Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

    Function monitorSource has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            monitorSource: function () {
                var el = this.opts.element, observer, self = this;
    
                el.on("change.select2", this.bind(function (e) {
                    if (this.opts.element.data("select2-change-triggered") !== true) {
    Severity: Minor
    Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

      Method readConversationAction has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function readConversationAction()
          {
              if (!$this->zfcUserAuthentication()->hasIdentity()) {
                  return $this->redirect()->toRoute($this->zfcUserOptions->getLoginRedirectRoute());
              }
      Severity: Minor
      Found in src/Eye4web/ZfcUser/Pm/Controller/PmController.php - About 1 hr to fix

        Function loadMoreIfNeeded has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                loadMoreIfNeeded: function () {
                    var results = this.results,
                        more = results.find("li.select2-more-results"),
                        below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
                        page = this.resultsPage + 1,
        Severity: Minor
        Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

          Function initContainerWidth has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  initContainerWidth: function () {
                      function resolveContainerWidth() {
                          var style, attrs, matches, i, l, attr;
          
                          if (this.opts.width === "off") {
          Severity: Minor
          Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    enableInterface: function() {
                        if (this.parent.enableInterface.apply(this, arguments)) {
                            this.search.prop("disabled", !this.isInterfaceEnabled());
                        }
                    },
            Severity: Major
            Found in data/public/select2-3.5.2/select2.js and 1 other location - About 1 hr to fix
            data/public/select2-3.5.2/select2.js on lines 1981..1985

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 61.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    enableInterface: function() {
                        if (this.parent.enableInterface.apply(this, arguments)) {
                            this.focusser.prop("disabled", !this.isInterfaceEnabled());
                        }
                    },
            Severity: Major
            Found in data/public/select2-3.5.2/select2.js and 1 other location - About 1 hr to fix
            data/public/select2-3.5.2/select2.js on lines 2866..2870

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 61.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function onSelect has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    onSelect: function (data, options) {
            
                        if (!this.triggerSelect(data) || data.text === "") { return; }
            
                        this.addSelectedChoice(data);
            Severity: Minor
            Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

              Method indexAction has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function indexAction()
                  {
                      if (!$this->zfcUserAuthentication()->hasIdentity()) {
                          return $this->redirect()->toRoute($this->zfcUserOptions->getLoginRedirectRoute());
                      }
              Severity: Minor
              Found in src/Eye4web/ZfcUser/Pm/Controller/PmController.php - About 1 hr to fix

                Function defaultTokenizer has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function defaultTokenizer(input, selection, selectCallback, opts) {
                        var original = input, // store the original so we can compare and know if we need to tell the search to update its text
                            dupe = false, // check for whether a token we extracted represents a duplicate selected choice
                            token, // token
                            index, // position at which the separator was found
                Severity: Minor
                Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

                  Function opening has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          opening: function () {
                              var el, range, len;
                  
                              if (this.opts.minimumResultsForSearch >= 0) {
                                  this.showSearch(true);
                  Severity: Minor
                  Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

                    Function initSelection has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    opts.initSelection = opts.initSelection || function (element, callback) {
                                        var ids = splitVal(element.val(), opts.separator, opts.transformVal);
                                        //search in data by array of ids, storing matching items in a list
                                        var matches = [];
                                        opts.query({
                    Severity: Minor
                    Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

                      Method getUserReceives has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getUserReceives($userId)
                          {
                              $queryBuilder = $this->objectManager->createQueryBuilder();
                              $queryBuilder->select('r')
                                  ->from($this->options->getConversationReceiverEntity(), 'r')
                      Severity: Minor
                      Found in src/Eye4web/ZfcUser/Pm/Mapper/DoctrineORM/PmMapper.php - About 1 hr to fix

                        Function unselect has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                unselect: function (selected) {
                                    var val = this.getVal(),
                                        data,
                                        index;
                                    selected = selected.closest(".select2-search-choice");
                        Severity: Minor
                        Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

                          Function resolveContainerWidth has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      function resolveContainerWidth() {
                                          var style, attrs, matches, i, l, attr;
                          
                                          if (this.opts.width === "off") {
                                              return null;
                          Severity: Minor
                          Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

                            Method newMessage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function newMessage(ConversationInterface $conversation, $messageText, UserInterface $user)
                                {
                                    $this->getEventManager()->trigger(
                                        'newMessage.pre',
                                        $this,
                            Severity: Minor
                            Found in src/Eye4web/ZfcUser/Pm/Service/PmService.php - About 1 hr to fix

                              Function postprocessResults has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      postprocessResults: function (data, initial, noHighlightUpdate) {
                                          var val = this.getVal(),
                                              choices = this.results.find(".select2-result"),
                                              compound = this.results.find(".select2-result-with-children"),
                                              self = this;
                              Severity: Minor
                              Found in data/public/select2-3.5.2/select2.js - About 1 hr to fix

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        formatInputTooShort: function (input, min) {
                                            var n = min - input.length;
                                            if (n === 1) {
                                                return "Engada un carácter";
                                            } else {
                                Severity: Major
                                Found in data/public/select2-3.5.2/select2_locale_gl.js and 1 other location - About 1 hr to fix
                                data/public/select2-3.5.2/select2_locale_eu.js on lines 13..20

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 56.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        formatInputTooLong: function (input, max) {
                                          var n = input.length - max;
                                          if (n === 1) {
                                            return "Idatzi karaktere bat gutxiago";
                                          } else {
                                Severity: Major
                                Found in data/public/select2-3.5.2/select2_locale_eu.js and 1 other location - About 1 hr to fix
                                data/public/select2-3.5.2/select2_locale_gl.js on lines 21..28

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 56.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        formatInputTooLong: function (input, max) {
                                            var n = input.length - max;
                                            if (n === 1) {
                                                return "Elimine un carácter";
                                            } else {
                                Severity: Major
                                Found in data/public/select2-3.5.2/select2_locale_gl.js and 1 other location - About 1 hr to fix
                                data/public/select2-3.5.2/select2_locale_eu.js on lines 21..28

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 56.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Severity
                                Category
                                Status
                                Source
                                Language