insideout10/wordlift-plugin-js

View on GitHub
app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js

Summary

Maintainability
F
5 days
Test Coverage

File editor_plugin_src.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * editor_plugin_src.js
 *
 * Copyright 2009, Moxiecode Systems AB
 * Released under LGPL License.
Severity: Major
Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 1 day to fix

    Function init has 172 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            init : function(ed, url) {
                var t = this;
    
                t.editor = ed;
                t.url = url;
    Severity: Major
    Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 6 hrs to fix

      Function _preProcess has 169 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _preProcess : function(pl, o) {
                  var ed = this.editor,
                      h = o.content,
                      grep = tinymce.grep,
                      explode = tinymce.explode,
      Severity: Major
      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 6 hrs to fix

        Function grabContent has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function grabContent(e) {
                        var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;
        
                        // Check if browser supports direct plaintext access
                        if (e.clipboardData || dom.doc.dataTransfer) {
        Severity: Major
        Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 3 hrs to fix

          Function _insertPlainText has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _insertPlainText : function(content) {
                      var ed = this.editor,
                          linebr = getParam(ed, "paste_text_linebreaktype"),
                          rl = getParam(ed, "paste_text_replacements"),
                          is = tinymce.is;
          Severity: Major
          Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 2 hrs to fix

            Function _postProcess has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _postProcess : function(pl, o) {
                        var t = this, ed = t.editor, dom = ed.dom, styleProps;
            
                        if (ed.settings.paste_enable_default_filters == false) {
                            return;

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

                      _convertLists : function(pl, o) {
                          var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;
              
                          // Convert middot lists into real semantic lists
                          each(dom.select('p', o.node), function(p) {

                Avoid deeply nested control flow statements.
                Open

                                                                if ((value == "single") || (value == "double")) {
                                                                    n[i++] = "text-decoration:line-through";
                                                                }
                Severity: Major
                Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                  if (sv) {
                                                      newStyle[sp] = sv;
                                                      npc++;
                                                  }
                  Severity: Major
                  Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                                    if (value == "yes") {
                                                                        n[i++] = "display:none";
                                                                    }
                    Severity: Major
                    Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 45 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                                                      return;
                      Severity: Major
                      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                                                        return;
                        Severity: Major
                        Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                                                          return;
                          Severity: Major
                          Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                                            return;
                            Severity: Major
                            Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                                          return;
                              Severity: Major
                              Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                                                return;
                                Severity: Major
                                Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                                                  return;
                                  Severity: Major
                                  Found in app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js - About 30 mins to fix

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

                                                    ed.addCommand("mcePasteText", function() {
                                                        ed.windowManager.open({
                                                            file : t.url + "/pastetext.htm",
                                                            width: parseInt(getParam(ed, "paste_dialog_width")),
                                                            height: parseInt(getParam(ed, "paste_dialog_height")),
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js on lines 860..867

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

                                                ed.addCommand("mcePasteWord", function() {
                                                    ed.windowManager.open({
                                                        file: t.url + "/pasteword.htm",
                                                        width: parseInt(getParam(ed, "paste_dialog_width")),
                                                        height: parseInt(getParam(ed, "paste_dialog_height")),
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js on lines 870..877

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

                                            getInfo : function() {
                                                return {
                                                    longname : 'Paste text/word',
                                                    author : 'Moxiecode Systems AB',
                                                    authorurl : 'http://tinymce.moxiecode.com',
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js on lines 44..52
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js on lines 37..45
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js on lines 48..56
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js on lines 163..171
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js on lines 29..37
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js on lines 53..61
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js on lines 30..38
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js on lines 40..48
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js on lines 221..229
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js on lines 41..49
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js on lines 23..31
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js on lines 34..42
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js on lines 89..97
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js on lines 126..134
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js on lines 944..952
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 223..231
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js on lines 524..532
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js on lines 61..69
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js on lines 40..48
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js on lines 21..29
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js on lines 30..38
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js on lines 48..56
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js on lines 58..66
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js on lines 109..117
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js on lines 53..61
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js on lines 50..58
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js on lines 32..40
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js on lines 110..118
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js on lines 119..127

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                                    if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
                                                        return false; // Stop other listeners
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js on lines 299..300

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 52.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                                            if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
                                                                grabContent(e);
                                    app/lib/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js on lines 70..71

                                    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

                                    There are no issues that match your filters.

                                    Category
                                    Status