ui/public/ckeditor/plugins/codemirror/plugin.js

Summary

Maintainability
F
3 wks
Test Coverage

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

        init: function (editor) {
            var rootPath = this.path,
                defaultConfig = {
                    autoCloseBrackets: true,
                    autoCloseTags: true,
Severity: Major
Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 4 days to fix

    File plugin.js has 1099 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
    *  The "codemirror" plugin. It's indented to enhance the
    *  "sourcearea" editing mode, which displays the xhtml source code with
    *  syntax highlight and line numbers.
    * Licensed under the MIT license
    Severity: Major
    Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 2 days to fix

      Function loadCodeMirror has 151 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  function loadCodeMirror(editor) {
                      var contentsSpace = editor.ui.space("contents"),
                          textarea = contentsSpace.getDocument().createElement("textarea");
      
                      textarea.setStyles(
      Severity: Major
      Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 6 hrs to fix

        Function loadCodeMirrorInline has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            function loadCodeMirrorInline(editor, textarea, dialog) {
                                var size = dialog.getSize(),
                                    width = size.width,
                                    height = size.height / 1.5;
        
        Severity: Major
        Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 4 hrs to fix

          Function getCodeMirrorScripts has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function getCodeMirrorScripts() {
                          var scriptFiles = [rootPath + "js/codemirror.addons.min.js"];
          
                          switch (config.mode) {
                              case 'handlebars':
          Severity: Major
          Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 2 hrs to fix

            Function onShow has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                                    onShow: function (event) {
                                        // Set Elements
                                        this.getContentElement("main", "data").focus();
                                        this.getContentElement("main", "AutoComplete").setValue(config.autoCloseTags, true);
            
            Severity: Minor
            Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 1 hr to fix

              Function getCodeMirrorDependencies has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          function getCodeMirrorDependencies() {
                              var dependencies = ["core", "addons"];
                              switch (config.mode) {
                                  case "bbcode":
                                  case "bbcodemixed":
              Severity: Minor
              Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                                                        if (CodeMirror.prototype["autoFormatAll"]) {
                                                            loadCodeMirrorInline(editor, textArea, event.sender);
                                                        } else {
                                                            // loading the add-on scripts.
                                                            CKEDITOR.scriptLoader.load(getCodeMirrorScripts(),
                Severity: Major
                Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 45 mins to fix

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

                                  CKEDITOR.plugins.sourcearea.commands = {
                                      source: {
                                          modes: {
                                              wysiwyg: 1,
                                              source: 1
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 4 days to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1195..1296

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

                  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

                      commands: {
                          source: {
                              modes: {
                                  wysiwyg: 1,
                                  source: 1
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 4 days to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 547..647

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

                  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

                                  window["codemirror_" + editor.id].on("keypress", function (codeMirror_Editor, evt) {
                                      if (config.enableCodeFormatting) {
                                          var range = getSelectedRange();
                                          if (evt.type === "keydown" && evt.ctrlKey && evt.keyCode === 75 && !evt.shiftKey && !evt.altKey) {
                                              window["codemirror_" + editor.id].commentRange(true, range.from, range.to);
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 2 days to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 228..244

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

                  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

                                          window["codemirror_" + editor.id].on("keypress", function (codeMirror_Editor, evt) {
                                              if (config.enableCodeFormatting) {
                                                  var range = getSelectedRange();
                                                  if (evt.type === "keydown" && evt.ctrlKey && evt.keyCode === 75 && !evt.shiftKey && !evt.altKey) {
                                                      window["codemirror_" + editor.id].commentRange(true, range.from, range.to);
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 2 days to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 964..980

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

                  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 (typeof (textRange.endOffset) == "undefined") {
                                              window["codemirror_" + editor.id].focus();
                                              window["codemirror_" + editor.id].setCursor(start);
                                          } else {
                                              window["codemirror_" + editor.id].focus();
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 5 hrs to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 252..259

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

                  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 (typeof (textRange.endOffset) == "undefined") {
                                                  window["codemirror_" + editor.id].focus();
                                                  window["codemirror_" + editor.id].setCursor(start);
                                              } else {
                                                  window["codemirror_" + editor.id].focus();
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 5 hrs to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1075..1082

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

                  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 (config.theme.length &&
                                                      config.theme != "default" &&
                                                      !IsStyleSheetAlreadyLoaded(rootPath + "theme/" + config.theme + ".css")) {
                                                      CKEDITOR.document.appendStyleSheet(rootPath + "theme/" + config.theme + ".css");
                                                  }
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 2 hrs to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 659..663

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

                  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 (config.theme.length &&
                                          config.theme != "default" &&
                                          !IsStyleSheetAlreadyLoaded(rootPath + "theme/" + config.theme + ".css")) {
                                          CKEDITOR.document.appendStyleSheet(rootPath + "theme/" + config.theme + ".css");
                                      }
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 2 hrs to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 299..303

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

                  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 (config.useBeautifyOnStart) {
                                                  var indent_size = 4,
                                                      indent_char = " ",
                                                      brace_style = "collapse"; //collapse, expand, end-expand
                  
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 916..932

                  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

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

                                      if (config.useBeautifyOnStart) {
                                          var indent_size = 4;
                                          var indent_char = " ";
                                          var brace_style = "collapse"; //collapse, expand, end-expand
                  
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 180..196

                  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

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

                                  window["codemirror_" + editor.id].on("change", function () {
                                      window["codemirror_" + editor.id].save();
                                      editor.fire("change", this);
                                  });
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 206..209

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

                  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

                                          window["codemirror_" + editor.id].on("change", function () {
                                              window["codemirror_" + editor.id].save();
                                              editor.fire("change", this);
                                          });
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 942..945

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

                  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

                                  function getSelectedRange() {
                                      return {
                                          from: window["codemirror_" + editor.id].getCursor(true),
                                          to: window["codemirror_" + editor.id].getCursor(false)
                                      };
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 199..204

                  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

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

                                          function getSelectedRange() {
                                              return {
                                                  from: window["codemirror_" + editor.id].getCursor(true),
                                                  to: window["codemirror_" + editor.id].getCursor(false)
                                              };
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 935..940

                  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

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

                                  if (config.lineNumbers && config.enableCodeFolding) {
                                      window["codemirror_" + editor.id].on("gutterClick", window["foldFunc_" + editor.id]);
                                  }
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 215..217

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

                  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 (config.lineNumbers && config.enableCodeFolding) {
                                              window["codemirror_" + editor.id].on("gutterClick", window["foldFunc_" + editor.id]);
                                          }
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 950..952

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

                  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

                                              extraKeys: {
                                                  "Ctrl-Q": function (codeMirror_Editor) {
                                                      if (config.enableCodeFolding) {
                                                          window["foldFunc_" + editor.id](codeMirror_Editor, codeMirror_Editor.getCursor().line);
                                                      }
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 875..881

                  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

                                  var extraKeys = {
                                      "Ctrl-Q": function(codeMirror_Editor) {
                                          if (config.enableCodeFolding) {
                                              window["foldFunc_" + editor.id](codeMirror_Editor, codeMirror_Editor.getCursor().line);
                                          }
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 1 hr to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 161..167

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

                                      if (config.showFormatButton) {
                                          editor.ui.addButton("autoFormat", {
                                              label: lang.autoFormat,
                                              command: "autoFormat",
                                              toolbar: "mode,50"
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 3 other locations - About 35 mins to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1016..1022
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1023..1029
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1030..1036

                  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

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

                                      range.startOffset = LineChannelToOffSet(window["codemirror_" + editor.id], window["codemirror_" + editor.id].getCursor(true));
                  Severity: Minor
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 35 mins to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1046..1046

                  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

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

                                      if (config.showCommentButton) {
                                          editor.ui.addButton("CommentSelectedRange", {
                                              label: lang.commentSelectedRange,
                                              command: "commentSelectedRange",
                                              toolbar: "mode,60"
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 3 other locations - About 35 mins to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1009..1015
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1023..1029
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1030..1036

                  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

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

                                      range.endOffset = LineChannelToOffSet(window["codemirror_" + editor.id], window["codemirror_" + editor.id].getCursor(false));
                  Severity: Minor
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 35 mins to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1045..1045

                  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

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

                                      if (config.showUncommentButton) {
                                          editor.ui.addButton("UncommentSelectedRange", {
                                              label: lang.uncommentSelectedRange,
                                              command: "uncommentSelectedRange",
                                              toolbar: "mode,70"
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 3 other locations - About 35 mins to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1009..1015
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1016..1022
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1030..1036

                  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

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

                                      if (config.showAutoCompleteButton) {
                                          editor.ui.addButton("AutoComplete", {
                                              label: lang.autoCompleteToggle,
                                              command: "autoCompleteToggle",
                                              toolbar: "mode,80"
                  Severity: Major
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 3 other locations - About 35 mins to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1009..1015
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1016..1022
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1023..1029

                  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

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

                                  if (typeof config.onLoad === "function") {
                                      config.onLoad(window["codemirror_" + editor.id], editor);
                                  }
                  Severity: Minor
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 30 mins to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 219..221

                  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

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

                                          if (typeof config.onLoad === "function") {
                                              config.onLoad(window["codemirror_" + editor.id], editor);
                                          }
                  Severity: Minor
                  Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 30 mins to fix
                  ui/public/ckeditor/plugins/codemirror/plugin.js on lines 955..957

                  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