public/assets/js/core/jwysiwyg/jwysiwyg.js

Summary

Maintainability
F
1 mo
Test Coverage

Function Wysiwyg has 1409 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function Wysiwyg() {
        // - the item is added by this.ui.appendControls and then appendItem
        // - click triggers this.triggerControl
        // cmd or[key] - designMode exec function name
        // tags - activates control for these tags (@see checkTargets)
Severity: Major
Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 wk to fix

    File jwysiwyg.js has 2432 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * WYSIWYG - jQuery plugin 0.97
     * (0.97.2 - From infinity)
     *
     * Copyright (c) 2008-2009 Juan M Martinez, 2010-2011 Akzhan Abdulin and all contributors
    Severity: Major
    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 6 days to fix

      Function initFrame has 202 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              this.ui.initFrame = function () {
                  var self = this.self,
                      stylesheet,
                      growHandler,
                      saveHandler;
      Severity: Major
      Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 day to fix

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

                init: function (Wysiwyg) {
                    var self = this, elements, dialog, url, a, selection,
                        formLinkHtml, dialogReplacements, key, translation, regexp,
                        baseUrl, img;
        
        
        Severity: Major
        Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 6 hrs to fix

          Function has too many statements (63). Maximum allowed is 30.
          Open

                  this.ui.initFrame = function () {

          enforce a maximum number of statements allowed in function blocks (max-statements)

          The max-statements rule allows you to specify the maximum number of statements allowed in a function.

          function foo() {
            var bar = 1; // one statement
            var baz = 2; // two statements
            var qux = 3; // three statements
          }

          Rule Details

          This rule enforces a maximum number of statements allowed in function blocks.

          Options

          This rule has a number or object option:

          • "max" (default 10) enforces a maximum number of statements allows in function blocks

          Deprecated: The object property maximum is deprecated; please use the object property max instead.

          This rule has an object option:

          • "ignoreTopLevelFunctions": true ignores top-level functions

          max

          Examples of incorrect code for this rule with the default { "max": 10 } option:

          /*eslint max-statements: ["error", 10]*/
          /*eslint-env es6*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
          
            var foo11 = 11; // Too many.
          }
          
          let foo = () => {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
          
            var foo11 = 11; // Too many.
          };

          Examples of correct code for this rule with the default { "max": 10 } option:

          /*eslint max-statements: ["error", 10]*/
          /*eslint-env es6*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            return function () {
          
              // The number of statements in the inner function does not count toward the
              // statement maximum.
          
              return 42;
            };
          }
          
          let foo = () => {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            return function () {
          
              // The number of statements in the inner function does not count toward the
              // statement maximum.
          
              return 42;
            };
          }

          ignoreTopLevelFunctions

          Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

          /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            var foo11 = 11;
          }

          Related Rules

          • [complexity](complexity.md)
          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

          Function 'Wysiwyg' has too many statements (62). Maximum allowed is 30.
          Open

              function Wysiwyg() {

          enforce a maximum number of statements allowed in function blocks (max-statements)

          The max-statements rule allows you to specify the maximum number of statements allowed in a function.

          function foo() {
            var bar = 1; // one statement
            var baz = 2; // two statements
            var qux = 3; // three statements
          }

          Rule Details

          This rule enforces a maximum number of statements allowed in function blocks.

          Options

          This rule has a number or object option:

          • "max" (default 10) enforces a maximum number of statements allows in function blocks

          Deprecated: The object property maximum is deprecated; please use the object property max instead.

          This rule has an object option:

          • "ignoreTopLevelFunctions": true ignores top-level functions

          max

          Examples of incorrect code for this rule with the default { "max": 10 } option:

          /*eslint max-statements: ["error", 10]*/
          /*eslint-env es6*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
          
            var foo11 = 11; // Too many.
          }
          
          let foo = () => {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
          
            var foo11 = 11; // Too many.
          };

          Examples of correct code for this rule with the default { "max": 10 } option:

          /*eslint max-statements: ["error", 10]*/
          /*eslint-env es6*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            return function () {
          
              // The number of statements in the inner function does not count toward the
              // statement maximum.
          
              return 42;
            };
          }
          
          let foo = () => {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            return function () {
          
              // The number of statements in the inner function does not count toward the
              // statement maximum.
          
              return 42;
            };
          }

          ignoreTopLevelFunctions

          Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

          /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            var foo11 = 11;
          }

          Related Rules

          • [complexity](complexity.md)
          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

          Method 'init' has too many statements (55). Maximum allowed is 30.
          Open

                  init: function (Wysiwyg) {

          enforce a maximum number of statements allowed in function blocks (max-statements)

          The max-statements rule allows you to specify the maximum number of statements allowed in a function.

          function foo() {
            var bar = 1; // one statement
            var baz = 2; // two statements
            var qux = 3; // three statements
          }

          Rule Details

          This rule enforces a maximum number of statements allowed in function blocks.

          Options

          This rule has a number or object option:

          • "max" (default 10) enforces a maximum number of statements allows in function blocks

          Deprecated: The object property maximum is deprecated; please use the object property max instead.

          This rule has an object option:

          • "ignoreTopLevelFunctions": true ignores top-level functions

          max

          Examples of incorrect code for this rule with the default { "max": 10 } option:

          /*eslint max-statements: ["error", 10]*/
          /*eslint-env es6*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
          
            var foo11 = 11; // Too many.
          }
          
          let foo = () => {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
          
            var foo11 = 11; // Too many.
          };

          Examples of correct code for this rule with the default { "max": 10 } option:

          /*eslint max-statements: ["error", 10]*/
          /*eslint-env es6*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            return function () {
          
              // The number of statements in the inner function does not count toward the
              // statement maximum.
          
              return 42;
            };
          }
          
          let foo = () => {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            return function () {
          
              // The number of statements in the inner function does not count toward the
              // statement maximum.
          
              return 42;
            };
          }

          ignoreTopLevelFunctions

          Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

          /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            var foo11 = 11;
          }

          Related Rules

          • [complexity](complexity.md)
          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

          Method 'msWordMarkup' has too many statements (54). Maximum allowed is 30.
          Open

                  msWordMarkup: function (text) {

          enforce a maximum number of statements allowed in function blocks (max-statements)

          The max-statements rule allows you to specify the maximum number of statements allowed in a function.

          function foo() {
            var bar = 1; // one statement
            var baz = 2; // two statements
            var qux = 3; // three statements
          }

          Rule Details

          This rule enforces a maximum number of statements allowed in function blocks.

          Options

          This rule has a number or object option:

          • "max" (default 10) enforces a maximum number of statements allows in function blocks

          Deprecated: The object property maximum is deprecated; please use the object property max instead.

          This rule has an object option:

          • "ignoreTopLevelFunctions": true ignores top-level functions

          max

          Examples of incorrect code for this rule with the default { "max": 10 } option:

          /*eslint max-statements: ["error", 10]*/
          /*eslint-env es6*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
          
            var foo11 = 11; // Too many.
          }
          
          let foo = () => {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
          
            var foo11 = 11; // Too many.
          };

          Examples of correct code for this rule with the default { "max": 10 } option:

          /*eslint max-statements: ["error", 10]*/
          /*eslint-env es6*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            return function () {
          
              // The number of statements in the inner function does not count toward the
              // statement maximum.
          
              return 42;
            };
          }
          
          let foo = () => {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            return function () {
          
              // The number of statements in the inner function does not count toward the
              // statement maximum.
          
              return 42;
            };
          }

          ignoreTopLevelFunctions

          Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

          /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
          
          function foo() {
            var foo1 = 1;
            var foo2 = 2;
            var foo3 = 3;
            var foo4 = 4;
            var foo5 = 5;
            var foo6 = 6;
            var foo7 = 7;
            var foo8 = 8;
            var foo9 = 9;
            var foo10 = 10;
            var foo11 = 11;
          }

          Related Rules

          • [complexity](complexity.md)
          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

          Method 'init' has a complexity of 24.
          Open

                  init: function (Wysiwyg) {

          Limit Cyclomatic Complexity (complexity)

          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

          function a(x) {
              if (true) {
                  return x; // 1st path
              } else if (false) {
                  return x+1; // 2nd path
              } else {
                  return 4; // 3rd path
              }
          }

          Rule Details

          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

          Examples of incorrect code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else if (false) {
                  return x+1;
              } else {
                  return 4; // 3rd path
              }
          }

          Examples of correct code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else {
                  return 4;
              }
          }

          Options

          Optionally, you may specify a max object property:

          "complexity": ["error", 2]

          is equivalent to

          "complexity": ["error", { "max": 2 }]

          Deprecated: the object property maximum is deprecated. Please use the property max instead.

          When Not To Use It

          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

          Further Reading

          Related Rules

          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md)
          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

          Function has a complexity of 19.
          Open

                  this.ui.initFrame = function () {

          Limit Cyclomatic Complexity (complexity)

          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

          function a(x) {
              if (true) {
                  return x; // 1st path
              } else if (false) {
                  return x+1; // 2nd path
              } else {
                  return 4; // 3rd path
              }
          }

          Rule Details

          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

          Examples of incorrect code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else if (false) {
                  return x+1;
              } else {
                  return 4; // 3rd path
              }
          }

          Examples of correct code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else {
                  return 4;
              }
          }

          Options

          Optionally, you may specify a max object property:

          "complexity": ["error", 2]

          is equivalent to

          "complexity": ["error", { "max": 2 }]

          Deprecated: the object property maximum is deprecated. Please use the property max instead.

          When Not To Use It

          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

          Further Reading

          Related Rules

          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md)
          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

          Method 'msWordMarkup' has a complexity of 19.
          Open

                  msWordMarkup: function (text) {

          Limit Cyclomatic Complexity (complexity)

          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

          function a(x) {
              if (true) {
                  return x; // 1st path
              } else if (false) {
                  return x+1; // 2nd path
              } else {
                  return 4; // 3rd path
              }
          }

          Rule Details

          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

          Examples of incorrect code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else if (false) {
                  return x+1;
              } else {
                  return 4; // 3rd path
              }
          }

          Examples of correct code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else {
                  return 4;
              }
          }

          Options

          Optionally, you may specify a max object property:

          "complexity": ["error", 2]

          is equivalent to

          "complexity": ["error", { "max": 2 }]

          Deprecated: the object property maximum is deprecated. Please use the property max instead.

          When Not To Use It

          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

          Further Reading

          Related Rules

          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md)
          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

          Function has a complexity of 18.
          Open

                  this.init = function (element, options) {

          Limit Cyclomatic Complexity (complexity)

          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

          function a(x) {
              if (true) {
                  return x; // 1st path
              } else if (false) {
                  return x+1; // 2nd path
              } else {
                  return 4; // 3rd path
              }
          }

          Rule Details

          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

          Examples of incorrect code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else if (false) {
                  return x+1;
              } else {
                  return 4; // 3rd path
              }
          }

          Examples of correct code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else {
                  return 4;
              }
          }

          Options

          Optionally, you may specify a max object property:

          "complexity": ["error", 2]

          is equivalent to

          "complexity": ["error", { "max": 2 }]

          Deprecated: the object property maximum is deprecated. Please use the property max instead.

          When Not To Use It

          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

          Further Reading

          Related Rules

          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md)
          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

          Function msWordMarkup has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  msWordMarkup: function (text) {
                      var tagName, attrName, rules, reg, regAttr, found, attrs;
          
                      // @link https://github.com/akzhan/jwysiwyg/issues/165
                      text = text.replace(/&lt;/g, "<").replace(/&gt;/g, ">");
          Severity: Major
          Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 2 hrs to fix

            Function has a complexity of 16.
            Open

                        $.each(self.options.controls, function (name, control) {

            Limit Cyclomatic Complexity (complexity)

            Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

            function a(x) {
                if (true) {
                    return x; // 1st path
                } else if (false) {
                    return x+1; // 2nd path
                } else {
                    return 4; // 3rd path
                }
            }

            Rule Details

            This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

            Examples of incorrect code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else if (false) {
                    return x+1;
                } else {
                    return 4; // 3rd path
                }
            }

            Examples of correct code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else {
                    return 4;
                }
            }

            Options

            Optionally, you may specify a max object property:

            "complexity": ["error", 2]

            is equivalent to

            "complexity": ["error", { "max": 2 }]

            Deprecated: the object property maximum is deprecated. Please use the property max instead.

            When Not To Use It

            If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

            Further Reading

            Related Rules

            • [max-depth](max-depth.md)
            • [max-len](max-len.md)
            • [max-nested-callbacks](max-nested-callbacks.md)
            • [max-params](max-params.md)
            • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

            Method 'domTraversing' has a complexity of 15.
            Open

                    domTraversing: function (el, start, end, canRemove, cnt) {

            Limit Cyclomatic Complexity (complexity)

            Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

            function a(x) {
                if (true) {
                    return x; // 1st path
                } else if (false) {
                    return x+1; // 2nd path
                } else {
                    return 4; // 3rd path
                }
            }

            Rule Details

            This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

            Examples of incorrect code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else if (false) {
                    return x+1;
                } else {
                    return 4; // 3rd path
                }
            }

            Examples of correct code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else {
                    return 4;
                }
            }

            Options

            Optionally, you may specify a max object property:

            "complexity": ["error", 2]

            is equivalent to

            "complexity": ["error", { "max": 2 }]

            Deprecated: the object property maximum is deprecated. Please use the property max instead.

            When Not To Use It

            If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

            Further Reading

            Related Rules

            • [max-depth](max-depth.md)
            • [max-len](max-len.md)
            • [max-nested-callbacks](max-nested-callbacks.md)
            • [max-params](max-params.md)
            • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

            Function 'Wysiwyg' has a complexity of 15.
            Open

                function Wysiwyg() {

            Limit Cyclomatic Complexity (complexity)

            Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

            function a(x) {
                if (true) {
                    return x; // 1st path
                } else if (false) {
                    return x+1; // 2nd path
                } else {
                    return 4; // 3rd path
                }
            }

            Rule Details

            This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

            Examples of incorrect code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else if (false) {
                    return x+1;
                } else {
                    return 4; // 3rd path
                }
            }

            Examples of correct code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else {
                    return 4;
                }
            }

            Options

            Optionally, you may specify a max object property:

            "complexity": ["error", 2]

            is equivalent to

            "complexity": ["error", { "max": 2 }]

            Deprecated: the object property maximum is deprecated. Please use the property max instead.

            When Not To Use It

            If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

            Further Reading

            Related Rules

            • [max-depth](max-depth.md)
            • [max-len](max-len.md)
            • [max-nested-callbacks](max-nested-callbacks.md)
            • [max-params](max-params.md)
            • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

            Function has a complexity of 13.
            Open

                                    $("input:submit", dialog).click(function (e) {

            Limit Cyclomatic Complexity (complexity)

            Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

            function a(x) {
                if (true) {
                    return x; // 1st path
                } else if (false) {
                    return x+1; // 2nd path
                } else {
                    return 4; // 3rd path
                }
            }

            Rule Details

            This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

            Examples of incorrect code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else if (false) {
                    return x+1;
                } else {
                    return 4; // 3rd path
                }
            }

            Examples of correct code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else {
                    return 4;
                }
            }

            Options

            Optionally, you may specify a max object property:

            "complexity": ["error", 2]

            is equivalent to

            "complexity": ["error", { "max": 2 }]

            Deprecated: the object property maximum is deprecated. Please use the property max instead.

            When Not To Use It

            If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

            Further Reading

            Related Rules

            • [max-depth](max-depth.md)
            • [max-len](max-len.md)
            • [max-nested-callbacks](max-nested-callbacks.md)
            • [max-params](max-params.md)
            • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

            Function appendControls has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    this.ui.appendControls = function () {
                        var ui = this,
                            self = this.self,
                            controls = self.parseControls(),
                            hasVisibleControls    = true, // to prevent separator before first item
            Severity: Major
            Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 2 hrs to fix

              Method 'run' has a complexity of 12.
              Open

                      run: function (Wysiwyg, options) {

              Limit Cyclomatic Complexity (complexity)

              Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

              function a(x) {
                  if (true) {
                      return x; // 1st path
                  } else if (false) {
                      return x+1; // 2nd path
                  } else {
                      return 4; // 3rd path
                  }
              }

              Rule Details

              This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

              Examples of incorrect code for a maximum of 2:

              /*eslint complexity: ["error", 2]*/
              
              function a(x) {
                  if (true) {
                      return x;
                  } else if (false) {
                      return x+1;
                  } else {
                      return 4; // 3rd path
                  }
              }

              Examples of correct code for a maximum of 2:

              /*eslint complexity: ["error", 2]*/
              
              function a(x) {
                  if (true) {
                      return x;
                  } else {
                      return 4;
                  }
              }

              Options

              Optionally, you may specify a max object property:

              "complexity": ["error", 2]

              is equivalent to

              "complexity": ["error", { "max": 2 }]

              Deprecated: the object property maximum is deprecated. Please use the property max instead.

              When Not To Use It

              If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

              Further Reading

              Related Rules

              • [max-depth](max-depth.md)
              • [max-len](max-len.md)
              • [max-nested-callbacks](max-nested-callbacks.md)
              • [max-params](max-params.md)
              • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

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

                      this.init = function (element, options) {
                          var self = this,
                              $form = $(element).closest("form"),
                              newX = (element.width || element.clientWidth || 0),
                              newY = (element.height || element.clientHeight || 0)
              Severity: Major
              Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 2 hrs to fix

                Function has a complexity of 10.
                Open

                        this.dom.w3c.getElement = function (filterTagName) {

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function open has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                    open: function (ev, ui) {
                                        $("input:submit", dialog).click(function (e) {
                                            e.preventDefault();
                
                                            var url = $('input[name="linkhref"]', dialog).val(),
                Severity: Major
                Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 2 hrs to fix

                  Method 'exec' has a complexity of 9.
                  Open

                                  exec: function () {

                  Limit Cyclomatic Complexity (complexity)

                  Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                  function a(x) {
                      if (true) {
                          return x; // 1st path
                      } else if (false) {
                          return x+1; // 2nd path
                      } else {
                          return 4; // 3rd path
                      }
                  }

                  Rule Details

                  This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                  Examples of incorrect code for a maximum of 2:

                  /*eslint complexity: ["error", 2]*/
                  
                  function a(x) {
                      if (true) {
                          return x;
                      } else if (false) {
                          return x+1;
                      } else {
                          return 4; // 3rd path
                      }
                  }

                  Examples of correct code for a maximum of 2:

                  /*eslint complexity: ["error", 2]*/
                  
                  function a(x) {
                      if (true) {
                          return x;
                      } else {
                          return 4;
                      }
                  }

                  Options

                  Optionally, you may specify a max object property:

                  "complexity": ["error", 2]

                  is equivalent to

                  "complexity": ["error", { "max": 2 }]

                  Deprecated: the object property maximum is deprecated. Please use the property max instead.

                  When Not To Use It

                  If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                  Further Reading

                  Related Rules

                  • [max-depth](max-depth.md)
                  • [max-len](max-len.md)
                  • [max-nested-callbacks](max-nested-callbacks.md)
                  • [max-params](max-params.md)
                  • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                  Function has a complexity of 9.
                  Open

                          this.dom.getAncestor = function (element, filterTagName) {

                  Limit Cyclomatic Complexity (complexity)

                  Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                  function a(x) {
                      if (true) {
                          return x; // 1st path
                      } else if (false) {
                          return x+1; // 2nd path
                      } else {
                          return 4; // 3rd path
                      }
                  }

                  Rule Details

                  This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                  Examples of incorrect code for a maximum of 2:

                  /*eslint complexity: ["error", 2]*/
                  
                  function a(x) {
                      if (true) {
                          return x;
                      } else if (false) {
                          return x+1;
                      } else {
                          return 4; // 3rd path
                      }
                  }

                  Examples of correct code for a maximum of 2:

                  /*eslint complexity: ["error", 2]*/
                  
                  function a(x) {
                      if (true) {
                          return x;
                      } else {
                          return 4;
                      }
                  }

                  Options

                  Optionally, you may specify a max object property:

                  "complexity": ["error", 2]

                  is equivalent to

                  "complexity": ["error", { "max": 2 }]

                  Deprecated: the object property maximum is deprecated. Please use the property max instead.

                  When Not To Use It

                  If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                  Further Reading

                  Related Rules

                  • [max-depth](max-depth.md)
                  • [max-len](max-len.md)
                  • [max-nested-callbacks](max-nested-callbacks.md)
                  • [max-params](max-params.md)
                  • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                  Function has too many statements (33). Maximum allowed is 30.
                  Open

                          this.init = function (element, options) {

                  enforce a maximum number of statements allowed in function blocks (max-statements)

                  The max-statements rule allows you to specify the maximum number of statements allowed in a function.

                  function foo() {
                    var bar = 1; // one statement
                    var baz = 2; // two statements
                    var qux = 3; // three statements
                  }

                  Rule Details

                  This rule enforces a maximum number of statements allowed in function blocks.

                  Options

                  This rule has a number or object option:

                  • "max" (default 10) enforces a maximum number of statements allows in function blocks

                  Deprecated: The object property maximum is deprecated; please use the object property max instead.

                  This rule has an object option:

                  • "ignoreTopLevelFunctions": true ignores top-level functions

                  max

                  Examples of incorrect code for this rule with the default { "max": 10 } option:

                  /*eslint max-statements: ["error", 10]*/
                  /*eslint-env es6*/
                  
                  function foo() {
                    var foo1 = 1;
                    var foo2 = 2;
                    var foo3 = 3;
                    var foo4 = 4;
                    var foo5 = 5;
                    var foo6 = 6;
                    var foo7 = 7;
                    var foo8 = 8;
                    var foo9 = 9;
                    var foo10 = 10;
                  
                    var foo11 = 11; // Too many.
                  }
                  
                  let foo = () => {
                    var foo1 = 1;
                    var foo2 = 2;
                    var foo3 = 3;
                    var foo4 = 4;
                    var foo5 = 5;
                    var foo6 = 6;
                    var foo7 = 7;
                    var foo8 = 8;
                    var foo9 = 9;
                    var foo10 = 10;
                  
                    var foo11 = 11; // Too many.
                  };

                  Examples of correct code for this rule with the default { "max": 10 } option:

                  /*eslint max-statements: ["error", 10]*/
                  /*eslint-env es6*/
                  
                  function foo() {
                    var foo1 = 1;
                    var foo2 = 2;
                    var foo3 = 3;
                    var foo4 = 4;
                    var foo5 = 5;
                    var foo6 = 6;
                    var foo7 = 7;
                    var foo8 = 8;
                    var foo9 = 9;
                    var foo10 = 10;
                    return function () {
                  
                      // The number of statements in the inner function does not count toward the
                      // statement maximum.
                  
                      return 42;
                    };
                  }
                  
                  let foo = () => {
                    var foo1 = 1;
                    var foo2 = 2;
                    var foo3 = 3;
                    var foo4 = 4;
                    var foo5 = 5;
                    var foo6 = 6;
                    var foo7 = 7;
                    var foo8 = 8;
                    var foo9 = 9;
                    var foo10 = 10;
                    return function () {
                  
                      // The number of statements in the inner function does not count toward the
                      // statement maximum.
                  
                      return 42;
                    };
                  }

                  ignoreTopLevelFunctions

                  Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

                  /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
                  
                  function foo() {
                    var foo1 = 1;
                    var foo2 = 2;
                    var foo3 = 3;
                    var foo4 = 4;
                    var foo5 = 5;
                    var foo6 = 6;
                    var foo7 = 7;
                    var foo8 = 8;
                    var foo9 = 9;
                    var foo10 = 10;
                    var foo11 = 11;
                  }

                  Related Rules

                  • [complexity](complexity.md)
                  • [max-depth](max-depth.md)
                  • [max-len](max-len.md)
                  • [max-nested-callbacks](max-nested-callbacks.md)
                  • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

                  Function dialog has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      $.wysiwyg.dialog = function (jWysiwyg, opts) {
                          
                          var theme    = (jWysiwyg && jWysiwyg.options && jWysiwyg.options.dialog) ? jWysiwyg.options.dialog : (opts.theme ? opts.theme : "default"),
                              obj        = new $.wysiwyg.dialog.createDialog(theme),
                              that    = this,
                  Severity: Minor
                  Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 2 hrs to fix

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

                                    exec: function () {
                                        var elementHeight;
                    
                                        if (this.options.resizeOptions && $.fn.resizable) {
                                            elementHeight = this.element.height();
                    Severity: Minor
                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 2 hrs to fix

                      Function table has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.wysiwyg.controls.table = function (Wysiwyg) {
                              var adialog, dialog, colCount, rowCount, formTableHtml, dialogReplacements, key, translation, regexp;
                      
                              dialogReplacements = {
                                  legend: "Insert table",
                      Severity: Minor
                      Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

                        Function checkTargets has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                this.ui.checkTargets = function (element) {
                                    var self = this.self;
                        
                                    //activate controls
                                    $.each(self.options.controls, function (name, control) {
                        Severity: Minor
                        Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

                          Function has a complexity of 8.
                          Open

                              var insertTable = function (colCount, rowCount, filler) {

                          Limit Cyclomatic Complexity (complexity)

                          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                          function a(x) {
                              if (true) {
                                  return x; // 1st path
                              } else if (false) {
                                  return x+1; // 2nd path
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Rule Details

                          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                          Examples of incorrect code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else if (false) {
                                  return x+1;
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Examples of correct code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else {
                                  return 4;
                              }
                          }

                          Options

                          Optionally, you may specify a max object property:

                          "complexity": ["error", 2]

                          is equivalent to

                          "complexity": ["error", { "max": 2 }]

                          Deprecated: the object property maximum is deprecated. Please use the property max instead.

                          When Not To Use It

                          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                          Further Reading

                          Related Rules

                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md)
                          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                          Method 'domTraversing' has too many statements (32). Maximum allowed is 30.
                          Open

                                  domTraversing: function (el, start, end, canRemove, cnt) {

                          enforce a maximum number of statements allowed in function blocks (max-statements)

                          The max-statements rule allows you to specify the maximum number of statements allowed in a function.

                          function foo() {
                            var bar = 1; // one statement
                            var baz = 2; // two statements
                            var qux = 3; // three statements
                          }

                          Rule Details

                          This rule enforces a maximum number of statements allowed in function blocks.

                          Options

                          This rule has a number or object option:

                          • "max" (default 10) enforces a maximum number of statements allows in function blocks

                          Deprecated: The object property maximum is deprecated; please use the object property max instead.

                          This rule has an object option:

                          • "ignoreTopLevelFunctions": true ignores top-level functions

                          max

                          Examples of incorrect code for this rule with the default { "max": 10 } option:

                          /*eslint max-statements: ["error", 10]*/
                          /*eslint-env es6*/
                          
                          function foo() {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                          
                            var foo11 = 11; // Too many.
                          }
                          
                          let foo = () => {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                          
                            var foo11 = 11; // Too many.
                          };

                          Examples of correct code for this rule with the default { "max": 10 } option:

                          /*eslint max-statements: ["error", 10]*/
                          /*eslint-env es6*/
                          
                          function foo() {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                            return function () {
                          
                              // The number of statements in the inner function does not count toward the
                              // statement maximum.
                          
                              return 42;
                            };
                          }
                          
                          let foo = () => {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                            return function () {
                          
                              // The number of statements in the inner function does not count toward the
                              // statement maximum.
                          
                              return 42;
                            };
                          }

                          ignoreTopLevelFunctions

                          Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

                          /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
                          
                          function foo() {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                            var foo11 = 11;
                          }

                          Related Rules

                          • [complexity](complexity.md)
                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

                          Function has a complexity of 8.
                          Open

                                  this.insertHtml = function (szHTML) {

                          Limit Cyclomatic Complexity (complexity)

                          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                          function a(x) {
                              if (true) {
                                  return x; // 1st path
                              } else if (false) {
                                  return x+1; // 2nd path
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Rule Details

                          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                          Examples of incorrect code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else if (false) {
                                  return x+1;
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Examples of correct code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else {
                                  return 4;
                              }
                          }

                          Options

                          Optionally, you may specify a max object property:

                          "complexity": ["error", 2]

                          is equivalent to

                          "complexity": ["error", { "max": 2 }]

                          Deprecated: the object property maximum is deprecated. Please use the property max instead.

                          When Not To Use It

                          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                          Further Reading

                          Related Rules

                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md)
                          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                          Function has a complexity of 7.
                          Open

                                  this.ui.returnRange = function () {

                          Limit Cyclomatic Complexity (complexity)

                          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                          function a(x) {
                              if (true) {
                                  return x; // 1st path
                              } else if (false) {
                                  return x+1; // 2nd path
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Rule Details

                          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                          Examples of incorrect code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else if (false) {
                                  return x+1;
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Examples of correct code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else {
                                  return 4;
                              }
                          }

                          Options

                          Optionally, you may specify a max object property:

                          "complexity": ["error", 2]

                          is equivalent to

                          "complexity": ["error", { "max": 2 }]

                          Deprecated: the object property maximum is deprecated. Please use the property max instead.

                          When Not To Use It

                          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                          Further Reading

                          Related Rules

                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md)
                          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                          Method 'exec' has a complexity of 7.
                          Open

                                          exec: function () {

                          Limit Cyclomatic Complexity (complexity)

                          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                          function a(x) {
                              if (true) {
                                  return x; // 1st path
                              } else if (false) {
                                  return x+1; // 2nd path
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Rule Details

                          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                          Examples of incorrect code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else if (false) {
                                  return x+1;
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Examples of correct code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else {
                                  return 4;
                              }
                          }

                          Options

                          Optionally, you may specify a max object property:

                          "complexity": ["error", 2]

                          is equivalent to

                          "complexity": ["error", { "max": 2 }]

                          Deprecated: the object property maximum is deprecated. Please use the property max instead.

                          When Not To Use It

                          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                          Further Reading

                          Related Rules

                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md)
                          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                          Function has a complexity of 7.
                          Open

                                      setInterval(function () {

                          Limit Cyclomatic Complexity (complexity)

                          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                          function a(x) {
                              if (true) {
                                  return x; // 1st path
                              } else if (false) {
                                  return x+1; // 2nd path
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Rule Details

                          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                          Examples of incorrect code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else if (false) {
                                  return x+1;
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Examples of correct code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else {
                                  return 4;
                              }
                          }

                          Options

                          Optionally, you may specify a max object property:

                          "complexity": ["error", 2]

                          is equivalent to

                          "complexity": ["error", { "max": 2 }]

                          Deprecated: the object property maximum is deprecated. Please use the property max instead.

                          When Not To Use It

                          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                          Further Reading

                          Related Rules

                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md)
                          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                          Function has a complexity of 7.
                          Open

                                  return object.each(function () {

                          Limit Cyclomatic Complexity (complexity)

                          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                          function a(x) {
                              if (true) {
                                  return x; // 1st path
                              } else if (false) {
                                  return x+1; // 2nd path
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Rule Details

                          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                          Examples of incorrect code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else if (false) {
                                  return x+1;
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Examples of correct code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else {
                                  return 4;
                              }
                          }

                          Options

                          Optionally, you may specify a max object property:

                          "complexity": ["error", 2]

                          is equivalent to

                          "complexity": ["error", { "max": 2 }]

                          Deprecated: the object property maximum is deprecated. Please use the property max instead.

                          When Not To Use It

                          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                          Further Reading

                          Related Rules

                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md)
                          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                          Function has a complexity of 7.
                          Open

                                  this.ui.appendItem = function (name, control) {

                          Limit Cyclomatic Complexity (complexity)

                          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                          function a(x) {
                              if (true) {
                                  return x; // 1st path
                              } else if (false) {
                                  return x+1; // 2nd path
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Rule Details

                          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                          Examples of incorrect code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else if (false) {
                                  return x+1;
                              } else {
                                  return 4; // 3rd path
                              }
                          }

                          Examples of correct code for a maximum of 2:

                          /*eslint complexity: ["error", 2]*/
                          
                          function a(x) {
                              if (true) {
                                  return x;
                              } else {
                                  return 4;
                              }
                          }

                          Options

                          Optionally, you may specify a max object property:

                          "complexity": ["error", 2]

                          is equivalent to

                          "complexity": ["error", { "max": 2 }]

                          Deprecated: the object property maximum is deprecated. Please use the property max instead.

                          When Not To Use It

                          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                          Further Reading

                          Related Rules

                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md)
                          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

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

                                  run: function (Wysiwyg, options) {
                                      options = options || {};
                                      this.options = $.extend(true, this.defaults, options);
                          
                                      if (this.options.rules.heading || this.options.rules.table) {
                          Severity: Minor
                          Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

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

                                    domTraversing: function (el, start, end, canRemove, cnt) {
                                        if (null === canRemove) {
                                            canRemove = false;
                                        }
                            
                            
                            Severity: Minor
                            Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

                              Function show has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          this.show = function () {
                              
                                              // Modal feature:
                                              if (this.options.modal) {
                                                  var dimensions = $.wysiwyg.dialog.getDimensions(),
                              Severity: Minor
                              Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

                                Function saveContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        this.saveContent = function () {
                                            if (this.viewHTML)
                                            {
                                                return; // no need
                                            }
                                Severity: Minor
                                Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

                                  Function insertHtml has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          this.insertHtml = function (szHTML) {
                                              var img, range;
                                  
                                              if (!szHTML || szHTML.length === 0) {
                                                  return this;
                                  Severity: Minor
                                  Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

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

                                                this.init = function() {
                                                    var abstractDialog    = this,
                                                        content         = this.options.content;
                                    
                                                    if (typeof content === 'object') {
                                    Severity: Minor
                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

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

                                              this.ui.appendItem = function (name, control) {
                                                  var self = this.self,
                                                      className = control.className || control.command || name || "empty",
                                                      tooltip = control.tooltip || control.command || name || "";
                                      
                                      
                                      Severity: Minor
                                      Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

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

                                                this.dom.w3c.getElement = function (filterTagName) {
                                                    var dom        = this.parent,
                                                        range    = dom.parent.getInternalRange(),
                                                        element;
                                                        
                                        Severity: Minor
                                        Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 1 hr to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if (rules.rmAttr) {
                                                                      if ("all" === rules.rmAttr) {
                                                                          attrs = "";
                                                                      } else if ("object" === typeof (rules.rmAttr) && attrs) {
                                                                          for (attrName in rules.rmAttr) {
                                          Severity: Major
                                          Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                            if ("object" === typeof (self.options.plugins.rmFormat.rmMsWordMarkup)) {
                                                                                $.wysiwyg.rmFormat.run(self, {rules: { msWordMarkup: self.options.plugins.rmFormat.rmMsWordMarkup }});
                                                                            } else {
                                                                                $.wysiwyg.rmFormat.run(self, {rules: { msWordMarkup: { enabled: true }}});
                                                                            }
                                            Severity: Major
                                            Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                          if (Wysiwyg.options.controlLink.forceRelativeUrls) {
                                                                              baseUrl = window.location.protocol + "//" + window.location.hostname;
                                                                              if (0 === url.indexOf(baseUrl)) {
                                                                                  url = url.substr(baseUrl.length);
                                                                              }
                                              Severity: Major
                                              Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                            if (this.debug) { console.log("p", p); }
                                                Severity: Major
                                                Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          if (found && found[1]) {
                                                                              attrs = found[1];
                                                                          }
                                                  Severity: Major
                                                  Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                            if (attrs) {
                                                                                attrs = attrs.replace(/[\s\n]+/gm, " ");
                                                                                
                                                                                if (" " === attrs) {
                                                                                    attrs = "";
                                                    Severity: Major
                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                                              if (url.length > 0) {
                                                                                                  Wysiwyg.editorDoc.execCommand("createLink", false, url);
                                                                                              } else {
                                                                                                  Wysiwyg.editorDoc.execCommand("unlink", false, null);
                                                                                              }
                                                      Severity: Major
                                                      Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                    while (found) {
                                                                                        text = text.replace(reg, found[1]);
                                                        
                                                                                        found = reg.exec(text);
                                                                                    }
                                                        Severity: Major
                                                        Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                                          if (event.keyCode === self.controls[controlName].hotkey.key) {
                                                                                              self.triggerControl.apply(self, [controlName, self.controls[controlName]]);
                                                          
                                                                                              return false;
                                                                                          }
                                                          Severity: Major
                                                          Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                            for (i = 0; i < this.attributes.length; i += 1) {
                                                                                                p.attr(this.attributes[i].name, element.attr(this.attributes[i].name));
                                                                                            }
                                                            Severity: Major
                                                            Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                          if ("string" === typeof (url)) {
                                                                                              if (url.length > 0) {
                                                                                                  Wysiwyg.editorDoc.execCommand("createLink", false, url);
                                                                                              } else {
                                                                                                  Wysiwyg.editorDoc.execCommand("unlink", false, null);
                                                              Severity: Major
                                                              Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 45 mins to fix

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

                                                                        domTraversing: function (el, start, end, canRemove, cnt) {
                                                                Severity: Minor
                                                                Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 35 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                              return null;
                                                                  Severity: Major
                                                                  Found in public/assets/js/core/jwysiwyg/jwysiwyg.js - About 30 mins to fix

                                                                    Unexpected alert.
                                                                    Open

                                                                                                        window.alert(Wysiwyg.options.messages.nonSelection);

                                                                    Disallow Use of Alert (no-alert)

                                                                    JavaScript's alert, confirm, and prompt functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation. Furthermore, alert is often used while debugging code, which should be removed before deployment to production.

                                                                    alert("here!");

                                                                    Rule Details

                                                                    This rule is aimed at catching debugging code that should be removed and popup UI elements that should be replaced with less obtrusive, custom UIs. As such, it will warn when it encounters alert, prompt, and confirm function calls which are not shadowed.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    alert("here!");
                                                                    
                                                                    confirm("Are you sure?");
                                                                    
                                                                    prompt("What's your name?", "John Doe");

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    customAlert("Something happened!");
                                                                    
                                                                    customConfirm("Are you sure?");
                                                                    
                                                                    customPrompt("Who are you?");
                                                                    
                                                                    function foo() {
                                                                        var alert = myCustomLib.customAlert;
                                                                        alert();
                                                                    }

                                                                    Related Rules

                                                                    Unexpected alert.
                                                                    Open

                                                                                            window.alert(Wysiwyg.options.messages.nonSelection);

                                                                    Disallow Use of Alert (no-alert)

                                                                    JavaScript's alert, confirm, and prompt functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation. Furthermore, alert is often used while debugging code, which should be removed before deployment to production.

                                                                    alert("here!");

                                                                    Rule Details

                                                                    This rule is aimed at catching debugging code that should be removed and popup UI elements that should be replaced with less obtrusive, custom UIs. As such, it will warn when it encounters alert, prompt, and confirm function calls which are not shadowed.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    alert("here!");
                                                                    
                                                                    confirm("Are you sure?");
                                                                    
                                                                    prompt("What's your name?", "John Doe");

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    customAlert("Something happened!");
                                                                    
                                                                    customConfirm("Are you sure?");
                                                                    
                                                                    customPrompt("Who are you?");
                                                                    
                                                                    function foo() {
                                                                        var alert = myCustomLib.customAlert;
                                                                        alert();
                                                                    }

                                                                    Related Rules

                                                                    unnecessary '.apply()'.
                                                                    Open

                                                                                                        self.triggerControl.apply(self, [controlName, self.controls[controlName]]);

                                                                    Disallow unnecessary .call() and .apply(). (no-useless-call)

                                                                    The function invocation can be written by Function.prototype.call() and Function.prototype.apply(). But Function.prototype.call() and Function.prototype.apply() are slower than the normal function invocation.

                                                                    Rule Details

                                                                    This rule is aimed to flag usage of Function.prototype.call() and Function.prototype.apply() that can be replaced with the normal function invocation.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // These are same as `foo(1, 2, 3);`
                                                                    foo.call(undefined, 1, 2, 3);
                                                                    foo.apply(undefined, [1, 2, 3]);
                                                                    foo.call(null, 1, 2, 3);
                                                                    foo.apply(null, [1, 2, 3]);
                                                                    
                                                                    // These are same as `obj.foo(1, 2, 3);`
                                                                    obj.foo.call(obj, 1, 2, 3);
                                                                    obj.foo.apply(obj, [1, 2, 3]);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // The `this` binding is different.
                                                                    foo.call(obj, 1, 2, 3);
                                                                    foo.apply(obj, [1, 2, 3]);
                                                                    obj.foo.call(null, 1, 2, 3);
                                                                    obj.foo.apply(null, [1, 2, 3]);
                                                                    obj.foo.call(otherObj, 1, 2, 3);
                                                                    obj.foo.apply(otherObj, [1, 2, 3]);
                                                                    
                                                                    // The argument list is variadic.
                                                                    foo.apply(undefined, args);
                                                                    foo.apply(null, args);
                                                                    obj.foo.apply(obj, args);

                                                                    Known Limitations

                                                                    This rule compares code statically to check whether or not thisArg is changed. So if the code about thisArg is a dynamic expression, this rule cannot judge correctly.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[i++].foo.call(a[i++], 1, 2, 3);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[++i].foo.call(a[i], 1, 2, 3);

                                                                    When Not To Use It

                                                                    If you don't want to be notified about unnecessary .call() and .apply(), you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                    The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                    Open

                                                                                    for (tagName in this.options.rules.msWordMarkup.tags) {

                                                                    Require Guarding for-in (guard-for-in)

                                                                    Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                    for (key in foo) {
                                                                        doSomething(key);
                                                                    }

                                                                    Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                    Rule Details

                                                                    This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint guard-for-in: "error"*/
                                                                    
                                                                    for (key in foo) {
                                                                        doSomething(key);
                                                                    }

                                                                    Examples of correct code for this rule:

                                                                    /*eslint guard-for-in: "error"*/
                                                                    
                                                                    for (key in foo) {
                                                                        if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                            doSomething(key);
                                                                        }
                                                                        if ({}.hasOwnProperty.call(foo, key)) {
                                                                            doSomething(key);
                                                                        }
                                                                    }

                                                                    Related Rules

                                                                    • [no-prototype-builtins](no-prototype-builtins.md)

                                                                    Further Reading

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                    if (offset && offset.width == 0 && !self.editorDoc.rememberCommand) {

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                        var dialogHeight = this.options.height == 'auto' ? 300 : this.options.height,

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                    Open

                                                                                    for (tagName in this.options.rules.msWordMarkup.tags) {

                                                                    Require Guarding for-in (guard-for-in)

                                                                    Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                    for (key in foo) {
                                                                        doSomething(key);
                                                                    }

                                                                    Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                    Rule Details

                                                                    This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint guard-for-in: "error"*/
                                                                    
                                                                    for (key in foo) {
                                                                        doSomething(key);
                                                                    }

                                                                    Examples of correct code for this rule:

                                                                    /*eslint guard-for-in: "error"*/
                                                                    
                                                                    for (key in foo) {
                                                                        if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                            doSomething(key);
                                                                        }
                                                                        if ({}.hasOwnProperty.call(foo, key)) {
                                                                            doSomething(key);
                                                                        }
                                                                    }

                                                                    Related Rules

                                                                    • [no-prototype-builtins](no-prototype-builtins.md)

                                                                    Further Reading

                                                                    Unexpected alert.
                                                                    Open

                                                                                    window.alert(oWysiwyg.options.messages.nonSelection);

                                                                    Disallow Use of Alert (no-alert)

                                                                    JavaScript's alert, confirm, and prompt functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation. Furthermore, alert is often used while debugging code, which should be removed before deployment to production.

                                                                    alert("here!");

                                                                    Rule Details

                                                                    This rule is aimed at catching debugging code that should be removed and popup UI elements that should be replaced with less obtrusive, custom UIs. As such, it will warn when it encounters alert, prompt, and confirm function calls which are not shadowed.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    alert("here!");
                                                                    
                                                                    confirm("Are you sure?");
                                                                    
                                                                    prompt("What's your name?", "John Doe");

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    customAlert("Something happened!");
                                                                    
                                                                    customConfirm("Are you sure?");
                                                                    
                                                                    customPrompt("Who are you?");
                                                                    
                                                                    function foo() {
                                                                        var alert = myCustomLib.customAlert;
                                                                        alert();
                                                                    }

                                                                    Related Rules

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                        if(element.previousSibiling.tagName.toLowerCase() == filterTagName) {

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                        if(element.nextSibling.tagName.toLowerCase() == filterTagName) {

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    Unexpected prompt.
                                                                    Open

                                                                                        url = window.prompt("URL", a.href);

                                                                    Disallow Use of Alert (no-alert)

                                                                    JavaScript's alert, confirm, and prompt functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation. Furthermore, alert is often used while debugging code, which should be removed before deployment to production.

                                                                    alert("here!");

                                                                    Rule Details

                                                                    This rule is aimed at catching debugging code that should be removed and popup UI elements that should be replaced with less obtrusive, custom UIs. As such, it will warn when it encounters alert, prompt, and confirm function calls which are not shadowed.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    alert("here!");
                                                                    
                                                                    confirm("Are you sure?");
                                                                    
                                                                    prompt("What's your name?", "John Doe");

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    customAlert("Something happened!");
                                                                    
                                                                    customConfirm("Are you sure?");
                                                                    
                                                                    customPrompt("Who are you?");
                                                                    
                                                                    function foo() {
                                                                        var alert = myCustomLib.customAlert;
                                                                        alert();
                                                                    }

                                                                    Related Rules

                                                                    Empty block statement.
                                                                    Open

                                                                                        } catch (e) {

                                                                    disallow empty block statements (no-empty)

                                                                    Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.

                                                                    Rule Details

                                                                    This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty catch or finally block of a try statement to indicate that execution should continue regardless of errors).

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-empty: "error"*/
                                                                    
                                                                    if (foo) {
                                                                    }
                                                                    
                                                                    while (foo) {
                                                                    }
                                                                    
                                                                    switch(foo) {
                                                                    }
                                                                    
                                                                    try {
                                                                        doSomething();
                                                                    } catch(ex) {
                                                                    
                                                                    } finally {
                                                                    
                                                                    }

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-empty: "error"*/
                                                                    
                                                                    if (foo) {
                                                                        // empty
                                                                    }
                                                                    
                                                                    while (foo) {
                                                                        /* empty */
                                                                    }
                                                                    
                                                                    try {
                                                                        doSomething();
                                                                    } catch (ex) {
                                                                        // continue regardless of error
                                                                    }
                                                                    
                                                                    try {
                                                                        doSomething();
                                                                    } finally {
                                                                        /* continue regardless of error */
                                                                    }

                                                                    Options

                                                                    This rule has an object option for exceptions:

                                                                    • "allowEmptyCatch": true allows empty catch clauses (that is, which do not contain a comment)

                                                                    allowEmptyCatch

                                                                    Examples of additional correct code for this rule with the { "allowEmptyCatch": true } option:

                                                                    /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
                                                                    try {
                                                                        doSomething();
                                                                    } catch (ex) {}
                                                                    
                                                                    try {
                                                                        doSomething();
                                                                    }
                                                                    catch (ex) {}
                                                                    finally {
                                                                        /* continue regardless of error */
                                                                    }

                                                                    When Not To Use It

                                                                    If you intentionally use empty block statements then you can disable this rule.

                                                                    Related Rules

                                                                    Expected '!==' and instead saw '!='.
                                                                    Open

                                                                                while (element && typeof element.tagName != "undefined" && "body" !== element.tagName.toLowerCase()) {

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    unnecessary '.apply()'.
                                                                    Open

                                                                                                $.wysiwyg[event.data.plugin.name][event.data.plugin.method].apply($.wysiwyg[event.data.plugin.name], [Wysiwyg]);

                                                                    Disallow unnecessary .call() and .apply(). (no-useless-call)

                                                                    The function invocation can be written by Function.prototype.call() and Function.prototype.apply(). But Function.prototype.call() and Function.prototype.apply() are slower than the normal function invocation.

                                                                    Rule Details

                                                                    This rule is aimed to flag usage of Function.prototype.call() and Function.prototype.apply() that can be replaced with the normal function invocation.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // These are same as `foo(1, 2, 3);`
                                                                    foo.call(undefined, 1, 2, 3);
                                                                    foo.apply(undefined, [1, 2, 3]);
                                                                    foo.call(null, 1, 2, 3);
                                                                    foo.apply(null, [1, 2, 3]);
                                                                    
                                                                    // These are same as `obj.foo(1, 2, 3);`
                                                                    obj.foo.call(obj, 1, 2, 3);
                                                                    obj.foo.apply(obj, [1, 2, 3]);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // The `this` binding is different.
                                                                    foo.call(obj, 1, 2, 3);
                                                                    foo.apply(obj, [1, 2, 3]);
                                                                    obj.foo.call(null, 1, 2, 3);
                                                                    obj.foo.apply(null, [1, 2, 3]);
                                                                    obj.foo.call(otherObj, 1, 2, 3);
                                                                    obj.foo.apply(otherObj, [1, 2, 3]);
                                                                    
                                                                    // The argument list is variadic.
                                                                    foo.apply(undefined, args);
                                                                    foo.apply(null, args);
                                                                    obj.foo.apply(obj, args);

                                                                    Known Limitations

                                                                    This rule compares code statically to check whether or not thisArg is changed. So if the code about thisArg is a dynamic expression, this rule cannot judge correctly.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[i++].foo.call(a[i++], 1, 2, 3);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[++i].foo.call(a[i], 1, 2, 3);

                                                                    When Not To Use It

                                                                    If you don't want to be notified about unnecessary .call() and .apply(), you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                    unnecessary '.apply()'.
                                                                    Open

                                                                                    oWysiwyg.triggerControl.apply(oWysiwyg, [controlName, oWysiwyg.controls[controlName]]);

                                                                    Disallow unnecessary .call() and .apply(). (no-useless-call)

                                                                    The function invocation can be written by Function.prototype.call() and Function.prototype.apply(). But Function.prototype.call() and Function.prototype.apply() are slower than the normal function invocation.

                                                                    Rule Details

                                                                    This rule is aimed to flag usage of Function.prototype.call() and Function.prototype.apply() that can be replaced with the normal function invocation.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // These are same as `foo(1, 2, 3);`
                                                                    foo.call(undefined, 1, 2, 3);
                                                                    foo.apply(undefined, [1, 2, 3]);
                                                                    foo.call(null, 1, 2, 3);
                                                                    foo.apply(null, [1, 2, 3]);
                                                                    
                                                                    // These are same as `obj.foo(1, 2, 3);`
                                                                    obj.foo.call(obj, 1, 2, 3);
                                                                    obj.foo.apply(obj, [1, 2, 3]);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // The `this` binding is different.
                                                                    foo.call(obj, 1, 2, 3);
                                                                    foo.apply(obj, [1, 2, 3]);
                                                                    obj.foo.call(null, 1, 2, 3);
                                                                    obj.foo.apply(null, [1, 2, 3]);
                                                                    obj.foo.call(otherObj, 1, 2, 3);
                                                                    obj.foo.apply(otherObj, [1, 2, 3]);
                                                                    
                                                                    // The argument list is variadic.
                                                                    foo.apply(undefined, args);
                                                                    foo.apply(null, args);
                                                                    obj.foo.apply(obj, args);

                                                                    Known Limitations

                                                                    This rule compares code statically to check whether or not thisArg is changed. So if the code about thisArg is a dynamic expression, this rule cannot judge correctly.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[i++].foo.call(a[i++], 1, 2, 3);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[++i].foo.call(a[i], 1, 2, 3);

                                                                    When Not To Use It

                                                                    If you don't want to be notified about unnecessary .call() and .apply(), you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                        if(element.nextSibling.tagName.toLowerCase() == filterTagName) {

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                            dialogWidth = this.options.width == 'auto' ? 450 : this.options.width;

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                        if(element.previousSibling.tagName.toLowerCase() == filterTagName) {

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    unnecessary '.apply()'.
                                                                    Open

                                                                                        self.triggerControl.apply(self, [name, control]);

                                                                    Disallow unnecessary .call() and .apply(). (no-useless-call)

                                                                    The function invocation can be written by Function.prototype.call() and Function.prototype.apply(). But Function.prototype.call() and Function.prototype.apply() are slower than the normal function invocation.

                                                                    Rule Details

                                                                    This rule is aimed to flag usage of Function.prototype.call() and Function.prototype.apply() that can be replaced with the normal function invocation.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // These are same as `foo(1, 2, 3);`
                                                                    foo.call(undefined, 1, 2, 3);
                                                                    foo.apply(undefined, [1, 2, 3]);
                                                                    foo.call(null, 1, 2, 3);
                                                                    foo.apply(null, [1, 2, 3]);
                                                                    
                                                                    // These are same as `obj.foo(1, 2, 3);`
                                                                    obj.foo.call(obj, 1, 2, 3);
                                                                    obj.foo.apply(obj, [1, 2, 3]);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // The `this` binding is different.
                                                                    foo.call(obj, 1, 2, 3);
                                                                    foo.apply(obj, [1, 2, 3]);
                                                                    obj.foo.call(null, 1, 2, 3);
                                                                    obj.foo.apply(null, [1, 2, 3]);
                                                                    obj.foo.call(otherObj, 1, 2, 3);
                                                                    obj.foo.apply(otherObj, [1, 2, 3]);
                                                                    
                                                                    // The argument list is variadic.
                                                                    foo.apply(undefined, args);
                                                                    foo.apply(null, args);
                                                                    obj.foo.apply(obj, args);

                                                                    Known Limitations

                                                                    This rule compares code statically to check whether or not thisArg is changed. So if the code about thisArg is a dynamic expression, this rule cannot judge correctly.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[i++].foo.call(a[i++], 1, 2, 3);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[++i].foo.call(a[i], 1, 2, 3);

                                                                    When Not To Use It

                                                                    If you don't want to be notified about unnecessary .call() and .apply(), you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                    Unexpected prompt.
                                                                    Open

                                                                                                url = window.prompt(dialogReplacements.url, a.href);

                                                                    Disallow Use of Alert (no-alert)

                                                                    JavaScript's alert, confirm, and prompt functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation. Furthermore, alert is often used while debugging code, which should be removed before deployment to production.

                                                                    alert("here!");

                                                                    Rule Details

                                                                    This rule is aimed at catching debugging code that should be removed and popup UI elements that should be replaced with less obtrusive, custom UIs. As such, it will warn when it encounters alert, prompt, and confirm function calls which are not shadowed.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    alert("here!");
                                                                    
                                                                    confirm("Are you sure?");
                                                                    
                                                                    prompt("What's your name?", "John Doe");

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-alert: "error"*/
                                                                    
                                                                    customAlert("Something happened!");
                                                                    
                                                                    customConfirm("Are you sure?");
                                                                    
                                                                    customPrompt("Who are you?");
                                                                    
                                                                    function foo() {
                                                                        var alert = myCustomLib.customAlert;
                                                                        alert();
                                                                    }

                                                                    Related Rules

                                                                    Empty block statement.
                                                                    Open

                                                                                        } catch (e2) {

                                                                    disallow empty block statements (no-empty)

                                                                    Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.

                                                                    Rule Details

                                                                    This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty catch or finally block of a try statement to indicate that execution should continue regardless of errors).

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-empty: "error"*/
                                                                    
                                                                    if (foo) {
                                                                    }
                                                                    
                                                                    while (foo) {
                                                                    }
                                                                    
                                                                    switch(foo) {
                                                                    }
                                                                    
                                                                    try {
                                                                        doSomething();
                                                                    } catch(ex) {
                                                                    
                                                                    } finally {
                                                                    
                                                                    }

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-empty: "error"*/
                                                                    
                                                                    if (foo) {
                                                                        // empty
                                                                    }
                                                                    
                                                                    while (foo) {
                                                                        /* empty */
                                                                    }
                                                                    
                                                                    try {
                                                                        doSomething();
                                                                    } catch (ex) {
                                                                        // continue regardless of error
                                                                    }
                                                                    
                                                                    try {
                                                                        doSomething();
                                                                    } finally {
                                                                        /* continue regardless of error */
                                                                    }

                                                                    Options

                                                                    This rule has an object option for exceptions:

                                                                    • "allowEmptyCatch": true allows empty catch clauses (that is, which do not contain a comment)

                                                                    allowEmptyCatch

                                                                    Examples of additional correct code for this rule with the { "allowEmptyCatch": true } option:

                                                                    /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
                                                                    try {
                                                                        doSomething();
                                                                    } catch (ex) {}
                                                                    
                                                                    try {
                                                                        doSomething();
                                                                    }
                                                                    catch (ex) {}
                                                                    finally {
                                                                        /* continue regardless of error */
                                                                    }

                                                                    When Not To Use It

                                                                    If you intentionally use empty block statements then you can disable this rule.

                                                                    Related Rules

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                    var dialogHeight = this.options.height == 'auto' ? 300 : this.options.height,

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    Expected '===' and instead saw '=='.
                                                                    Open

                                                                                        dialogWidth = this.options.width == 'auto' ? 450 : this.options.width;

                                                                    Require === and !== (eqeqeq)

                                                                    It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                    The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                    • [] == false
                                                                    • [] == ![]
                                                                    • 3 == "03"

                                                                    If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                    Rule Details

                                                                    This rule is aimed at eliminating the type-unsafe equality operators.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint eqeqeq: "error"*/
                                                                    
                                                                    if (x == 42) { }
                                                                    
                                                                    if ("" == text) { }
                                                                    
                                                                    if (obj.getStuff() != undefined) { }

                                                                    The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                    Options

                                                                    always

                                                                    The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                    Examples of incorrect code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a == b
                                                                    foo == true
                                                                    bananas != 1
                                                                    value == undefined
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    Examples of correct code for the "always" option:

                                                                    /*eslint eqeqeq: ["error", "always"]*/
                                                                    
                                                                    a === b
                                                                    foo === true
                                                                    bananas !== 1
                                                                    value === undefined
                                                                    typeof foo === 'undefined'
                                                                    'hello' !== 'world'
                                                                    0 === 0
                                                                    true === true
                                                                    foo === null

                                                                    This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                    • "null": Customize how this rule treats null literals. Possible values:
                                                                      • always (default) - Always use === or !==.
                                                                      • never - Never use === or !== with null.
                                                                      • ignore - Do not apply this rule to null.

                                                                    smart

                                                                    The "smart" option enforces the use of === and !== except for these cases:

                                                                    • Comparing two literal values
                                                                    • Evaluating the value of typeof
                                                                    • Comparing against null

                                                                    Examples of incorrect code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    // comparing two variables requires ===
                                                                    a == b
                                                                    
                                                                    // only one side is a literal
                                                                    foo == true
                                                                    bananas != 1
                                                                    
                                                                    // comparing to undefined requires ===
                                                                    value == undefined

                                                                    Examples of correct code for the "smart" option:

                                                                    /*eslint eqeqeq: ["error", "smart"]*/
                                                                    
                                                                    typeof foo == 'undefined'
                                                                    'hello' != 'world'
                                                                    0 == 0
                                                                    true == true
                                                                    foo == null

                                                                    allow-null

                                                                    Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                    ["error", "always", {"null": "ignore"}]

                                                                    When Not To Use It

                                                                    If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                    unnecessary '.apply()'.
                                                                    Open

                                                                                        self.triggerControl.apply(self, [name, control]);

                                                                    Disallow unnecessary .call() and .apply(). (no-useless-call)

                                                                    The function invocation can be written by Function.prototype.call() and Function.prototype.apply(). But Function.prototype.call() and Function.prototype.apply() are slower than the normal function invocation.

                                                                    Rule Details

                                                                    This rule is aimed to flag usage of Function.prototype.call() and Function.prototype.apply() that can be replaced with the normal function invocation.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // These are same as `foo(1, 2, 3);`
                                                                    foo.call(undefined, 1, 2, 3);
                                                                    foo.apply(undefined, [1, 2, 3]);
                                                                    foo.call(null, 1, 2, 3);
                                                                    foo.apply(null, [1, 2, 3]);
                                                                    
                                                                    // These are same as `obj.foo(1, 2, 3);`
                                                                    obj.foo.call(obj, 1, 2, 3);
                                                                    obj.foo.apply(obj, [1, 2, 3]);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    // The `this` binding is different.
                                                                    foo.call(obj, 1, 2, 3);
                                                                    foo.apply(obj, [1, 2, 3]);
                                                                    obj.foo.call(null, 1, 2, 3);
                                                                    obj.foo.apply(null, [1, 2, 3]);
                                                                    obj.foo.call(otherObj, 1, 2, 3);
                                                                    obj.foo.apply(otherObj, [1, 2, 3]);
                                                                    
                                                                    // The argument list is variadic.
                                                                    foo.apply(undefined, args);
                                                                    foo.apply(null, args);
                                                                    obj.foo.apply(obj, args);

                                                                    Known Limitations

                                                                    This rule compares code statically to check whether or not thisArg is changed. So if the code about thisArg is a dynamic expression, this rule cannot judge correctly.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[i++].foo.call(a[i++], 1, 2, 3);

                                                                    Examples of correct code for this rule:

                                                                    /*eslint no-useless-call: "error"*/
                                                                    
                                                                    a[++i].foo.call(a[i], 1, 2, 3);

                                                                    When Not To Use It

                                                                    If you don't want to be notified about unnecessary .call() and .apply(), you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                    The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                    Open

                                                                                                    for (attrName in rules.rmAttr) {

                                                                    Require Guarding for-in (guard-for-in)

                                                                    Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                    for (key in foo) {
                                                                        doSomething(key);
                                                                    }

                                                                    Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                    Rule Details

                                                                    This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                    Examples of incorrect code for this rule:

                                                                    /*eslint guard-for-in: "error"*/
                                                                    
                                                                    for (key in foo) {
                                                                        doSomething(key);
                                                                    }

                                                                    Examples of correct code for this rule:

                                                                    /*eslint guard-for-in: "error"*/
                                                                    
                                                                    for (key in foo) {
                                                                        if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                            doSomething(key);
                                                                        }
                                                                        if ({}.hasOwnProperty.call(foo, key)) {
                                                                            doSomething(key);
                                                                        }
                                                                    }

                                                                    Related Rules

                                                                    • [no-prototype-builtins](no-prototype-builtins.md)

                                                                    Further Reading

                                                                    TODO found
                                                                    Open

                                                                                    // :TODO: checking/replacing

                                                                    TODO found
                                                                    Open

                                                                            // :TODO: you can type long string and letters will be hidden because of overflow

                                                                    TODO found
                                                                    Open

                                                                                            /* :TODO: place caret at the end

                                                                    Move the invocation into the parens that contain the function.
                                                                    Open

                                                                    (function ($) {

                                                                    Require IIFEs to be Wrapped (wrap-iife)

                                                                    You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                    // function expression could be unwrapped
                                                                    var x = function () { return { y: 1 };}();
                                                                    
                                                                    // function declaration must be wrapped
                                                                    function () { /* side effects */ }(); // SyntaxError

                                                                    Rule Details

                                                                    This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                    Options

                                                                    This rule has two options, a string option and an object option.

                                                                    String option:

                                                                    • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                    • "inside" enforces always wrapping the function expression.
                                                                    • "any" enforces always wrapping, but allows either style.

                                                                    Object option:

                                                                    • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                    outside

                                                                    Examples of incorrect code for the default "outside" option:

                                                                    /*eslint wrap-iife: ["error", "outside"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    Examples of correct code for the default "outside" option:

                                                                    /*eslint wrap-iife: ["error", "outside"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                    inside

                                                                    Examples of incorrect code for the "inside" option:

                                                                    /*eslint wrap-iife: ["error", "inside"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                    Examples of correct code for the "inside" option:

                                                                    /*eslint wrap-iife: ["error", "inside"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    any

                                                                    Examples of incorrect code for the "any" option:

                                                                    /*eslint wrap-iife: ["error", "any"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped

                                                                    Examples of correct code for the "any" option:

                                                                    /*eslint wrap-iife: ["error", "any"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    functionPrototypeMethods

                                                                    Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                    /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                    
                                                                    var x = function(){ foo(); }()
                                                                    var x = (function(){ foo(); }())
                                                                    var x = function(){ foo(); }.call(bar)
                                                                    var x = (function(){ foo(); }.call(bar))

                                                                    Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                    /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                    
                                                                    var x = (function(){ foo(); })()
                                                                    var x = (function(){ foo(); }).call(bar)

                                                                    Source: http://eslint.org/docs/rules/

                                                                    Move the invocation into the parens that contain the function.
                                                                    Open

                                                                    (function ($) {

                                                                    Require IIFEs to be Wrapped (wrap-iife)

                                                                    You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                    // function expression could be unwrapped
                                                                    var x = function () { return { y: 1 };}();
                                                                    
                                                                    // function declaration must be wrapped
                                                                    function () { /* side effects */ }(); // SyntaxError

                                                                    Rule Details

                                                                    This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                    Options

                                                                    This rule has two options, a string option and an object option.

                                                                    String option:

                                                                    • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                    • "inside" enforces always wrapping the function expression.
                                                                    • "any" enforces always wrapping, but allows either style.

                                                                    Object option:

                                                                    • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                    outside

                                                                    Examples of incorrect code for the default "outside" option:

                                                                    /*eslint wrap-iife: ["error", "outside"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    Examples of correct code for the default "outside" option:

                                                                    /*eslint wrap-iife: ["error", "outside"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                    inside

                                                                    Examples of incorrect code for the "inside" option:

                                                                    /*eslint wrap-iife: ["error", "inside"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                    Examples of correct code for the "inside" option:

                                                                    /*eslint wrap-iife: ["error", "inside"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    any

                                                                    Examples of incorrect code for the "any" option:

                                                                    /*eslint wrap-iife: ["error", "any"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped

                                                                    Examples of correct code for the "any" option:

                                                                    /*eslint wrap-iife: ["error", "any"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    functionPrototypeMethods

                                                                    Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                    /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                    
                                                                    var x = function(){ foo(); }()
                                                                    var x = (function(){ foo(); }())
                                                                    var x = function(){ foo(); }.call(bar)
                                                                    var x = (function(){ foo(); }.call(bar))

                                                                    Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                    /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                    
                                                                    var x = (function(){ foo(); })()
                                                                    var x = (function(){ foo(); }).call(bar)

                                                                    Source: http://eslint.org/docs/rules/

                                                                    Move the invocation into the parens that contain the function.
                                                                    Open

                                                                    (function ($) {

                                                                    Require IIFEs to be Wrapped (wrap-iife)

                                                                    You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                    // function expression could be unwrapped
                                                                    var x = function () { return { y: 1 };}();
                                                                    
                                                                    // function declaration must be wrapped
                                                                    function () { /* side effects */ }(); // SyntaxError

                                                                    Rule Details

                                                                    This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                    Options

                                                                    This rule has two options, a string option and an object option.

                                                                    String option:

                                                                    • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                    • "inside" enforces always wrapping the function expression.
                                                                    • "any" enforces always wrapping, but allows either style.

                                                                    Object option:

                                                                    • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                    outside

                                                                    Examples of incorrect code for the default "outside" option:

                                                                    /*eslint wrap-iife: ["error", "outside"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    Examples of correct code for the default "outside" option:

                                                                    /*eslint wrap-iife: ["error", "outside"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                    inside

                                                                    Examples of incorrect code for the "inside" option:

                                                                    /*eslint wrap-iife: ["error", "inside"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                    Examples of correct code for the "inside" option:

                                                                    /*eslint wrap-iife: ["error", "inside"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    any

                                                                    Examples of incorrect code for the "any" option:

                                                                    /*eslint wrap-iife: ["error", "any"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped

                                                                    Examples of correct code for the "any" option:

                                                                    /*eslint wrap-iife: ["error", "any"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    functionPrototypeMethods

                                                                    Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                    /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                    
                                                                    var x = function(){ foo(); }()
                                                                    var x = (function(){ foo(); }())
                                                                    var x = function(){ foo(); }.call(bar)
                                                                    var x = (function(){ foo(); }.call(bar))

                                                                    Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                    /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                    
                                                                    var x = (function(){ foo(); })()
                                                                    var x = (function(){ foo(); }).call(bar)

                                                                    Source: http://eslint.org/docs/rules/

                                                                    Move the invocation into the parens that contain the function.
                                                                    Open

                                                                    (function ($) {

                                                                    Require IIFEs to be Wrapped (wrap-iife)

                                                                    You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                    // function expression could be unwrapped
                                                                    var x = function () { return { y: 1 };}();
                                                                    
                                                                    // function declaration must be wrapped
                                                                    function () { /* side effects */ }(); // SyntaxError

                                                                    Rule Details

                                                                    This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                    Options

                                                                    This rule has two options, a string option and an object option.

                                                                    String option:

                                                                    • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                    • "inside" enforces always wrapping the function expression.
                                                                    • "any" enforces always wrapping, but allows either style.

                                                                    Object option:

                                                                    • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                    outside

                                                                    Examples of incorrect code for the default "outside" option:

                                                                    /*eslint wrap-iife: ["error", "outside"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    Examples of correct code for the default "outside" option:

                                                                    /*eslint wrap-iife: ["error", "outside"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                    inside

                                                                    Examples of incorrect code for the "inside" option:

                                                                    /*eslint wrap-iife: ["error", "inside"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                    Examples of correct code for the "inside" option:

                                                                    /*eslint wrap-iife: ["error", "inside"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    any

                                                                    Examples of incorrect code for the "any" option:

                                                                    /*eslint wrap-iife: ["error", "any"]*/
                                                                    
                                                                    var x = function () { return { y: 1 };}(); // unwrapped

                                                                    Examples of correct code for the "any" option:

                                                                    /*eslint wrap-iife: ["error", "any"]*/
                                                                    
                                                                    var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                    var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                    functionPrototypeMethods

                                                                    Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                    /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                    
                                                                    var x = function(){ foo(); }()
                                                                    var x = (function(){ foo(); }())
                                                                    var x = function(){ foo(); }.call(bar)
                                                                    var x = (function(){ foo(); }.call(bar))

                                                                    Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                    /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                    
                                                                    var x = (function(){ foo(); })()
                                                                    var x = (function(){ foo(); }).call(bar)

                                                                    Source: http://eslint.org/docs/rules/

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

                                                                            this.decreaseFontSize = function () {
                                                                                if ($.browser.mozilla || $.browser.opera) {
                                                                                    this.editorDoc.execCommand("decreaseFontSize", false, null);
                                                                                } else if ($.browser.safari) {
                                                                                    var Range = this.getInternalRange(),
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 day to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 1032..1059

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

                                                                    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

                                                                            this.increaseFontSize = function () {
                                                                                if ($.browser.mozilla || $.browser.opera) {
                                                                                    this.editorDoc.execCommand("increaseFontSize", false, null);
                                                                                } else if ($.browser.safari) {                
                                                                                    var Range = this.getInternalRange(),
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 day to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 1061..1088

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

                                                                    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

                                                                                createLink: {
                                                                                    groupIndex: 6,
                                                                                    visible: true,
                                                                                    exec: function () {
                                                                                        var self = this;
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 7 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 255..273

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

                                                                    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

                                                                                insertImage: {
                                                                                    groupIndex: 6,
                                                                                    visible: true,
                                                                                    exec: function () {
                                                                                        var self = this;
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 7 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 52..69

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                for (key in dialogReplacements) {
                                                                                    if ($.wysiwyg.i18n) {
                                                                                        translation = $.wysiwyg.i18n.t(dialogReplacements[key], "dialogs.link");
                                                                    
                                                                                        if (translation === dialogReplacements[key]) { // if not translated search in dialogs 
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 5 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2902..2915

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                            for (key in dialogReplacements) {
                                                                                if ($.wysiwyg.i18n) {
                                                                                    translation = $.wysiwyg.i18n.t(dialogReplacements[key], "dialogs.table");
                                                                    
                                                                                    if (translation === dialogReplacements[key]) { // if not translated search in dialogs 
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 5 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3012..3025

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

                                                                    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(!element.tagName && (element.previousSibiling || element.nextSibling)) {
                                                                                    if(element.previousSibiling) {
                                                                                        if(element.previousSibiling.tagName.toLowerCase() == filterTagName) {
                                                                                            return element.previousSibiling;
                                                                                        }
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 4 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 597..608

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

                                                                    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(!element.tagName && (element.previousSibling || element.nextSibling)) {
                                                                                    if(element.previousSibling) {
                                                                                        if(element.previousSibling.tagName.toLowerCase() == filterTagName) {
                                                                                            return element.previousSibling;
                                                                                        }
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 4 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 668..679

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                h3: {
                                                                                    groupIndex: 7,
                                                                                    visible: true,
                                                                                    className: "h3",
                                                                                    command: ($.browser.msie || $.browser.safari) ? "FormatBlock" : "heading",
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 2 other locations - About 3 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 87..95
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 97..105

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                h2: {
                                                                                    groupIndex: 7,
                                                                                    visible: true,
                                                                                    className: "h2",
                                                                                    command: ($.browser.msie || $.browser.safari)    ? "FormatBlock" : "heading",
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 2 other locations - About 3 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 87..95
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 107..115

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 95.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                h1: {
                                                                                    groupIndex: 7,
                                                                                    visible: true,
                                                                                    className: "h1",
                                                                                    command: ($.browser.msie || $.browser.safari) ? "FormatBlock" : "heading",
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 2 other locations - About 3 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 97..105
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 107..115

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 95.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                                if (Wysiwyg.options.controlLink.forceRelativeUrls) {
                                                                                                    baseUrl = window.location.protocol + "//" + window.location.hostname;
                                                                                                    if (0 === url.indexOf(baseUrl)) {
                                                                                                        url = url.substr(baseUrl.length);
                                                                                                    }
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 2 other locations - About 2 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3137..3142
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3163..3168

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                        if (Wysiwyg.options.controlLink.forceRelativeUrls) {
                                                                                            baseUrl = window.location.protocol + "//" + window.location.hostname;
                                                                                            if (0 === url.indexOf(baseUrl)) {
                                                                                                url = url.substr(baseUrl.length);
                                                                                            }
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 2 other locations - About 2 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3068..3073
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3163..3168

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                                if (Wysiwyg.options.controlLink.forceRelativeUrls) {
                                                                                                    baseUrl = window.location.protocol + "//" + window.location.hostname;
                                                                                                    if (0 === url.indexOf(baseUrl)) {
                                                                                                        url = url.substr(baseUrl.length);
                                                                                                    }
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 2 other locations - About 2 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3068..3073
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3137..3142

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

                                                                    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

                                                                                ltr: {
                                                                                    groupIndex: 10,
                                                                                    visible: false,
                                                                                    exec: function () {
                                                                                        var p = this.dom.getElement("p");
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 2 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 410..424

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

                                                                    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

                                                                                rtl: {
                                                                                    groupIndex: 10,
                                                                                    visible: false,
                                                                                    exec: function () {
                                                                                        var p = this.dom.getElement("p");
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 2 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 357..371

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

                                                                    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 content === 'object') {
                                                                                            if (typeof content.html === 'function') {
                                                                                                content = content.html();
                                                                                            } else if(typeof content.toString === 'function') {
                                                                                                content = content.toString();
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 2 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2321..2328

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 76.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                    if (typeof content === 'object') {
                                                                                        if(typeof content.html === 'function') {
                                                                                            content = content.html();
                                                                                        }
                                                                                        else if(typeof content.toString === 'function') {
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 2 hrs to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2270..2276

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 76.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                            insertHtml: function (object, szHTML) {
                                                                                return object.each(function () {
                                                                                    var oWysiwyg = $(this).data("wysiwyg");
                                                                    
                                                                                    if (!oWysiwyg) {
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2068..2078

                                                                    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

                                                                            setContent: function (object, newContent) {
                                                                                return object.each(function () {
                                                                                    var oWysiwyg = $(this).data("wysiwyg");
                                                                    
                                                                                    if (!oWysiwyg) {
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 1928..1938

                                                                    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

                                                                            save: function (object) {
                                                                                return object.each(function () {
                                                                                    var oWysiwyg = $(this).data("wysiwyg");
                                                                    
                                                                                    if (!oWysiwyg) {
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2026..2036

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

                                                                    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

                                                                            removeFormat: function (object) {
                                                                                return object.each(function () {
                                                                                    var oWysiwyg = $(this).data("wysiwyg");
                                                                    
                                                                                    if (!oWysiwyg) {
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2038..2048

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

                                                                    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 ("string" === typeof (url)) {
                                                                                                            if (url.length > 0) {
                                                                                                                Wysiwyg.editorDoc.execCommand("createLink", false, url);
                                                                                                            } else {
                                                                                                                Wysiwyg.editorDoc.execCommand("unlink", false, null);
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3170..3176

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

                                                                    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 ("string" === typeof (url)) {
                                                                                                    if (url.length > 0) {
                                                                                                        Wysiwyg.editorDoc.execCommand("createLink", false, url);
                                                                                                    } else {
                                                                                                        Wysiwyg.editorDoc.execCommand("unlink", false, null);
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 3098..3104

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

                                                                    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 dialogHeight = this.options.height == 'auto' ? 300 : this.options.height,
                                                                                            dialogWidth = this.options.width == 'auto' ? 450 : this.options.width;
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2346..2347

                                                                    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

                                                                                    var dialogHeight = this.options.height == 'auto' ? 300 : this.options.height,
                                                                                        dialogWidth = this.options.width == 'auto' ? 450 : this.options.width;
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2280..2281

                                                                    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

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

                                                                                bold: {
                                                                                    groupIndex: 0,
                                                                                    visible: true,
                                                                                    tags: ["b", "strong"],
                                                                                    css: {
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 309..318

                                                                    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

                                                                                italic: {
                                                                                    groupIndex: 0,
                                                                                    visible: true,
                                                                                    tags: ["i", "em"],
                                                                                    css: {
                                                                    Severity: Major
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 1 hr to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 35..44

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 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

                                                                                    if (!$.wysiwyg[plugin.name] || !$.wysiwyg[plugin.name][plugin.method]) {
                                                                                        return false;
                                                                                    }
                                                                    Severity: Minor
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 45 mins to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 1968..1970

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 50.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                    if (!$.wysiwyg[plugin.name] || !$.wysiwyg[plugin.name][plugin.method]) {
                                                                                        return false;
                                                                                    }
                                                                    Severity: Minor
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 45 mins to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 1980..1982

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 50.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                args = Array.prototype.concat.call([args[0]], [this], Array.prototype.slice.call(args, 1));
                                                                    Severity: Minor
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 40 mins to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2437..2437

                                                                    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

                                                                                args = Array.prototype.concat.call([args[0]], [this], Array.prototype.slice.call(args, 1));
                                                                    Severity: Minor
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 40 mins to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 2444..2444

                                                                    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

                                                                                increaseFontSize: {
                                                                                    groupIndex: 9,
                                                                                    visible: false,
                                                                                    tags: ["big"],
                                                                                    tooltip: "Increase font size",
                                                                    Severity: Minor
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 40 mins to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 77..85

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

                                                                    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

                                                                                decreaseFontSize: {
                                                                                    groupIndex: 9,
                                                                                    visible: false,
                                                                                    tags: ["small"],
                                                                                    tooltip: "Decrease font size",
                                                                    Severity: Minor
                                                                    Found in public/assets/js/core/jwysiwyg/jwysiwyg.js and 1 other location - About 40 mins to fix
                                                                    public/assets/js/core/jwysiwyg/jwysiwyg.js on lines 232..240

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

                                                                    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