insideout10/wordlift-plugin-js

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

Summary

Maintainability
D
1 day
Test Coverage

Function _dataToHtml has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _dataToHtml : function(data) {
            var headerFragment, headElement, html, elm, value, dom = this.editor.dom;

            function setAttr(elm, name, value) {
                elm.attr(name, value ? value : undefined);

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

    /**
     * editor_plugin_src.js
     *
     * Copyright 2009, Moxiecode Systems AB
     * Released under LGPL License.

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

              _setContent : function(ed, o) {
                  var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm;
      
                  function low(s) {
                      return s.replace(/<\/?[A-Z]+/g, function(a) {

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

                _htmlToData : function() {
                    var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor;
        
                    function getAttr(elm, name) {
                        var value = elm.attr(name);

          Consider simplifying this complex logical expression.
          Open

                      if (elm) {
                          dom.setAttribs(self.editor.getBody(), {
                              style : elm.attr('style') || '',
                              dir : elm.attr('dir') || '',
                              vLink : elm.attr('vlink') || '',
          Severity: Major
          Found in app/lib/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js - About 40 mins to fix

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

                    getInfo : function() {
                        return {
                            longname : 'Fullpage',
                            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/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/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

                            dom.setAttribs(this.editor.getBody(), {
                                style : data.style,
                                dir : data.dir,
                                vLink : data.visited_color,
                                link : data.link_color,
            app/lib/TimelineJS.build/build/js/timeline.js on lines 9717..9723

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

            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