insideout10/wordlift-plugin-js

View on GitHub
app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js

Summary

Maintainability
F
1 wk
Test Coverage

Function updateStyle has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
Open

    updateStyle : function(ty) {
        var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});

        if (tinyMCEPopup.editor.settings.inline_styles) {
            // Handle align
Severity: Minor
Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File image.js has 350 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var ImageDialog = {
    preInit : function() {
        var url;

        tinyMCEPopup.requireLangPack();
Severity: Minor
Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 4 hrs to fix

    Function init has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        init : function(ed) {
            var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');
    
            tinyMCEPopup.resizeToInnerSize();
            this.fillClassList('class_list');
    Severity: Minor
    Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getAttrib has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        getAttrib : function(e, at) {
            var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
    
            if (ed.settings.inline_styles) {
                switch (at) {
    Severity: Minor
    Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

        init : function(ed) {
            var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');
    
            tinyMCEPopup.resizeToInnerSize();
            this.fillClassList('class_list');
    Severity: Major
    Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 2 hrs to fix

      Function updateStyle has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          updateStyle : function(ty) {
              var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
      
              if (tinyMCEPopup.editor.settings.inline_styles) {
                  // Handle align
      Severity: Major
      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 2 hrs to fix

        Function insertAndClose has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            insertAndClose : function() {
                var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
        
                tinyMCEPopup.restoreSelection();
        
        Severity: Major
        Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 2 hrs to fix

          Function getAttrib has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              getAttrib : function(e, at) {
                  var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
          
                  if (ed.settings.inline_styles) {
                      switch (at) {
          Severity: Minor
          Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 1 hr to fix

            Function insertAndClose has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                insertAndClose : function() {
                    var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
            
                    tinyMCEPopup.restoreSelection();
            
            Severity: Minor
            Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Avoid deeply nested control flow statements.
            Open

                                    if (b.length == 3 && b[isIE ? 0 : 2])
                                        bColor = b[isOldIE ? 0 : 2];
                                    else if (!bColor || bColor == 'none')
                                        bColor = 'black';
            Severity: Major
            Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (b.length == 3 && b[isOldIE ? 2 : 1])
                                          bStyle = b[isOldIE ? 2 : 1];
                                      else if (!bStyle || bStyle == 'none')
                                          bStyle = 'solid';
              Severity: Major
              Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.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/advimage/js/image.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

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

                    Avoid too many return statements within this function.
                    Open

                                            return parseInt(v.replace(/[^0-9]/g, ''));
                    Severity: Major
                    Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 30 mins to fix

                      Function insert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          insert : function(file, title) {
                              var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
                      
                              if (f.src.value === '') {
                                  if (ed.selection.getNode().nodeName == 'IMG') {
                      Severity: Minor
                      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                          getAttrib : function(e, at) {
                              var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
                      
                              if (ed.settings.inline_styles) {
                                  switch (at) {
                      Severity: Major
                      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js and 1 other location - About 2 days to fix
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js on lines 167..224

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

                      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

                          changeWidth : function() {
                              var f = document.forms[0], tp, t = this;
                      
                              if (!f.constrain.checked || !t.preloadImg) {
                                  return;
                      app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js on lines 339..351

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

                      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

                          changeHeight : function() {
                              var f = document.forms[0], tp, t = this;
                      
                              if (!f.constrain.checked || !t.preloadImg) {
                                  return;
                      app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js on lines 353..365

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

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

                              if (l && l.length > 0) {
                                  lst.options[lst.options.length] = new Option('', '');
                      
                                  tinymce.each(l, function(o) {
                                      lst.options[lst.options.length] = new Option(o[0], o[1]);
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js on lines 44..51
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js on lines 108..115

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

                      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

                              if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
                                  cl = [];
                      
                                  tinymce.each(v.split(';'), function(v) {
                                      var p = v.split('=');
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js on lines 121..130

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

                      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 (ty == 'hspace') {
                                      dom.setStyle(img, 'marginLeft', '');
                                      dom.setStyle(img, 'marginRight', '');
                      
                                      v = f.hspace.value;
                      app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js on lines 426..435

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

                      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 (ty == 'vspace') {
                                      dom.setStyle(img, 'marginTop', '');
                                      dom.setStyle(img, 'marginBottom', '');
                      
                                      v = f.vspace.value;
                      app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js on lines 414..423

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

                      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

                              if (el && el.nodeName == 'IMG') {
                                  ed.dom.setAttribs(el, args);
                              } else {
                                  tinymce.each(args, function(value, name) {
                                      if (value === "") {
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js on lines 88..101

                      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

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

                              if (f.src.value === '') {
                                  if (ed.selection.getNode().nodeName == 'IMG') {
                                      ed.dom.remove(ed.selection.getNode());
                                      ed.execCommand('mceRepaint');
                                  }
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js on lines 59..67

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

                      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

                          preInit : function() {
                              var url;
                      
                              tinyMCEPopup.requireLangPack();
                      
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js on lines 2..9

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

                      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 (b.length == 3 && b[isOldIE ? 2 : 1])
                                                  bStyle = b[isOldIE ? 2 : 1];
                                              else if (!bStyle || bStyle == 'none')
                                                  bStyle = 'solid';
                      app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js on lines 404..407

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

                      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 (b.length == 3 && b[isIE ? 0 : 2])
                                                  bColor = b[isOldIE ? 0 : 2];
                                              else if (!bColor || bColor == 'none')
                                                  bColor = 'black';
                      app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js on lines 400..403

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

                      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(cl, function(o) {
                                      lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
                                  });
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js on lines 135..137

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

                      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 (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
                                      nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
                      Severity: Minor
                      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js and 1 other location - About 55 mins to fix
                      app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js on lines 40..41

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

                      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 (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
                                      nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
                      Severity: Minor
                      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js and 1 other location - About 55 mins to fix
                      app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js on lines 43..44

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

                      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

                                  args = {
                                      vspace : nl.vspace.value,
                                      hspace : nl.hspace.value,
                                      border : nl.border.value,
                                      align : getSelectValue(f, 'align')
                      Severity: Minor
                      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js and 1 other location - About 50 mins to fix
                      app/lib/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js on lines 70..75

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

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

                              if (!st) {
                                  f.elements.width.value = img.width;
                                  f.elements.height.value = img.height;
                              }
                      Severity: Major
                      Found in app/lib/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js and 2 other locations - About 45 mins to fix
                      app/lib/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js on lines 164..170
                      app/lib/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js on lines 182..186

                      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

                      There are no issues that match your filters.

                      Category
                      Status