radare/radare2-webui

View on GitHub
www/p/lib/js/panels/disasm_panel.js

Summary

Maintainability
F
2 wks
Test Coverage

Implied eval. Consider passing a function instead of a string.
Open

        setTimeout('r2ui._dis.rbox.focus();', 200);
Severity: Minor
Found in www/p/lib/js/panels/disasm_panel.js by eslint

Disallow Implied eval() (no-implied-eval)

It's considered a good practice to avoid using eval() in JavaScript. There are security and performance implications involved with doing so, which is why many linters (including ESLint) recommend disallowing eval(). However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns.

The first is using setTimeout(), setInterval() or execScript() (Internet Explorer only), both of which can accept a string of JavaScript code as their first argument. For example:

setTimeout("alert('Hi!');", 100);

This is considered an implied eval() because a string of JavaScript code is passed in to be interpreted. The same can be done with setInterval() and execScript(). Both interpret the JavaScript code in the global scope. For both setTimeout() and setInterval(), the first argument can also be a function, and that is considered safer and is more performant:

setTimeout(function() {
    alert("Hi!");
}, 100);

The best practice is to always use a function for the first argument of setTimeout() and setInterval() (and avoid execScript()).

Rule Details

This rule aims to eliminate implied eval() through the use of setTimeout(), setInterval() or execScript(). As such, it will warn when either function is used with a string as the first argument.

Examples of incorrect code for this rule:

/*eslint no-implied-eval: "error"*/

setTimeout("alert('Hi!');", 100);

setInterval("alert('Hi!');", 100);

execScript("alert('Hi!')");

window.setTimeout("count = 5", 10);

window.setInterval("foo = bar", 10);

Examples of correct code for this rule:

/*eslint no-implied-eval: "error"*/

setTimeout(function() {
    alert("Hi!");
}, 100);

setInterval(function() {
    alert("Hi!");
}, 100);

When Not To Use It

If you want to allow setTimeout() and setInterval() with string arguments, then you can safely disable this rule.

Related Rules

Implied eval. Consider passing a function instead of a string.
Open

        setTimeout('r2ui._dis.rbox.focus();', 200);
Severity: Minor
Found in www/p/lib/js/panels/disasm_panel.js by eslint

Disallow Implied eval() (no-implied-eval)

It's considered a good practice to avoid using eval() in JavaScript. There are security and performance implications involved with doing so, which is why many linters (including ESLint) recommend disallowing eval(). However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns.

The first is using setTimeout(), setInterval() or execScript() (Internet Explorer only), both of which can accept a string of JavaScript code as their first argument. For example:

setTimeout("alert('Hi!');", 100);

This is considered an implied eval() because a string of JavaScript code is passed in to be interpreted. The same can be done with setInterval() and execScript(). Both interpret the JavaScript code in the global scope. For both setTimeout() and setInterval(), the first argument can also be a function, and that is considered safer and is more performant:

setTimeout(function() {
    alert("Hi!");
}, 100);

The best practice is to always use a function for the first argument of setTimeout() and setInterval() (and avoid execScript()).

Rule Details

This rule aims to eliminate implied eval() through the use of setTimeout(), setInterval() or execScript(). As such, it will warn when either function is used with a string as the first argument.

Examples of incorrect code for this rule:

/*eslint no-implied-eval: "error"*/

setTimeout("alert('Hi!');", 100);

setInterval("alert('Hi!');", 100);

execScript("alert('Hi!')");

window.setTimeout("count = 5", 10);

window.setInterval("foo = bar", 10);

Examples of correct code for this rule:

/*eslint no-implied-eval: "error"*/

setTimeout(function() {
    alert("Hi!");
}, 100);

setInterval(function() {
    alert("Hi!");
}, 100);

When Not To Use It

If you want to allow setTimeout() and setInterval() with string arguments, then you can safely disable this rule.

Related Rules

Function handleKeypress has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

function handleKeypress(inEvent) {
    var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
    var key = String.fromCharCode(keynum);
    // console.log(key);

Severity: Minor
Found in www/p/lib/js/panels/disasm_panel.js - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

File disasm_panel.js has 531 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// DISASSEMBLER PANEL
var DisasmPanel = function() {
    this.display = 'flat';
    this.min = 0;
    this.max = 0;
Severity: Major
Found in www/p/lib/js/panels/disasm_panel.js - About 1 day to fix

    Function 'handleKeypress' has too many statements (68). Maximum allowed is 30.
    Open

    function handleKeypress(inEvent) {
    Severity: Minor
    Found in www/p/lib/js/panels/disasm_panel.js by eslint

    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 render has 144 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    DisasmPanel.prototype.render = function(mode) {
    
        // r2ui.seek("$$", false);
        $('#center_panel').unbind('click');
        $(document).unbind('keypress');
    Severity: Major
    Found in www/p/lib/js/panels/disasm_panel.js - About 5 hrs to fix

      Function 'handleKeypress' has a complexity of 40.
      Open

      function handleKeypress(inEvent) {
      Severity: Minor
      Found in www/p/lib/js/panels/disasm_panel.js by eslint

      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 handleClick has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

      function handleClick(inEvent) {
      
          if ($(inEvent.target).hasClass('addr')) {
              if ($(inEvent.target).hasClass('history')) {
                  var idx = inEvent.target.className.split(' ').filter(function(x) { return x.substr(0, 'history_idx_'.length) == 'history_idx_'; });
      Severity: Minor
      Found in www/p/lib/js/panels/disasm_panel.js - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function render has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

      DisasmPanel.prototype.render = function(mode) {
      
          // r2ui.seek("$$", false);
          $('#center_panel').unbind('click');
          $(document).unbind('keypress');
      Severity: Minor
      Found in www/p/lib/js/panels/disasm_panel.js - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function 'do_rename' has too many statements (54). Maximum allowed is 30.
      Open

      function do_rename(element, inEvent) {
      Severity: Minor
      Found in www/p/lib/js/panels/disasm_panel.js by eslint

      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 handleKeypress has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function handleKeypress(inEvent) {
          var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
          var key = String.fromCharCode(keynum);
          // console.log(key);
      
      
      Severity: Major
      Found in www/p/lib/js/panels/disasm_panel.js - About 3 hrs to fix

        Function 'handleClick' has too many statements (45). Maximum allowed is 30.
        Open

        function handleClick(inEvent) {
        Severity: Minor
        Found in www/p/lib/js/panels/disasm_panel.js by eslint

        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 beforeOpen has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    beforeOpen: function(event, ui) {
                        var address = get_address_from_class(ui.target[0]);
                        var xrefs_to = [];
                        var xrefs_from = [];
                        var xrefto_submenu = null;
        Severity: Major
        Found in www/p/lib/js/panels/disasm_panel.js - About 3 hrs to fix

          Method 'beforeOpen' has too many statements (43). Maximum allowed is 30.
          Open

                      beforeOpen: function(event, ui) {
          Severity: Minor
          Found in www/p/lib/js/panels/disasm_panel.js by eslint

          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 'handleClick' has a complexity of 18.
          Open

          function handleClick(inEvent) {
          Severity: Minor
          Found in www/p/lib/js/panels/disasm_panel.js by eslint

          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 do_rename has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          function do_rename(element, inEvent) {
              var address = get_address_from_class(element);
              if ($(element).hasClass('addr') && $(element).hasClass('flag')) {
                  var space = '*';
                  if ($(element).hasClass('function')) space = 'functions';
          Severity: Minor
          Found in www/p/lib/js/panels/disasm_panel.js - About 2 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Method 'beforeOpen' has a complexity of 14.
          Open

                      beforeOpen: function(event, ui) {
          Severity: Minor
          Found in www/p/lib/js/panels/disasm_panel.js by eslint

          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 do_rename has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function do_rename(element, inEvent) {
              var address = get_address_from_class(element);
              if ($(element).hasClass('addr') && $(element).hasClass('flag')) {
                  var space = '*';
                  if ($(element).hasClass('function')) space = 'functions';
          Severity: Major
          Found in www/p/lib/js/panels/disasm_panel.js - About 2 hrs to fix

            Function 'do_rename' has a complexity of 12.
            Open

            function do_rename(element, inEvent) {
            Severity: Minor
            Found in www/p/lib/js/panels/disasm_panel.js by eslint

            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 handleClick has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function handleClick(inEvent) {
            
                if ($(inEvent.target).hasClass('addr')) {
                    if ($(inEvent.target).hasClass('history')) {
                        var idx = inEvent.target.className.split(' ').filter(function(x) { return x.substr(0, 'history_idx_'.length) == 'history_idx_'; });
            Severity: Major
            Found in www/p/lib/js/panels/disasm_panel.js - About 2 hrs to fix

              Function handleInputTextChange has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              DisasmPanel.prototype.handleInputTextChange = function() {
                  if (this.renaming !== null && this.rbox.value.length > 0) {
                      if ($(this.selected).hasClass('insaddr')) {
                          var old_value = get_offset_flag(r2ui._dis.selected_offset);
                          var type = 'offsets';
              Severity: Minor
              Found in www/p/lib/js/panels/disasm_panel.js - About 2 hrs to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function has a complexity of 9.
              Open

              DisasmPanel.prototype.handleInputTextChange = function() {
              Severity: Minor
              Found in www/p/lib/js/panels/disasm_panel.js by eslint

              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 'scroll_to_address' has a complexity of 9.
              Open

              function scroll_to_address(address, pos) {
              Severity: Minor
              Found in www/p/lib/js/panels/disasm_panel.js by eslint

              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 'select' has a complexity of 9.
              Open

                          select: function(event, ui) {
              Severity: Minor
              Found in www/p/lib/js/panels/disasm_panel.js by eslint

              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 handleInputTextChange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              DisasmPanel.prototype.handleInputTextChange = function() {
                  if (this.renaming !== null && this.rbox.value.length > 0) {
                      if ($(this.selected).hasClass('insaddr')) {
                          var old_value = get_offset_flag(r2ui._dis.selected_offset);
                          var type = 'offsets';
              Severity: Minor
              Found in www/p/lib/js/panels/disasm_panel.js - About 1 hr to fix

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

                DisasmPanel.prototype.goToAddress = function() {
                    if (this.renaming === null && this.selected !== null && (this.selected.className.indexOf(' addr ') > -1)) {
                        var address = get_address_from_class(this.selected);
                        if (this.selected.className.indexOf('ec_gui_dataoffset') > -1) {
                            // address is located in not executable memory, switching to hex view
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                function scroll_to_address(address, pos) {
                    if (address === undefined || address === null) return;
                    var offset = 0;
                    if (pos == 'top') offset = $('#center_panel').height();
                    else if (pos == 'bottom') offset = 0;
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                                if (ui.cmd.indexOf('jumpto_') == 0) {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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 (r2ui._dis.display == 'flat') {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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/

                'next_instruction' is already defined.
                Open

                                var next_instruction = $(r2ui._dis.selected).closest('.instruction').next().find('.insaddr')[0];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                'old_value' is already defined.
                Open

                            var old_value = r2ui._dis.renameOldValue;
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

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

                            if (r2ui._dis.display == 'flat') {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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/

                'refs' is already defined.
                Open

                                    var refs = [];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                'addr' is already defined.
                Open

                                        var addr = xrefs_from[r].split(' ')[1];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

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

                            if (r2ui._dis.display == 'graph') {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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/

                'type' is already defined.
                Open

                                        var type = xrefs_from[r].split(' ')[0];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

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

                            if (r2ui._dis.display == 'flat') {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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/

                'get_more_instructions' is already defined.
                Open

                        var get_more_instructions = false;
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

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

                            var idx = inEvent.target.className.split(' ').filter(function(x) { return x.substr(0, 'history_idx_'.length) == 'history_idx_'; });
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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/

                'address' is already defined.
                Open

                            var address;
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                'prev_instruction' is already defined.
                Open

                                var prev_instruction = $(r2ui._dis.selected).closest('.instruction').prev().find('.insaddr')[0];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                Unexpected prompt.
                Open

                    var msg = prompt('Function name?');
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

                'xrefto_submenu' is already defined.
                Open

                                    var xrefto_submenu = {title: 'xrefs to', children: refs};
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

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

                        if (this.display == 'flat') instruction = $(this.selected).closest('.instructionbox').find('.insaddr')[0];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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 (r2ui._dis.display == 'graph') {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

                        var new_name = prompt('New name', old_value);
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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 (key === 'm' && r2ui._dis.display == 'graph') toggle_minimap();
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

                        var a = prompt('Go to');
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

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

                                    for (var r in xrefs_from) {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

                'address' is already defined.
                Open

                        var address = get_address_from_class(inEvent.target, 'faddr');
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                'xreffrom_submenu' is already defined.
                Open

                                    var xreffrom_submenu = {title: 'xrefs from', children: refs};
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

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

                        if (this.display == 'graph') instruction = $(this.selected).closest('.instruction').find('.insaddr')[0];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

                    else if (pos == 'bottom') offset = 0;
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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/

                'next_instruction' is already defined.
                Open

                                var next_instruction = $(r2ui._dis.selected).closest('.instruction').next().find('.insaddr')[0];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                'address' is already defined.
                Open

                            var address = get_address_from_class(prev_instruction);
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

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

                    if (r2ui._dis.display == 'graph') r2ui._dis.display_flat();
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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 (x[0].fcn_addr == x[0].offset) {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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/

                'prev_instruction' is already defined.
                Open

                                var prev_instruction = $(r2ui._dis.selected).closest('.instruction').prev().find('.insaddr')[0];
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. 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 (var j in classes) {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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 (r2ui._dis.display == 'graph') {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

                    var c =  prompt('Comment');
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

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

                                    for (var r in xrefs_to) {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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

                'r' is already defined.
                Open

                                    for (var r in xrefs_from) {
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                disallow variable redeclaration (no-redeclare)

                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                Rule Details

                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                Examples of incorrect code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                var a = 10;

                Examples of correct code for this rule:

                /*eslint no-redeclare: "error"*/
                
                var a = 3;
                // ...
                a = 10;

                Options

                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                builtinGlobals

                Examples of incorrect code for the { "builtinGlobals": true } option:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                
                var Object = 0;

                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                /*eslint-env browser*/
                
                var top = 0;

                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

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

                    if (pos == 'top') offset = $('#center_panel').height();
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by eslint

                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/

                TODO found
                Open

                            // TODO, try to recognize other spaces
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js by fixme

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

                        if ($(this.selected).hasClass('insaddr')) {
                            var old_value = get_offset_flag(r2ui._dis.selected_offset);
                            var type = 'offsets';
                            r2.cmdj('afij @ ' + r2ui._dis.selected_offset, function(x) {
                                if (x !== null && x !== undefined) {
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 2 days to fix
                www/enyo/js/disassembler.js on lines 324..345

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

                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 (r2ui._dis.display == 'flat') {
                                next_instruction = $(r2ui._dis.selected).closest('.instructionbox').next().find('.insaddr')[0];
                                if ($('#gbox .instructionbox').index($(r2ui._dis.selected).closest('.instructionbox')[0]) > $('#gbox .instructionbox').length - 10) {
                                    get_more_instructions = true;
                                    address = get_address_from_class(next_instruction);
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 day to fix
                www/enyo/js/disassembler.js on lines 245..256

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

                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 (r2ui._dis.display == 'graph') {
                                var next_instruction = $(r2ui._dis.selected).closest('.instruction').next().find('.insaddr')[0];
                                if (next_instruction === undefined || next_instruction === null) {
                                    next_instruction = $(r2ui._dis.selected).closest('.basicblock').next().find('.insaddr')[0];
                                }
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 day to fix
                www/enyo/js/disassembler.js on lines 257..266

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 248.

                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

                function scroll_to_address(address, pos) {
                    if (address === undefined || address === null) return;
                    var offset = 0;
                    if (pos == 'top') offset = $('#center_panel').height();
                    else if (pos == 'bottom') offset = 0;
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 day to fix
                www/p/lib/js/panels/hex_panel.js on lines 73..86

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

                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 ($(inEvent.target).hasClass('addr')) {
                        if ($(inEvent.target).hasClass('history')) {
                            var idx = inEvent.target.className.split(' ').filter(function(x) { return x.substr(0, 'history_idx_'.length) == 'history_idx_'; });
                            idx = String(idx).split('_')[2];
                            r2ui.history_idx = idx;
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 day to fix
                www/enyo/js/disassembler.js on lines 232..285

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

                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 (xrefs_to.length > 0) {
                                    $(document).contextmenu('showEntry', 'xrefs_to', true);
                                    var refs = [];
                                    for (var r in xrefs_to) {
                                        var addr = xrefs_to[r].split(' ')[1];
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 6 hrs to fix
                www/p/lib/js/panels/disasm_panel.js on lines 78..87

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

                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 (xrefs_from.length > 0) {
                                    $(document).contextmenu('showEntry', 'xrefs_from', true);
                                    var refs = [];
                                    for (var r in xrefs_from) {
                                        var addr = xrefs_from[r].split(' ')[1];
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 6 hrs to fix
                www/p/lib/js/panels/disasm_panel.js on lines 62..71

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

                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

                DisasmPanel.prototype.display_graph = function() {
                    this.display = 'graph';
                    $('#main_panel').removeClass('ec_gui_background');
                    $('#main_panel').addClass('ec_gui_alt_background');
                    if ($('#minimap').length) $('#minimap')[0].innerHTML = '';
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 2 hrs to fix
                www/p/lib/js/panels/disasm_panel.js on lines 206..211

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

                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

                DisasmPanel.prototype.display_flat = function() {
                    this.display = 'flat';
                    $('#main_panel').removeClass('ec_gui_alt_background');
                    $('#main_panel').addClass('ec_gui_background');
                    if ($('#minimap').length) $('#minimap')[0].innerHTML = '';
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 2 hrs to fix
                www/p/lib/js/panels/disasm_panel.js on lines 200..205

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

                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

                            menu: [
                                    {title: 'jump to address<kbd>g</kbd>', cmd: 'goto'},
                                    {title: 'rename<kbd>n</kbd>', cmd: 'rename'},
                                    {title: 'add comment<kbd>;</kbd>', cmd: 'comment'},
                                    {title: 'code<kbd>c</kbd>', cmd: 'define'},
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 2 hrs to fix
                www/enyo/js/mainpanel.js on lines 150..158

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 90.

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

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

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

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

                Refactorings

                Further Reading

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

                                r2.cmd('axt @' + address, function(x) {
                                    var lines = x.split('\n');
                                    for (var l in lines) {
                                        if (lines[l] !== '') xrefs_from[xrefs_from.length] = lines[l];
                                    }
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 2 hrs to fix
                www/p/lib/js/panels/disasm_panel.js on lines 56..61

                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

                                r2.cmd('axf @' + address, function(x) {
                                    var lines = x.split('\n');
                                    for (var l in lines) {
                                        if (lines[l] !== '') xrefs_to[xrefs_to.length] = lines[l];
                                    }
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 2 hrs to fix
                www/p/lib/js/panels/disasm_panel.js on lines 72..77

                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

                                if (ui.target.hasClass('reloc') || ui.target.hasClass('symbol') || ui.target.hasClass('import')) {
                                    $(document).contextmenu('showEntry', 'comment', false);
                                    $(document).contextmenu('showEntry', 'rename', false);
                                    $(document).contextmenu('showEntry', 'define', false);
                                    $(document).contextmenu('showEntry', 'undefine', false);
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 hr to fix
                www/p/lib/js/panels/disasm_panel.js on lines 118..123

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

                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

                                } else {
                                    $(document).contextmenu('showEntry', 'comment', false);
                                    $(document).contextmenu('showEntry', 'rename', true);
                                    $(document).contextmenu('showEntry', 'define', false);
                                    $(document).contextmenu('showEntry', 'undefine', false);
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 hr to fix
                www/p/lib/js/panels/disasm_panel.js on lines 124..129

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

                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 (get_more_instructions) {
                                r2ui.seek(address, false);
                            } else {
                                r2ui.history_push(address);
                                render_history();
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 hr to fix
                www/p/lib/js/panels/disasm_panel.js on lines 389..396

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 70.

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

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

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

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

                Refactorings

                Further Reading

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

                            if (get_more_instructions) {
                                r2ui.seek(address, false);
                            } else {
                                r2ui.history_push(address);
                                render_history();
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 1 hr to fix
                www/p/lib/js/panels/disasm_panel.js on lines 417..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 70.

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

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

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

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

                Refactorings

                Further Reading

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

                    if (this.renaming === null && this.selected !== null && (this.selected.className.indexOf(' addr ') > -1)) {
                        var address = get_address_from_class(this.selected);
                        if (this.selected.className.indexOf('ec_gui_dataoffset') > -1) {
                            // address is located in not executable memory, switching to hex view
                            r2ui.openpage(address, 2);
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 40 mins to fix
                www/enyo/js/disassembler.js on lines 378..414

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

                        if (this.display == 'flat') instruction = $(this.selected).closest('.instructionbox').find('.insaddr')[0];
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 3 other locations - About 35 mins to fix
                www/p/lib/js/panels/disasm_panel.js on lines 252..252
                www/enyo/js/disassembler.js on lines 347..347
                www/enyo/js/disassembler.js on lines 348..348

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

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

                        if (this.display == 'graph') instruction = $(this.selected).closest('.instruction').find('.insaddr')[0];
                Severity: Major
                Found in www/p/lib/js/panels/disasm_panel.js and 3 other locations - About 35 mins to fix
                www/p/lib/js/panels/disasm_panel.js on lines 251..251
                www/enyo/js/disassembler.js on lines 347..347
                www/enyo/js/disassembler.js on lines 348..348

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

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

                    if ($(inEvent.target).prop('tagName') === 'INPUT' || $(inEvent.target).prop('tagName') === 'TEXTAREA') return;
                Severity: Minor
                Found in www/p/lib/js/panels/disasm_panel.js and 1 other location - About 35 mins to fix
                www/enyo/js/disassembler.js on lines 101..101

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 46.

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

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

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

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

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status