krafthaus/bauhaus

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

Summary

Maintainability
F
1 wk
Test Coverage

Function Plugin has 265 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function Plugin(editor) {
        var self = this, currentIndex = -1;

        function showDialog() {
            var last = {};
Severity: Major
Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 1 day to fix

    Function findAndReplaceDOMText has 174 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function findAndReplaceDOMText(regex, node, replacementNode, captureGroup, schema) {
            var m, matches = [], text, count = 0, doc;
            var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
    
            doc = node.ownerDocument;
    Severity: Major
    Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 6 hrs to fix

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

      /**
       * plugin.js
       *
       * Copyright, Moxiecode Systems AB
       * Released under LGPL License.
      Severity: Minor
      Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 6 hrs to fix

        Function showDialog has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function showDialog() {
                    var last = {};
        
                    function updateButtonStates() {
                        win.statusbar.find('#next').disabled(!findSpansByIndex(currentIndex + 1).length);
        Severity: Major
        Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 3 hrs to fix

          Function stepThroughMatches has 57 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 = matches.shift(), matchIndex = 0;
          
          
          Severity: Major
          Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 2 hrs to fix

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

                    function genReplacer(nodeName) {
                        var makeReplacementNode;
            
                        if (typeof nodeName != 'function') {
                            var stencilNode = nodeName.nodeType ? nodeName : doc.createElement(nodeName);
            Severity: Major
            Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 2 hrs to fix

              Function replace has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      self.replace = function(text, forward, all) {
                          var i, nodes, node, matchIndex, currentMatchIndex, nextIndex = currentIndex, hasMore;
              
                          forward = forward !== false;
              
              
              Severity: Minor
              Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 1 hr to fix

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

                                onSubmit: function(e) {
                                    var count, caseState, text, wholeWord;
                
                                    e.preventDefault();
                
                
                Severity: Minor
                Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 1 hr to fix

                  Function findAndReplaceDOMText has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      function findAndReplaceDOMText(regex, node, replacementNode, captureGroup, schema) {
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/searchreplace/plugin.js - About 35 mins 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/searchreplace/plugin.js and 1 other location - About 1 day to fix
                    bower_components/tinymce/plugins/spellchecker/plugin.js on lines 266..315

                    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 = tinymce.toArray(editor.getBody().getElementsByTagName('span'));
                                if (nodes.length) {
                    Severity: Major
                    Found in bower_components/tinymce/plugins/searchreplace/plugin.js and 1 other location - About 6 hrs to fix
                    bower_components/tinymce/plugins/spellchecker/plugin.js on lines 878..897

                    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/searchreplace/plugin.js and 1 other location - About 5 hrs to fix
                    bower_components/tinymce/plugins/spellchecker/plugin.js on lines 129..153

                    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

                    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/searchreplace/plugin.js and 1 other location - About 2 hrs to fix
                    bower_components/tinymce/plugins/spellchecker/plugin.js on lines 191..223

                    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/searchreplace/plugin.js and 1 other location - About 1 hr to fix
                    bower_components/tinymce/plugins/spellchecker/plugin.js on lines 226..235

                    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/searchreplace/plugin.js and 1 other location - About 1 hr to fix
                    bower_components/tinymce/plugins/spellchecker/plugin.js on lines 279..283

                    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/searchreplace/plugin.js and 1 other location - About 1 hr to fix
                    bower_components/tinymce/plugins/spellchecker/plugin.js on lines 270..274

                    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

                            self.prev = function() {
                                var index = moveSelection(false);
                    
                                if (index !== -1) {
                                    currentIndex = index;
                    Severity: Minor
                    Found in bower_components/tinymce/plugins/searchreplace/plugin.js and 1 other location - About 35 mins to fix
                    bower_components/tinymce/plugins/searchreplace/plugin.js on lines 483..489

                    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

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

                            self.next = function() {
                                var index = moveSelection(true);
                    
                                if (index !== -1) {
                                    currentIndex = index;
                    Severity: Minor
                    Found in bower_components/tinymce/plugins/searchreplace/plugin.js and 1 other location - About 35 mins to fix
                    bower_components/tinymce/plugins/searchreplace/plugin.js on lines 491..497

                    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

                    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/searchreplace/plugin.js and 1 other location - About 35 mins to fix
                    bower_components/tinymce/plugins/spellchecker/plugin.js on lines 868..876

                    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

                    There are no issues that match your filters.

                    Category
                    Status