WordPress/WordPress

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

Summary

Maintainability
F
1 mo
Test Coverage

Function lists has 2057 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    var global = tinymce.util.Tools.resolve('tinymce.PluginManager');

Severity: Major
Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 wk to fix

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

    (function () {
    var lists = (function (domGlobals) {
        'use strict';
    
        var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
    Severity: Major
    Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 5 days 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/lists/plugin.js - About 2 hrs to fix

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

            var createTextBlock = function (editor, contentNode) {
              var dom = editor.dom;
              var blockElements = editor.schema.getBlockElements();
              var fragment = dom.createFragment();
              var node, textBlock, blockName, hasContentNode;
        Severity: Minor
        Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

          Function applyList has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var applyList = function (editor, listName, detail) {
                if (detail === void 0) {
                  detail = {};
                }
                var rng = editor.selection.getRng(true);
          Severity: Minor
          Found in wp-includes/js/tinymce/plugins/lists/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/lists/plugin.js - About 1 hr to fix

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

                  var getSelectedTextBlocks = function (editor, rng, root) {
                    var textBlocks = [], dom = editor.dom;
                    var startNode = getEndPointNode(editor, rng, true, root);
                    var endNode = getEndPointNode(editor, rng, false, root);
                    var block;
              Severity: Minor
              Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

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

                    var resolveBookmark = function (bookmark) {
                      function restoreEndPoint(start) {
                        var container, offset, node;
                        var nodeIndex = function (container) {
                          var node = container.parentNode.firstChild, idx = 0;
                Severity: Minor
                Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

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

                      var mergeLiElements = function (dom, fromElm, toElm) {
                        var node, listNode;
                        var ul = fromElm.parentNode;
                        if (!NodeType.isChildOfBody(dom, fromElm) || !NodeType.isChildOfBody(dom, toElm)) {
                          return;
                  Severity: Minor
                  Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

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

                        var splitList = function (editor, ul, li) {
                          var tmpRng, fragment, bookmarks, node, newBlock;
                          var removeAndKeepBookmarks = function (targetNode) {
                            global$5.each(bookmarks, function (node) {
                              targetNode.parentNode.insertBefore(node, li.parentNode);
                    Severity: Minor
                    Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

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

                            function restoreEndPoint(start) {
                              var container, offset, node;
                              var nodeIndex = function (container) {
                                var node = container.parentNode.firstChild, idx = 0;
                                while (node) {
                      Severity: Minor
                      Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

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

                            var createBookmark = function (rng) {
                              var bookmark = {};
                              var setupEndPoint = function (start) {
                                var offsetNode, container, offset;
                                container = rng[start ? 'startContainer' : 'endContainer'];
                        Severity: Minor
                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

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

                              var backspaceDeleteFromListToListCaret = function (editor, isForward) {
                                var dom = editor.dom, selection = editor.selection;
                                var selectionStartElm = selection.getStart();
                                var root = Selection.getClosestListRootElm(editor, selectionStartElm);
                                var li = dom.getParent(selection.getStart(), 'LI', root);
                          Severity: Minor
                          Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

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

                                var getNormalizedPoint = function (container, offset) {
                                  if (NodeType.isTextNode(container)) {
                                    return {
                                      container: container,
                                      offset: offset
                            Severity: Minor
                            Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

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

                                  var findNextCaretContainer = function (editor, rng, isForward, root) {
                                    var node = rng.startContainer;
                                    var offset = rng.startOffset;
                                    var nonEmptyBlocks, walker;
                                    if (node.nodeType === 3 && (isForward ? offset < node.data.length : offset > 0)) {
                              Severity: Minor
                              Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 1 hr to fix

                                Avoid deeply nested control flow statements.
                                Open

                                              if (!textBlock) {
                                                textBlock = dom.create(blockName);
                                                fragment.appendChild(textBlock);
                                              }
                                Severity: Major
                                Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 45 mins to fix

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

                                      var toggleMultipleLists = function (editor, parentList, lists, listName, detail) {
                                  Severity: Minor
                                  Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 35 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          return {
                                            container: container,
                                            offset: offset
                                          };
                                    Severity: Major
                                    Found in wp-includes/js/tinymce/plugins/lists/plugin.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                return elem.mozMatchesSelector(selector);
                                      Severity: Major
                                      Found in wp-includes/js/tinymce/plugins/lists/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/lists/plugin.js and 4 other locations - About 1 day to fix
                                        wp-includes/js/tinymce/plugins/media/plugin.js on lines 125..177
                                        wp-includes/js/tinymce/plugins/paste/plugin.js on lines 835..887
                                        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 3 locations. Consider refactoring.
                                        Open

                                            var DeviceType = function (os, browser, userAgent) {
                                              var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
                                              var isiPhone = os.isiOS() && !isiPad;
                                              var isAndroid3 = os.isAndroid() && os.version.major === 3;
                                              var isAndroid4 = os.isAndroid() && os.version.major === 4;
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 day to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6413..6432
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6264..6283

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

                                        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/lists/plugin.js and 4 other locations - About 1 day to fix
                                        wp-includes/js/tinymce/plugins/media/plugin.js on lines 81..124
                                        wp-includes/js/tinymce/plugins/paste/plugin.js on lines 791..834
                                        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

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

                                            var browsers = [
                                              {
                                                name: 'Edge',
                                                versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
                                                search: function (uastring) {
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 day to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6473..6524
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6324..6375

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

                                        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 setupEndPoint = function (start) {
                                                var offsetNode, container, offset;
                                                container = rng[start ? 'startContainer' : 'endContainer'];
                                                offset = rng[start ? 'startOffset' : 'endOffset'];
                                                if (container.nodeType === 1) {
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 1 other location - About 1 day to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 4278..4299

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

                                        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

                                            var Immutable = function () {
                                              var fields = [];
                                              for (var _i = 0; _i < arguments.length; _i++) {
                                                fields[_i] = arguments[_i];
                                              }
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 day to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6243..6262
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6094..6113

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

                                        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

                                            var baseMerge = function (merger) {
                                              return function () {
                                                var objects = new Array(arguments.length);
                                                for (var i = 0; i < objects.length; i++) {
                                                  objects[i] = arguments[i];
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 1 other location - About 1 day to fix
                                        wp-includes/js/tinymce/plugins/image/plugin.js on lines 257..277

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

                                        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

                                            var oses = [
                                              {
                                                name: 'Windows',
                                                search: checkContains('win'),
                                                versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 7 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6525..6567
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6376..6418

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

                                        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/lists/plugin.js and 3 other locations - About 5 hrs to fix
                                        wp-includes/js/tinymce/plugins/paste/plugin.js on lines 897..909
                                        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 3 locations. Consider refactoring.
                                        Open

                                            var detect$2 = function (userAgent) {
                                              var browsers = PlatformInfo.browsers();
                                              var oses = PlatformInfo.oses();
                                              var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu);
                                              var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 5 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6573..6584
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6424..6435

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

                                        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

                                            var fromHtml = function (html, scope) {
                                              var doc = scope || domGlobals.document;
                                              var div = doc.createElement('div');
                                              div.innerHTML = html;
                                              if (!div.hasChildNodes() || div.childNodes.length > 1) {
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 4 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6176..6185
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6001..6010

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

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

                                            var nu$2 = function (info) {
                                              var current = info.current;
                                              var version = info.version;
                                              return {
                                                current: current,
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 4 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6386..6400
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6237..6251

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

                                        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

                                            var cached = function (f) {
                                              var called = false;
                                              var r;
                                              return function () {
                                                var args = [];
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 4 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6214..6228
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6039..6053

                                        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

                                            var nu$1 = function (info) {
                                              var current = info.current;
                                              var version = info.version;
                                              return {
                                                current: current,
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 3 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6343..6356
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6194..6207

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

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

                                            var flatten = function (xs) {
                                              var r = [];
                                              for (var i = 0, len = xs.length; i < len; ++i) {
                                                if (!isArray(xs[i])) {
                                                  throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 3 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 753..762
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 735..744

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

                                        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 path = function (parts, scope) {
                                              var o = scope !== undefined && scope !== null ? scope : Global;
                                              for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {
                                                o = o[parts[i]];
                                              }
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 3 other locations - About 3 hrs to fix
                                        wp-includes/js/tinymce/plugins/image/plugin.js on lines 68..74
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 4203..4209
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6070..6076

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

                                        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

                                            var find$1 = function (regexes, agent) {
                                              var r = firstMatch(regexes, agent);
                                              if (!r) {
                                                return {
                                                  major: 0,
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 3 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6291..6303
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6142..6154

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

                                        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

                                                var nodeIndex = function (container) {
                                                  var node = container.parentNode.firstChild, idx = 0;
                                                  while (node) {
                                                    if (node === container) {
                                                      return idx;
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 1 other location - About 3 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 4309..4321

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

                                        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/lists/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/media/plugin.js on lines 50..66
                                        wp-includes/js/tinymce/plugins/paste/plugin.js on lines 5..21

                                        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 = 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/lists/plugin.js and 3 other locations - About 2 hrs to fix
                                        wp-includes/js/tinymce/plugins/paste/plugin.js on lines 933..942
                                        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

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

                                            var find = function (xs, pred) {
                                              for (var i = 0, len = xs.length; i < len; i++) {
                                                var x = xs[i];
                                                if (pred(x, i)) {
                                                  return Option.some(x);
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 3 other locations - About 2 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 744..752
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 717..725
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 726..734

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

                                        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/lists/plugin.js and 3 other locations - About 2 hrs to fix
                                        wp-includes/js/tinymce/plugins/paste/plugin.js on lines 918..926
                                        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

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

                                            var OperatingSystem = {
                                              unknown: unknown$2,
                                              nu: nu$2,
                                              windows: constant(windows),
                                              ios: constant(ios),
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 2 hrs to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6401..6411
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6252..6262

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

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

                                            var NodeType = {
                                              isTextNode: isTextNode,
                                              isListNode: isListNode,
                                              isOlUlNode: isOlUlNode,
                                              isDlItemNode: isDlItemNode,
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 2 hrs to fix
                                        wp-includes/js/tinymce/plugins/image/plugin.js on lines 49..64
                                        wp-includes/js/tinymce/plugins/link/plugin.js on lines 51..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 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

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

                                            var detectOs = function (oses, userAgent) {
                                              return detect$1(oses, userAgent).map(function (os) {
                                                var version = Version.detect(os.versionRegexes, userAgent);
                                                return {
                                                  current: os.name,
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 5 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/plugins/lists/plugin.js on lines 841..849
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6440..6448
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6449..6457
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6291..6299
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6300..6308

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

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

                                            var detectBrowser = function (browsers, userAgent) {
                                              return detect$1(browsers, userAgent).map(function (browser) {
                                                var version = Version.detect(browser.versionRegexes, userAgent);
                                                return {
                                                  current: browser.name,
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 5 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/plugins/lists/plugin.js on lines 850..858
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6440..6448
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6449..6457
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6291..6299
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6300..6308

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

                                        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

                                            var firstMatch = function (regexes, s) {
                                              for (var i = 0; i < regexes.length; i++) {
                                                var x = regexes[i];
                                                if (x.test(s)) {
                                                  return x;
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6282..6290
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6133..6141

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

                                        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

                                            var Browser = {
                                              unknown: unknown$1,
                                              nu: nu$1,
                                              edge: constant(edge),
                                              chrome: constant(chrome),
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6357..6366
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6208..6217

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

                                        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/lists/plugin.js and 3 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/plugins/paste/plugin.js on lines 927..932
                                        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

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

                                            var regularContains = function (e1, e2) {
                                              var d1 = e1.dom();
                                              var d2 = e2.dom();
                                              return d1 === d2 ? false : d1.contains(d2);
                                            };
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6607..6611
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6458..6462

                                        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

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

                                            var detect = function (versionRegexes, agent) {
                                              var cleanedAgent = String(agent).toLowerCase();
                                              if (versionRegexes.length === 0) {
                                                return unknown();
                                              }
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6304..6310
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6155..6161

                                        Duplicated Code

                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                        Tuning

                                        This issue has a mass of 61.

                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                        Refactorings

                                        Further Reading

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

                                            var getOrDie = function (name, scope) {
                                              var actual = unsafe(name, scope);
                                              if (actual === undefined || actual === null) {
                                                throw new Error(name + ' not available on this browser');
                                              }
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 3 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/plugins/image/plugin.js on lines 83..89
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 4218..4224
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6085..6091

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

                                        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

                                            var fromPoint = function (docElm, x, y) {
                                              var doc = docElm.dom();
                                              return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
                                            };
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6202..6205
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6027..6030

                                        Duplicated Code

                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                        Tuning

                                        This issue has a mass of 57.

                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                        Refactorings

                                        Further Reading

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

                                            var detect$1 = function (candidates, userAgent) {
                                              var agent = String(userAgent).toLowerCase();
                                              return find(candidates, function (candidate) {
                                                return candidate.search(agent);
                                              });
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 1 hr to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6434..6439
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6285..6290

                                        Duplicated Code

                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                        Tuning

                                        This issue has a mass of 57.

                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                        Refactorings

                                        Further Reading

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

                                            var fromDom = function (node) {
                                              if (node === null || node === undefined) {
                                                throw new Error('Node cannot be null or undefined');
                                              }
                                              return { dom: constant(node) };
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 2 other locations - About 50 mins to fix
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6196..6201
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6021..6026

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

                                            var fromText = function (text, scope) {
                                              var doc = scope || domGlobals.document;
                                              var node = doc.createTextNode(text);
                                              return fromDom(node);
                                            };
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 5 other locations - About 50 mins to fix
                                        wp-includes/js/tinymce/plugins/lists/plugin.js on lines 577..581
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6186..6190
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6191..6195
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6011..6015
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6016..6020

                                        Duplicated Code

                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                        Tuning

                                        This issue has a mass of 51.

                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                        Refactorings

                                        Further Reading

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

                                            var fromTag = function (tag, scope) {
                                              var doc = scope || domGlobals.document;
                                              var node = doc.createElement(tag);
                                              return fromDom(node);
                                            };
                                        Severity: Major
                                        Found in wp-includes/js/tinymce/plugins/lists/plugin.js and 5 other locations - About 50 mins to fix
                                        wp-includes/js/tinymce/plugins/lists/plugin.js on lines 582..586
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6186..6190
                                        wp-includes/js/tinymce/themes/inlite/theme.js on lines 6191..6195
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6011..6015
                                        wp-includes/js/tinymce/themes/modern/theme.js on lines 6016..6020

                                        Duplicated Code

                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                        Tuning

                                        This issue has a mass of 51.

                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                        Refactorings

                                        Further Reading

                                        There are no issues that match your filters.

                                        Category
                                        Status