Code Duplication    Length = 17-17 lines in 2 locations

public/js/tinymce/plugins/spellchecker/plugin.js 1 location

@@ 494-510 (lines=17) @@
491
      }
492
      return value;
493
    };
494
    var findSpansByIndex = function (editor, index) {
495
      var nodes;
496
      var spans = [];
497
      nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
498
      if (nodes.length) {
499
        for (var i = 0; i < nodes.length; i++) {
500
          var nodeIndex = getElmIndex(nodes[i]);
501
          if (nodeIndex === null || !nodeIndex.length) {
502
            continue;
503
          }
504
          if (nodeIndex === index.toString()) {
505
            spans.push(nodes[i]);
506
          }
507
        }
508
      }
509
      return spans;
510
    };
511
    var markErrors = function (editor, startedState, textMatcherState, lastSuggestionsState, data) {
512
      var suggestions, hasDictionarySupport;
513
      if (typeof data !== 'string' && data.words) {

public/js/tinymce/plugins/searchreplace/plugin.js 1 location

@@ 241-257 (lines=17) @@
238
      }
239
      node.parentNode.removeChild(node);
240
    };
241
    var findSpansByIndex = function (editor, index) {
242
      var nodes;
243
      var spans = [];
244
      nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
245
      if (nodes.length) {
246
        for (var i = 0; i < nodes.length; i++) {
247
          var nodeIndex = getElmIndex(nodes[i]);
248
          if (nodeIndex === null || !nodeIndex.length) {
249
            continue;
250
          }
251
          if (nodeIndex === index.toString()) {
252
            spans.push(nodes[i]);
253
          }
254
        }
255
      }
256
      return spans;
257
    };
258
    var moveSelection = function (editor, currentIndexState, forward) {
259
      var testIndex = currentIndexState.get();
260
      var dom = editor.dom;