krafthaus/bauhaus

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

Summary

Maintainability
F
1 wk
Test Coverage

File plugin.js has 938 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/paste/plugin.js - About 2 days to fix

    Function WordFilter has 271 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function WordFilter(editor) {
            var settings = editor.settings;
    
            editor.on('BeforePastePreProcess', function(e) {
                var content = e.content, retainStyleProperties, validStyles;
    Severity: Major
    Found in bower_components/tinymce/plugins/paste/plugin.js - About 1 day to fix

      Function registerEventHandlers has 131 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function registerEventHandlers() {
                  editor.on('keydown', function(e) {
                      function removePasteBinOnKeyUp(e) {
                          // Ctrl+V or Shift+Insert
                          if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
      Severity: Major
      Found in bower_components/tinymce/plugins/paste/plugin.js - About 5 hrs to fix

        Function convertFakeListsToProperLists has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function convertFakeListsToProperLists(node) {
                        var currentListNode, prevListNode, lastLevel = 1;
        
                        function getText(node) {
                            var txt = '';
        Severity: Major
        Found in bower_components/tinymce/plugins/paste/plugin.js - About 3 hrs to fix

          Function filterStyles has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function filterStyles(node, styleValue) {
                          var outputStyles = {}, matches, styles = editor.dom.parseStyle(styleValue);
          
                          Tools.each(styles, function(value, name) {
                              // Convert various MS styles to W3C styles
          Severity: Major
          Found in bower_components/tinymce/plugins/paste/plugin.js - About 2 hrs to fix

            Function createPasteBin has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function createPasteBin() {
                        var dom = editor.dom, body = editor.getBody();
                        var viewport = editor.dom.getViewPort(editor.getWin()), scrollTop = viewport.y, top = 20;
                        var scrollContainer;
            
            
            Severity: Minor
            Found in bower_components/tinymce/plugins/paste/plugin.js - About 1 hr to fix

              Function removeWebKitStyles has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function removeWebKitStyles(content) {
                          // Passthrough all styles from Word and let the WordFilter handle that junk
                          if (WordFilter.isWordContent(content)) {
                              return content;
                          }
              Severity: Minor
              Found in bower_components/tinymce/plugins/paste/plugin.js - About 1 hr to fix

                Function innerText has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function innerText(html) {
                        var schema = new Schema(), domParser = new DomParser({}, schema), text = '';
                        var shortEndedElements = schema.getShortEndedElements();
                        var ignoreElements = Tools.makeMap('script noscript style textarea video audio iframe object', ' ');
                        var blockElements = schema.getBlockElements();
                Severity: Minor
                Found in bower_components/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                  function convertParagraphToLi(paragraphNode, listName, start) {
                                      var level = paragraphNode._listLevel || lastLevel;
                  
                                      // Handle list nesting
                                      if (level != lastLevel) {
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                            function walk(node) {
                                var name = node.name, currentNode = node;
                    
                                if (name === 'br') {
                                    text += '\n';
                    Severity: Minor
                    Found in bower_components/tinymce/plugins/paste/plugin.js - About 1 hr to fix

                      Function pasteImageData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function pasteImageData(e, rng) {
                                  var dataTransfer = e.clipboardData || e.dataTransfer;
                      
                                  function processItems(items) {
                                      var i, item, reader;
                      Severity: Minor
                      Found in bower_components/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                            function expose(ids) {
                                for (var i = 0; i < ids.length; i++) {
                                    var target = exports;
                                    var id = ids[i];
                                    var fragments = id.split(/[.\/]/);
                        Severity: Major
                        Found in bower_components/tinymce/plugins/paste/plugin.js and 1 other location - About 7 hrs to fix
                        bower_components/tinymce/plugins/table/plugin.js on lines 65..81

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

                        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/paste/plugin.js and 2 other locations - About 4 hrs to fix
                        bower_components/tinymce/plugins/spellchecker/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/paste/plugin.js and 2 other locations - About 2 hrs to fix
                        bower_components/tinymce/plugins/spellchecker/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/paste/plugin.js and 2 other locations - About 2 hrs to fix
                        bower_components/tinymce/plugins/spellchecker/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 (!rule.attributes.style) {
                                                rule.attributes.style = {};
                                                rule.attributesOrder.push("style");
                                            }
                        Severity: Minor
                        Found in bower_components/tinymce/plugins/paste/plugin.js and 1 other location - About 40 mins to fix
                        bower_components/tinymce/plugins/legacyoutput/plugin.js on lines 90..93

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

                        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 (/(italic)/i.test(outputStyles["font-style"])) {
                                            delete outputStyles["font-style"];
                                            node.wrap(new Node("i", 1));
                                        }
                        Severity: Minor
                        Found in bower_components/tinymce/plugins/paste/plugin.js and 1 other location - About 40 mins to fix
                        bower_components/tinymce/plugins/paste/plugin.js on lines 1060..1063

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

                        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 (/(bold)/i.test(outputStyles["font-weight"])) {
                                            delete outputStyles["font-weight"];
                                            node.wrap(new Node("b", 1));
                                        }
                        Severity: Minor
                        Found in bower_components/tinymce/plugins/paste/plugin.js and 1 other location - About 40 mins to fix
                        bower_components/tinymce/plugins/paste/plugin.js on lines 1066..1069

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

                        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 (settings.paste_postprocess) {
                                    editor.on('PastePostProcess', function(e) {
                                        settings.paste_postprocess.call(self, self, e);
                                    });
                                }
                        Severity: Minor
                        Found in bower_components/tinymce/plugins/paste/plugin.js and 1 other location - About 35 mins to fix
                        bower_components/tinymce/plugins/paste/plugin.js on lines 1455..1459

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

                        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 (settings.paste_preprocess) {
                                    editor.on('PastePreProcess', function(e) {
                                        settings.paste_preprocess.call(self, self, e);
                                    });
                                }
                        Severity: Minor
                        Found in bower_components/tinymce/plugins/paste/plugin.js and 1 other location - About 35 mins to fix
                        bower_components/tinymce/plugins/paste/plugin.js on lines 1461..1465

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

                        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