insideout10/wordlift-plugin-js

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

Summary

Maintainability
F
6 days
Test Coverage

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

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

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

            init: function(ed) {
                var LIST_TABBING = 'TABBING';
                var LIST_EMPTY_ITEM = 'EMPTY';
                var LIST_ESCAPE = 'ESCAPE';
                var LIST_PARAGRAPH = 'PARAGRAPH';
    Severity: Major
    Found in app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js - About 1 day to fix

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

              applyList: function(targetListType, oppositeListType) {
                  var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
                          selectedBlocks = ed.selection.getSelectedBlocks();
      
                  function cleanupBr(e) {
      Severity: Major
      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js - About 1 day to fix

        Function process has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                process: function(actions) {
                    var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
        
                    function isEmptyElement(element) {
                        var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
        Severity: Major
        Found in app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js - About 2 hrs to fix

          Function processBrs has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function processBrs(element, callback) {
                          var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
                                  breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
          
                          function isAnyPartSelected(start, end) {
          Severity: Minor
          Found in app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js - About 2 hrs to fix

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

                        function imageJoiningListItem(ed, e) {
                            var prevSibling;
            
                            if (!tinymce.isGecko)
                                return;

              Function outdent has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      outdent: function(ui, elements) {
                          var t = this, ed = t.ed, dom = ed.dom, outdented = [];
              
                          function outdentLI(element) {
                              var listElement, targetParent, align;

                Function indent has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        indent: function() {
                            var ed = this.ed, dom = ed.dom, indented = [];
                
                            function createWrapItem(element) {
                                var wrapItem = dom.create('li', { style: 'list-style-type: none;'});

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

                              function makeList(element) {
                                  var list = dom.create(targetListType), li;
                  
                                  function adjustIndentForNewList(element) {
                                      // If there's a margin-left, outdent one level to account for the extra list margin.

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

                                function convertListItemToParagraph(element) {
                                    var child, nextChild, mergedElement, splitLast;
                                    if (tinymce.inArray(applied, element) !== -1) {
                                        return;
                                    }

                      Consider simplifying this complex logical expression.
                      Open

                              } else if (isList(e1)) {
                                  return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
                              } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
                      Severity: Major
                      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js - About 40 mins to fix

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

                            function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
                                var next = skipWhitespaceNodesForwards(e.nextSibling);
                                if (next) {
                                    return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
                                } else {
                        app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js on lines 67..74

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

                        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

                            function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
                                var prev = skipWhitespaceNodesBackwards(e.previousSibling);
                                if (prev) {
                                    return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
                                } else {
                        app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js on lines 76..83

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

                        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 : 'Lists',
                                        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/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/paste/editor_plugin_src.js on lines 328..336
                        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

                                                    return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
                        app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js on lines 928..928

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

                        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

                                        currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
                        app/lib/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js on lines 371..371

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

                        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