kalenjordan/magehero

View on GitHub

Showing 125 of 125 total issues

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

    case 'loose_item_start': {
      var body = '';

      while (this.next().type !== 'list_item_end') {
        body += this.tok();
Severity: Major
Found in epiceditor/js/epiceditor.js and 1 other location - About 1 hr to fix
epiceditor/js/epiceditor.js on lines 2724..2734

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

          body += this.token.align[j]
            ? '<td align="' + this.token.align[j] + '">' + cell + '</td>\n'
            : '<td>' + cell + '</td>\n';
Severity: Major
Found in epiceditor/js/epiceditor.js and 1 other location - About 1 hr to fix
epiceditor/js/epiceditor.js on lines 2699..2701

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

    case 'blockquote_start': {
      var body = '';

      while (this.next().type !== 'blockquote_end') {
        body += this.tok();
Severity: Major
Found in epiceditor/js/epiceditor.js and 1 other location - About 1 hr to fix
epiceditor/js/epiceditor.js on lines 2764..2774

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

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

      target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
Severity: Major
Found in skin/js/src/lib/chosen.jquery.js and 1 other location - About 1 hr to fix
skin/js/src/lib/chosen.jquery.js on lines 912..912

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 60.

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

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

      target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
Severity: Major
Found in skin/js/src/lib/chosen.jquery.js and 1 other location - About 1 hr to fix
skin/js/src/lib/chosen.jquery.js on lines 922..922

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 60.

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 _exitFullscreen has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    self._exitFullscreen = function (el) {
      this._fixScrollbars();

      _saveStyleState(self.element, 'apply', _elementStates.element);
      _saveStyleState(self.iframeElement, 'apply', _elementStates.iframeElement);
Severity: Minor
Found in epiceditor/js/epiceditor.js - About 1 hr to fix

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

      EpicEditor.prototype.reflow = function (kind, callback) {
        var self = this
          , widthDiff = _outerWidth(self.element) - self.element.offsetWidth
          , heightDiff = _outerHeight(self.element) - self.element.offsetHeight
          , elements = [self.iframeElement, self.editorIframe, self.previewerIframe]
    Severity: Minor
    Found in epiceditor/js/epiceditor.js - About 1 hr to fix

      Function shortcutHandler has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function shortcutHandler(e) {
            if (e.keyCode == self.settings.shortcut.modifier) { isMod = true } // check for modifier press(default is alt key), save to var
            if (e.keyCode == 17) { isCtrl = true } // check for ctrl/cmnd press, in order to catch ctrl/cmnd + s
      
            // Check for alt+p and make sure were not in fullscreen - default shortcut to switch to preview
      Severity: Minor
      Found in epiceditor/js/epiceditor.js - About 1 hr to fix

        Method post has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function post($postId)
            {
                $imageUrl = isset($_POST['image_url']) ? $_POST['image_url'] : null;
        
                $subject  = isset($_POST['subject'])   ? $_POST['subject']   : null;
        Severity: Minor
        Found in code/Controller/PostEdit.php - About 1 hr to fix

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

                  _interval_set: function() {
                      
                      var self = this;
                      
                      self.checkInterval = setInterval(function() {
          Severity: Minor
          Found in skin/js/src/lib/jquery.tooltipster.js - About 1 hr to fix

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

                AbstractChosen.prototype.result_add_option = function(option) {
                  var classes, option_el;
                  if (!option.search_match) {
                    return '';
                  }
            Severity: Minor
            Found in skin/js/src/lib/chosen.jquery.js - About 1 hr to fix

              Method post has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function post()
                  {
                      $imageUrl = isset($_POST['image_url']) ? $_POST['image_url'] : null;
                      $subject  = isset($_POST['subject'])   ? $_POST['subject']   : null;
                      $body     = isset($_POST['body'])      ? $_POST['body']      : null;
              Severity: Minor
              Found in code/Controller/PostNew.php - About 1 hr to fix

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

                    if (nativeFsWebkit) {
                      document.addEventListener('webkitfullscreenchange', function () {
                        if (!document.webkitIsFullScreen && self._eeState.fullscreen) {
                          self._exitFullscreen(fsElement);
                        }
                Severity: Major
                Found in epiceditor/js/epiceditor.js and 1 other location - About 1 hr to fix
                epiceditor/js/epiceditor.js on lines 872..885

                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 58.

                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

                    else if (nativeFsMoz) {
                      document.addEventListener('mozfullscreenchange', function () {
                        if (!document.mozFullScreen && self._eeState.fullscreen) {
                          self._exitFullscreen(fsElement);
                        }
                Severity: Major
                Found in epiceditor/js/epiceditor.js and 1 other location - About 1 hr to fix
                epiceditor/js/epiceditor.js on lines 865..885

                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 58.

                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

                    Chosen.prototype.result_clear_highlight = function() {
                      if (this.result_highlight) {
                        this.result_highlight.removeClass("highlighted");
                      }
                      return this.result_highlight = null;
                Severity: Major
                Found in skin/js/src/lib/chosen.jquery.js and 1 other location - About 1 hr to fix
                skin/js/src/lib/chosen.jquery.js on lines 1152..1157

                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 57.

                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

                    Chosen.prototype.clear_backstroke = function() {
                      if (this.pending_backstroke) {
                        this.pending_backstroke.removeClass("search-choice-focus");
                      }
                      return this.pending_backstroke = null;
                Severity: Major
                Found in skin/js/src/lib/chosen.jquery.js and 1 other location - About 1 hr to fix
                skin/js/src/lib/chosen.jquery.js on lines 835..840

                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 57.

                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

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

                    public function post()
                    {
                        if (! isset($_POST['profile'])) {
                            throw new Exception("Missing profile data");
                        }
                Severity: Minor
                Found in code/Controller/Profile.php - About 1 hr to fix

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

                      protected function _getDevelopers()
                      {
                          $query = $this->_getContainer()->User()->selectAll();
                          $userRows = $this->_getContainer()->LocalConfig()->database()->fetchAll($query);
                          $users = array();
                  Severity: Minor
                  Found in code/Controller/MapUsers.php - About 1 hr to fix

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

                          else {
                            if (nativeFsWebkit) {
                              document.webkitCancelFullScreen();
                            }
                            else if (nativeFsMoz) {
                    Severity: Major
                    Found in epiceditor/js/epiceditor.js and 1 other location - About 1 hr to fix
                    epiceditor/js/epiceditor.js on lines 695..705

                    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

                          if (nativeFs) {
                            if (nativeFsWebkit) {
                              el.webkitRequestFullScreen();
                            }
                            else if (nativeFsMoz) {
                    Severity: Major
                    Found in epiceditor/js/epiceditor.js and 1 other location - About 1 hr to fix
                    epiceditor/js/epiceditor.js on lines 812..822

                    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