amtgard/ORK3

View on GitHub
orkui/template/default/script/js/SCEditor/jquery.sceditor.js

Summary

Maintainability
F
1 wk
Test Coverage

File jquery.sceditor.js has 1520 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * SCEditor v1.3.3
 * http://www.samclarke.com/2011/07/sceditor/ 
 *
 * Copyright (C) 2011-2012, Sam Clarke (samclarke.com)
Severity: Major
Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 4 days to fix

    Function sceditor has 585 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.sceditor = function (el, options) {
            var base = this;
    
            /**
             * The textarea element being replaced
    Severity: Major
    Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 2 days to fix

      Function rangeHelper has 244 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.sceditor.rangeHelper = function(w, d) {
              var    win, doc,
                  isW3C        = true,
                  startMarker    = "sceditor-start-marker",
                  endMarker    = "sceditor-end-marker",
      Severity: Major
      Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 day to fix

        Function exec has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    exec: function (caller) {
                        var    appendEmoticon,
                            editor  = this,
                            content = $('<div />'),
                            line    = $('<div />');
        Severity: Minor
        Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

          Function raplaceKeyword has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  base.raplaceKeyword = function(rep, includeAfter, repSorted, longestKey, requireWhiteSpace, curChar) {
                      if(!repSorted)
                          rep.sort(function(a, b){
                              return a.length - b.length;
                          });
          Severity: Minor
          Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

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

                    extractContents: function(startNode, endNode) {
                        var    base        = this,
                            $commonAncestor    = base.findCommonAncestor(startNode, endNode),
                            commonAncestor    = $commonAncestor===null?null:$commonAncestor.get(0),
                            startReached    = false,
            Severity: Minor
            Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

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

                          exec: function (caller) {
                              var    editor  = this,
                                  content = $(this._(
                                      '<form><div><label for="rows">{0}</label><input type="text" id="rows" value="2" /></div>' +
                                          '<div><label for="cols">{1}</label><input type="text" id="cols" value="2" /></div></form>',
              Severity: Minor
              Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

                Function extract has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            return (function extract(root) {
                                var df = startNode.ownerDocument.createDocumentFragment();
                                
                                base.traverse(root, function(node) {
                                    // if end has been reached exit loop
                Severity: Minor
                Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

                  Function exec has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              exec: function (caller) {
                                  var    editor            = this,
                                      genColor        = {r: 255, g: 255, b: 255},
                                      content            = $("<div />"),
                                      colorColumns    = this.options.colors?this.options.colors.split("|"):new Array(21),
                  Severity: Minor
                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

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

                                exec: function (caller) {
                                    var    editor  = this,
                                        content = $(this._('<form><div><label for="link">{0}</label> <input type="text" id="link" value="http://" /></div>' +
                                                '<div><label for="des">{1}</label> <input type="text" id="des" value="" /></div></form>',
                                            this._("URL:"),
                    Severity: Minor
                    Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

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

                                  exec: function (caller) {
                                      var    editor  = this,
                                          content = $(this._('<form><div><label for="link">{0}</label> <input type="text" id="image" value="http://" /></div>' +
                                              '<div><label for="width">{1}</label> <input type="text" id="width" size="2" /></div>' +
                                              '<div><label for="height">{2}</label> <input type="text" id="height" size="2" /></div></form>',
                      Severity: Minor
                      Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

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

                                    keyPress: function (e, wysiwygEditor)
                                    {
                                        // make sure emoticons command is in the toolbar before running
                                        if(this.options.toolbar.indexOf('emoticon') === -1)
                                            return;
                        Severity: Minor
                        Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

                          Function textEditorInsertText has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  base.textEditorInsertText = function (text, endText) {
                                      var range, start, end, txtLen;
                                      
                                      textEditor.focus();
                                      
                          Severity: Minor
                          Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 1 hr to fix

                            Function raplaceKeyword has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    base.raplaceKeyword = function(rep, includeAfter, repSorted, longestKey, requireWhiteSpace, curChar) {
                            Severity: Minor
                            Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 45 mins to fix

                              Function traverse has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      traverse: function(node, func, innermostFirst, siblingsOnly, reverse) {
                              Severity: Minor
                              Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 35 mins to fix

                                Function setCommand has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    $.sceditor.setCommand = function(name, exec, tooltip, keypress, txtExec) {
                                Severity: Minor
                                Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js - About 35 mins to fix

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

                                              if(base.options.height !== null && base.options.height.toString().indexOf("%") > -1)
                                                  setHeight(editorContainer.parent().height() *
                                                      (parseFloat(base.options.height) / 100));
                                  Severity: Major
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 2 hrs to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 992..994

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

                                  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(base.options.width !== null && base.options.width.toString().indexOf("%") > -1)
                                                  setWidth(editorContainer.parent().width() *
                                                      (parseFloat(base.options.width) / 100));
                                  Severity: Major
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 2 hrs to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 988..990

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

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                              return args[0].replace(/\{(\d+)\}/g, function(str, p1) {
                                                  return typeof args[p1-0+1] !== 'undefined'? 
                                                          args[p1-0+1] :
                                                          '{' + p1 + '}';
                                              });
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.bbcode.js on lines 321..325

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 70.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                                  var    editor  = this,
                                                      content = $(this._('<form><div><label for="link">{0}</label> <input type="text" id="link" value="http://" /></div>' +
                                                              '<div><label for="des">{1}</label> <input type="text" id="des" value="" /></div></form>',
                                                          this._("URL:"),
                                                          this._("Description (optional):")
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 1316..1323

                                  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

                                                  var    editor  = this,
                                                      content = $(this._(
                                                          '<form><div><label for="rows">{0}</label><input type="text" id="rows" value="2" /></div>' +
                                                              '<div><label for="cols">{1}</label><input type="text" id="cols" value="2" /></div></form>',
                                                          this._("Rows:"),
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 1451..1457

                                  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

                                              text = text.replace(/&/g, "&amp;")
                                                      .replace(/</g, "&lt;")
                                                      .replace(/>/g, "&gt;")
                                                      .replace(/ /g, "&nbsp;")
                                                      .replace(/\r\n|\r/g, "\n")
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.bbcode.js on lines 467..472

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

                                  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

                                                      clickFunc = function (e) {
                                                          editor.execCommand("fontsize", $(this).data('sceditor-fontsize'));
                                                          editor.closeDropDown(true);
                                                          e.preventDefault();
                                                      };
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 1157..1161

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 56.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                                      clickFunc = function (e) {
                                                          editor.execCommand("fontname", $(this).data('sceditor-font'));
                                                          editor.closeDropDown(true);
                                                          e.preventDefault();
                                                      };
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 1180..1184

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 56.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                              var    emoticons = $.extend({}, base.options.emoticons.more, base.options.emoticons.dropdown, base.options.emoticons.hidden),
                                  Severity: Minor
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 55 mins to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 781..781

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

                                  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 emoticons = $.extend({}, base.options.emoticons.more, base.options.emoticons.dropdown, base.options.emoticons.hidden);
                                  Severity: Minor
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 55 mins to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 441..441

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

                                  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(!overrideCodeBlocking && ($(rangeHelper.parentNode()).is('code') ||
                                                  $(rangeHelper.parentNode()).parents('code').length !== 0))
                                  Severity: Minor
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 50 mins to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 906..907

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

                                              if($(rangeHelper.parentNode()).is('code') ||
                                                  $(rangeHelper.parentNode()).parents('code').length !== 0)
                                  Severity: Minor
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 50 mins to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 644..645

                                  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

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

                                                      {
                                                          c = extract(node);
                                                          n = node.cloneNode(false);
                                  
                                                          n.appendChild(c);
                                  Severity: Minor
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 40 mins to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 2333..2339

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 49.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                                          {
                                                              c = extract(node);
                                                              n = node.cloneNode(false);
                                  
                                                              n.appendChild(c);
                                  Severity: Minor
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 40 mins to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.js on lines 2346..2352

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 49.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                      $.fn.sceditor = function (options) {
                                          return this.each(function () {
                                              (new $.sceditor(this, options));
                                          });
                                      };
                                  Severity: Minor
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 40 mins to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.bbcode.js on lines 1096..1100

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 49.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                      $.sceditor.commandExists = function(name) {
                                          return typeof $.sceditor.commands[name] !== "undefined";
                                      };
                                  Severity: Minor
                                  Found in orkui/template/default/script/js/SCEditor/jquery.sceditor.js and 1 other location - About 35 mins to fix
                                  orkui/template/default/script/js/SCEditor/jquery.sceditor.bbcode.js on lines 1059..1061

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

                                  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