insideout10/wordlift-plugin-js

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

Summary

Maintainability
F
6 days
Test Coverage

File editor_plugin_src.js has 632 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/media/editor_plugin_src.js - About 1 day to fix

    Function imgToObject has 226 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            imgToObject : function(node, args) {
                var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
                    source, sources, params, param, typeItem, i, item, mp4Source, replacement,
                    posterSrc, style, audio;
    
    Severity: Major
    Found in app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js - About 1 day to fix

      Function objectToImg has 173 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              objectToImg : function(node) {
                  var object, embed, video, iframe, img, name, id, width, height, style, i, html,
                      param, params, source, sources, data, type, lookup = this.lookup,
                      matches, attrs, urlConverter = this.editor.settings.url_converter,
                      urlConverterScope = this.editor.settings.url_converter_scope,
      Severity: Major
      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js - About 6 hrs to fix

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

                init : function(ed, url) {
                    var self = this, lookup = {}, i, y, item, name;
        
                    function isMediaImg(node) {
                        return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
        Severity: Major
        Found in app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js - About 4 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                      if (object) {
                          // Get width/height
                          width = width || object.attr('width');
                          height = height || object.attr('height');
                          style = style || object.attr('style');
          Severity: Critical
          Found in app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                        if (embed) {
                            // Get width/height
                            width = width || embed.attr('width');
                            height = height || embed.attr('height');
                            style = style || embed.attr('style');
            Severity: Critical
            Found in app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js - About 1 hr to fix

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

                          function addPlayer(video_src, poster_src) {
                              var baseUri, flashVars, flashVarsOutput, params, flashPlayer;
              
                              flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
                              if (flashPlayer) {

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

                                video = new Node('video', 1).attr(tinymce.extend({
                                    id : node.attr('id'),
                                    width: normalizeSize(node.attr('width')),
                                    height: normalizeSize(node.attr('height')),
                                    style : style
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 482..487

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

                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

                                audio = new Node('audio', 1).attr(tinymce.extend({
                                    id : node.attr('id'),
                                    width: normalizeSize(node.attr('width')),
                                    height: normalizeSize(node.attr('height')),
                                    style : style
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 443..448

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

                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

                                for (name in iframe.attributes.map) {
                                    if (!excludedAttrs[name] && !data.params[name])
                                        data.params[name] = iframe.attributes.map[name];
                                }
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 796..799

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

                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

                                for (name in embed.attributes.map) {
                                    if (!excludedAttrs[name] && !data.params[name])
                                        data.params[name] = embed.attributes.map[name];
                                }
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 818..821

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

                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 (video) {
                                // Insert raw HTML
                                if (data.video_html) {
                                    value = new Node('#text', 3);
                                    value.raw = true;
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 627..635

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

                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 (audio) {
                                // Insert raw HTML
                                if (data.video_html) {
                                    value = new Node('#text', 3);
                                    value.raw = true;
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 617..625

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

                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 : 'Media',
                                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/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

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

                                    tinymce.each(rootAttributes, function(name) {
                                        if (data[name] && name != 'type')
                                            embed.attr(name, data[name]);
                                    });
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 522..525

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

                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

                                tinymce.each(rootAttributes, function(name) {
                                    if (data[name] && name != 'type')
                                        embed.attr(name, data[name]);
                                });
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 596..599

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

                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

                                for (i = 0; i < sources.length; i++) {
                                    source = new Node('source', 1).attr(sources[i]);
                                    source.shortEnded = true;
                                    video.append(source);
                                }
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 499..503

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

                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

                                for (i = 0; i < sources.length; i++) {
                                    source = new Node('source', 1).attr(sources[i]);
                                    source.shortEnded = true;
                                    audio.append(source);
                                }
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 465..469

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

                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 (!sources[0].type) {
                                    audio.attr('src', sources[0].src);
                                    sources.splice(0, 1);
                                }
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 460..463

                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

                                if (!sources[0].type) {
                                    video.attr('src', sources[0].src);
                                    sources.splice(0, 1);
                                }
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 494..497

                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

                            img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 265..265

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

                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

                            img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));
                app/lib/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js on lines 266..266

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

                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