WordPress/WordPress

View on GitHub
wp-includes/js/tinymce/plugins/paste/plugin.js

Summary

Maintainability
F
1 mo
Test Coverage

Function paste has 2316 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var paste = (function (domGlobals) {
    'use strict';

    var Cell = function (initial) {
      var value = initial;
Severity: Major
Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 wk to fix

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

    (function () {
    var paste = (function (domGlobals) {
        'use strict';
    
        var Cell = function (initial) {
    Severity: Major
    Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 6 days to fix

      Function 2 has 194 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  function (require, module, exports) {
                    (function (setImmediate) {
                      (function (root) {
                        var setTimeoutFunc = setTimeout;
                        function noop() {
      Severity: Major
      Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 7 hrs to fix

        Function 1 has 156 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function (require, module, exports) {
                      var process = module.exports = {};
                      var cachedSetTimeout;
                      var cachedClearTimeout;
                      function defaultSetTimout() {
        Severity: Major
        Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 6 hrs to fix

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

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

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

                var registerEventHandlers = function (editor, pasteBin, pasteFormat) {
                  var keyboardPasteEvent = value();
                  var keyboardPastePlainTextState;
                  editor.on('keydown', function (e) {
                    function removePasteBinOnKeyUp(e) {
            Severity: Major
            Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 4 hrs to fix

              Function filterWordContent has 104 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var filterWordContent = function (editor, content) {
                    var retainStyleProperties, validStyles;
                    retainStyleProperties = Settings.getRetainStyleProps(editor);
                    if (retainStyleProperties) {
                      validStyles = global$4.makeMap(retainStyleProperties.split(/[, ]/));
              Severity: Major
              Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 4 hrs to fix

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

                    function filterStyles(editor, validStyles, node, styleValue) {
                      var outputStyles = {}, matches;
                      var styles = editor.dom.parseStyle(styleValue);
                      global$4.each(styles, function (value, name) {
                        switch (name) {
                Severity: Major
                Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 2 hrs to fix

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

                              function (require, module, exports) {
                                (function (setImmediate, clearImmediate) {
                                  var nextTick = require('process/browser.js').nextTick;
                                  var apply = Function.prototype.apply;
                                  var slice = Array.prototype.slice;
                  Severity: Major
                  Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 2 hrs to fix

                    Function setup has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var setup = function (editor, clipboard, draggingInternallyState) {
                          if (Settings.shouldBlockDrop(editor)) {
                            editor.on('dragend dragover draggesture dragdrop drop drag', function (e) {
                              e.preventDefault();
                              e.stopPropagation();
                    Severity: Major
                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 2 hrs to fix

                      Function some has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var some = function (a) {
                            var constant_a = constant(a);
                            var self = function () {
                              return me;
                            };
                      Severity: Major
                      Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 2 hrs to fix

                        Function make has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var make = function (run) {
                              var get = function (callback) {
                                run().then(callback, errorReporter);
                              };
                              var map = function (fab) {
                        Severity: Minor
                        Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                              function innerText(html) {
                                var schema = global$a();
                                var domParser = global$7({}, schema);
                                var text = '';
                                var shortEndedElements = schema.getShortEndedElements();
                          Severity: Minor
                          Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                function removeWebKitStyles(editor, content, internal, isWordHtml) {
                                  if (isWordHtml || internal) {
                                    return content;
                                  }
                                  var webKitStylesSetting = Settings.getWebkitStyles(editor);
                            Severity: Minor
                            Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                  var NONE = function () {
                                    var eq = function (o) {
                                      return o.isNone();
                                    };
                                    var call = function (thunk) {
                              Severity: Minor
                              Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                    var nu = function (baseFn) {
                                      var data = Option.none();
                                      var callbacks = [];
                                      var map = function (f) {
                                        return nu(function (nCallback) {
                                Severity: Minor
                                Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

                                  Function insertClipboardContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        function insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal) {
                                          var content, isPlainTextHtml;
                                          if (hasContentType(clipboardContent, 'text/html')) {
                                            content = clipboardContent['text/html'];
                                          } else {
                                  Severity: Minor
                                  Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                        var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) {
                                          registerEventHandlers(editor, pasteBin, pasteFormat);
                                          var src;
                                          editor.parser.addNodeFilter('img', function (nodes, name, args) {
                                            var isPasteInsert = function (args) {
                                    Severity: Minor
                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                            function walk(node) {
                                              var name = node.name, currentNode = node;
                                              if (name === 'br') {
                                                text += '\n';
                                                return;
                                      Severity: Minor
                                      Found in wp-includes/js/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;
                                                if (level !== lastLevel) {
                                                  if (level < lastLevel) {
                                                    if (currentListNode) {
                                        Severity: Minor
                                        Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                                            Promise.all = function (arr) {
                                                              var args = Array.prototype.slice.call(arr);
                                                              return new Promise(function (resolve, reject) {
                                                                if (args.length === 0)
                                                                  return resolve([]);
                                          Severity: Minor
                                          Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                                function removeExplorerBrElementsAfterBlocks(editor, html) {
                                                  if (!WordFilter.isWordContent(html)) {
                                                    return html;
                                                  }
                                                  var blockElements = [];
                                            Severity: Minor
                                            Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

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

                                                  var fallback = function (editor) {
                                                    return function (html, done) {
                                                      var markedHtml = InternalHtml.mark(html);
                                                      var outer = editor.dom.create('div', {
                                                        'contenteditable': 'false',
                                              Severity: Minor
                                              Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 1 hr to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                                    return cachedClearTimeout.call(this, marker);
                                                Severity: Major
                                                Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                                      return cachedSetTimeout.call(this, fun, 0);
                                                  Severity: Major
                                                  Found in wp-includes/js/tinymce/plugins/paste/plugin.js - About 30 mins to fix

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

                                                        var some = function (a) {
                                                          var constant_a = constant(a);
                                                          var self = function () {
                                                            return me;
                                                          };
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 4 other locations - About 1 day to fix
                                                    wp-includes/js/tinymce/plugins/lists/plugin.js on lines 273..325
                                                    wp-includes/js/tinymce/plugins/media/plugin.js on lines 125..177
                                                    wp-includes/js/tinymce/themes/inlite/theme.js on lines 610..662
                                                    wp-includes/js/tinymce/themes/modern/theme.js on lines 209..261

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

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

                                                        var NONE = function () {
                                                          var eq = function (o) {
                                                            return o.isNone();
                                                          };
                                                          var call = function (thunk) {
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 4 other locations - About 1 day to fix
                                                    wp-includes/js/tinymce/plugins/lists/plugin.js on lines 229..272
                                                    wp-includes/js/tinymce/plugins/media/plugin.js on lines 81..124
                                                    wp-includes/js/tinymce/themes/inlite/theme.js on lines 566..609
                                                    wp-includes/js/tinymce/themes/modern/theme.js on lines 165..208

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

                                                    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

                                                        function curry(fn) {
                                                          var initialArgs = [];
                                                          for (var _i = 1; _i < arguments.length; _i++) {
                                                            initialArgs[_i - 1] = arguments[_i];
                                                          }
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 1 other location - About 5 hrs to fix
                                                    wp-includes/js/tinymce/plugins/image/plugin.js on lines 1066..1079

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

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

                                                        var typeOf = function (x) {
                                                          if (x === null) {
                                                            return 'null';
                                                          }
                                                          var t = typeof x;
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 3 other locations - About 5 hrs to fix
                                                    wp-includes/js/tinymce/plugins/lists/plugin.js on lines 335..347
                                                    wp-includes/js/tinymce/themes/inlite/theme.js on lines 672..684
                                                    wp-includes/js/tinymce/themes/modern/theme.js on lines 645..657

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

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

                                                        var Cell = function (initial) {
                                                          var value = initial;
                                                          var get = function () {
                                                            return value;
                                                          };
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 3 other locations - About 3 hrs to fix
                                                    wp-includes/js/tinymce/plugins/fullscreen/plugin.js on lines 5..21
                                                    wp-includes/js/tinymce/plugins/lists/plugin.js on lines 1338..1354
                                                    wp-includes/js/tinymce/plugins/media/plugin.js on lines 50..66

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

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

                                                        var filter$1 = function (xs, pred) {
                                                          var r = [];
                                                          for (var i = 0, len = xs.length; i < len; i++) {
                                                            var x = xs[i];
                                                            if (pred(x, i)) {
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 3 other locations - About 2 hrs to fix
                                                    wp-includes/js/tinymce/plugins/lists/plugin.js on lines 376..385
                                                    wp-includes/js/tinymce/themes/inlite/theme.js on lines 728..737
                                                    wp-includes/js/tinymce/themes/modern/theme.js on lines 701..710

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

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

                                                        var map = function (xs, f) {
                                                          var len = xs.length;
                                                          var r = new Array(len);
                                                          for (var i = 0; i < len; i++) {
                                                            var x = xs[i];
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 3 other locations - About 2 hrs to fix
                                                    wp-includes/js/tinymce/plugins/lists/plugin.js on lines 361..369
                                                    wp-includes/js/tinymce/themes/inlite/theme.js on lines 713..721
                                                    wp-includes/js/tinymce/themes/modern/theme.js on lines 686..694

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

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

                                                        var each = function (xs, f) {
                                                          for (var i = 0, len = xs.length; i < len; i++) {
                                                            var x = xs[i];
                                                            f(x, i);
                                                          }
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 3 other locations - About 1 hr to fix
                                                    wp-includes/js/tinymce/plugins/lists/plugin.js on lines 370..375
                                                    wp-includes/js/tinymce/themes/inlite/theme.js on lines 722..727
                                                    wp-includes/js/tinymce/themes/modern/theme.js on lines 695..700

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

                                                    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

                                                              readBlobsAsDataUris(images).get(function (blobResults) {
                                                                if (rng) {
                                                                  editor.selection.setRng(rng);
                                                                }
                                                                each(blobResults, function (result) {
                                                    Severity: Major
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 1 other location - About 1 hr to fix
                                                    wp-includes/js/tinymce/plugins/paste/plugin.js on lines 700..704

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

                                                    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

                                                                    try {
                                                                      if (typeof clearTimeout === 'function') {
                                                                        cachedClearTimeout = clearTimeout;
                                                                      } else {
                                                                        cachedClearTimeout = defaultClearTimeout;
                                                    Severity: Minor
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 1 other location - About 50 mins to fix
                                                    wp-includes/js/tinymce/plugins/paste/plugin.js on lines 1007..1015

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

                                                    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

                                                                    try {
                                                                      if (typeof setTimeout === 'function') {
                                                                        cachedSetTimeout = setTimeout;
                                                                      } else {
                                                                        cachedSetTimeout = defaultSetTimout;
                                                    Severity: Minor
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 1 other location - About 50 mins to fix
                                                    wp-includes/js/tinymce/plugins/paste/plugin.js on lines 1016..1024

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

                                                    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.class) {
                                                              rule.attributes.class = {};
                                                              rule.attributesOrder.push('class');
                                                            }
                                                    Severity: Minor
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 1 other location - About 40 mins to fix
                                                    wp-includes/js/tinymce/plugins/paste/plugin.js on lines 589..592

                                                    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

                                                        var process = function (editor, html, internal) {
                                                          var isWordHtml = WordFilter.isWordContent(html);
                                                          var content = isWordHtml ? WordFilter.preProcess(editor, html) : html;
                                                          return filterContent(editor, content, internal, isWordHtml);
                                                        };
                                                    Severity: Minor
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 1 other location - About 40 mins to fix
                                                    wp-includes/js/tinymce/plugins/paste/plugin.js on lines 1735..1742

                                                    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 (!rule.attributes.style) {
                                                              rule.attributes.style = {};
                                                              rule.attributesOrder.push('style');
                                                            }
                                                    Severity: Minor
                                                    Found in wp-includes/js/tinymce/plugins/paste/plugin.js and 1 other location - About 40 mins to fix
                                                    wp-includes/js/tinymce/plugins/paste/plugin.js on lines 585..588

                                                    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

                                                    There are no issues that match your filters.

                                                    Category
                                                    Status