krafthaus/bauhaus

View on GitHub
bower_components/tinymce/plugins/spellchecker/plugin.js

Summary

Maintainability
F
1 wk
Test Coverage

File plugin.js has 656 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Compiled inline version. (Library mode)
 */

/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
Severity: Major
Found in bower_components/tinymce/plugins/spellchecker/plugin.js - About 1 day to fix

    Function stepThroughMatches has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function stepThroughMatches(node, matches, replaceFn) {
                var startNode, endNode, startNodeIndex,
                    endNodeIndex, innerNodes = [], atIndex = 0, curNode = node,
                    matchLocation, matchIndex = 0;
    
    
    Severity: Major
    Found in bower_components/tinymce/plugins/spellchecker/plugin.js - About 2 hrs to fix

      Function genReplacer has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function genReplacer(callback) {
                  function makeReplacementNode(fill, matchIndex) {
                      var match = matches[matchIndex];
      
                      if (!match.stencil) {
      Severity: Major
      Found in bower_components/tinymce/plugins/spellchecker/plugin.js - About 2 hrs to fix

        Function showSuggestions has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function showSuggestions(word, spans) {
                    var items = [], suggestions = lastSuggestions[word];
        
                    Tools.each(suggestions, function(suggestion) {
                        items.push({
        Severity: Major
        Found in bower_components/tinymce/plugins/spellchecker/plugin.js - About 2 hrs to fix

          Function spellcheck has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function spellcheck() {
                      if (started) {
                          finish();
                          return;
                      } else {
          Severity: Minor
          Found in bower_components/tinymce/plugins/spellchecker/plugin.js - About 1 hr to fix

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

                    function defaultSpellcheckCallback(method, text, doneCallback, errorCallback) {
                        var data = {method: method}, postData = '';
            
                        if (method == "spellcheck") {
                            data.text = text;
            Severity: Minor
            Found in bower_components/tinymce/plugins/spellchecker/plugin.js - About 1 hr to fix

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

                              if (startNode === endNode) {
                                  var node = startNode;
              
                                  parentNode = node.parentNode;
                                  if (range.startNodeIndex > 0) {
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 1 day to fix
              bower_components/tinymce/plugins/searchreplace/plugin.js on lines 184..233

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

              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

                      function findSpansByIndex(index) {
                          var nodes, spans = [];
              
                          nodes = Tools.toArray(editor.getBody().getElementsByTagName('span'));
                          if (nodes.length) {
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 6 hrs to fix
              bower_components/tinymce/plugins/searchreplace/plugin.js on lines 421..440

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

              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

                      function getText(node) {
                          var txt;
              
                          if (node.nodeType === 3) {
                              return node.data;
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 5 hrs to fix
              bower_components/tinymce/plugins/searchreplace/plugin.js on lines 52..76

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

              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 3 locations. Consider refactoring.
              Open

                  function require(ids, callback) {
                      var module, defs = [];
              
                      for (var i = 0; i < ids.length; ++i) {
                          module = modules[ids[i]] || resolve(ids[i]);
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 2 other locations - About 4 hrs to fix
              bower_components/tinymce/plugins/paste/plugin.js on lines 13..26
              bower_components/tinymce/plugins/table/plugin.js on lines 13..26

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

              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 3 locations. Consider refactoring.
              Open

                  function resolve(id) {
                      var target = exports;
                      var fragments = id.split(/[.\/]/);
              
                      for (var fi = 0; fi < fragments.length; ++fi) {
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 2 other locations - About 2 hrs to fix
              bower_components/tinymce/plugins/paste/plugin.js on lines 50..63
              bower_components/tinymce/plugins/table/plugin.js on lines 50..63

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

              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 3 locations. Consider refactoring.
              Open

                  function define(id, dependencies, definition) {
                      if (typeof id !== 'string') {
                          throw 'invalid module definition, module id must be defined and be a string';
                      }
              
              
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 2 other locations - About 2 hrs to fix
              bower_components/tinymce/plugins/paste/plugin.js on lines 28..44
              bower_components/tinymce/plugins/table/plugin.js on lines 28..44

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

              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 (startNode && endNode) {
                                  curNode = replaceFn({
                                      startNode: startNode,
                                      startNodeIndex: startNodeIndex,
                                      endNode: endNode,
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 2 hrs to fix
              bower_components/tinymce/plugins/searchreplace/plugin.js on lines 107..139

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

              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

                              while (true) {
                                  if (curNode.nextSibling) {
                                      curNode = curNode.nextSibling;
                                      break;
                                  } else if (curNode.parentNode !== node) {
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 1 hr to fix
              bower_components/tinymce/plugins/searchreplace/plugin.js on lines 142..151

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

              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 (range.endNodeIndex < node.length) {
                                      // Add "after" text node (after the match)
                                      after = doc.createTextNode(node.data.substring(range.endNodeIndex));
                                      parentNode.insertBefore(after, node);
                                  }
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 1 hr to fix
              bower_components/tinymce/plugins/searchreplace/plugin.js on lines 197..201

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

              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 (range.startNodeIndex > 0) {
                                      // Add "before" text node (before the match)
                                      before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));
                                      parentNode.insertBefore(before, node);
                                  }
              Severity: Major
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 1 hr to fix
              bower_components/tinymce/plugins/searchreplace/plugin.js on lines 188..192

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

              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

                          e.control.items().each(function(ctrl) {
                              ctrl.active(ctrl.settings.data === selectedLanguage);
                          });
              Severity: Minor
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 50 mins to fix
              bower_components/tinymce/plugins/advlist/plugin.js on lines 65..67

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

              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

                      function getElmIndex(elm) {
                          var value = elm.getAttribute('data-mce-index');
              
                          if (typeof(value) == "number") {
                              return "" + value;
              Severity: Minor
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 35 mins to fix
              bower_components/tinymce/plugins/searchreplace/plugin.js on lines 386..394

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

              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

                          onPostRender: function() {
                              var self = this;
              
                              editor.on('SpellcheckStart SpellcheckEnd', function() {
                                  self.active(started);
              Severity: Minor
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 30 mins to fix
              bower_components/tinymce/plugins/spellchecker/plugin.js on lines 942..948

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

              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

                          onPostRender: function() {
                              var self = this;
              
                              editor.on('SpellcheckStart SpellcheckEnd', function() {
                                  self.active(started);
              Severity: Minor
              Found in bower_components/tinymce/plugins/spellchecker/plugin.js and 1 other location - About 30 mins to fix
              bower_components/tinymce/plugins/spellchecker/plugin.js on lines 922..928

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

              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

              There are no issues that match your filters.

              Category
              Status