radare/radare2-webui

View on GitHub
www/m/js/modules/disasm/Disassembly.js

Summary

Maintainability
F
1 wk
Test Coverage

File Disassembly.js has 657 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {DisassemblyNavigator} from './DisassemblyNavigator';
import {RadareInfiniteBlock} from '../../layout/RadareInfiniteBlock';
import {FlexContainer} from '../../layout/FlexContainer';

import {uiContext} from '../../core/UIContext';
Severity: Major
Found in www/m/js/modules/disasm/Disassembly.js - About 1 day to fix

    Function drawContextualMenu has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        drawContextualMenu(enableAoj) {
            var _this = this;
    
            var displayRes = function(offset, cmd) {
                var output;
    Severity: Major
    Found in www/m/js/modules/disasm/Disassembly.js - About 5 hrs to fix

      Function drawAnalysisDialog has 129 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          drawAnalysisDialog() {
              this.analysisMethods = [{
                  name: 'Analyse current offset',
                  ugly: 'curoffset',
                  active: true,
      Severity: Major
      Found in www/m/js/modules/disasm/Disassembly.js - About 5 hrs to fix

        Function drawContextualMenu has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            drawContextualMenu(enableAoj) {
                var _this = this;
        
                var displayRes = function(offset, cmd) {
                    var output;
        Severity: Minor
        Found in www/m/js/modules/disasm/Disassembly.js - About 4 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

        Disassembly has 25 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class Disassembly extends RadareInfiniteBlock {
        
            constructor(containerElement, lineHeight) {
                super();
                this.container = new FlexContainer(containerElement, 'disasm');
        Severity: Minor
        Found in www/m/js/modules/disasm/Disassembly.js - About 2 hrs to fix

          Function addLongListDialog has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              addLongListDialog(list) {
                  var _this = this;
                  var dialog = document.createElement('dialog');
                  dialog.className = 'mdl-dialog';
          
          
          Severity: Major
          Found in www/m/js/modules/disasm/Disassembly.js - About 2 hrs to fix

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

                drawAnalysisDialog() {
                    this.analysisMethods = [{
                        name: 'Analyse current offset',
                        ugly: 'curoffset',
                        active: true,
            Severity: Minor
            Found in www/m/js/modules/disasm/Disassembly.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 drawChunk has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                drawChunk(chunk, domAnchor) {
                    domAnchor.innerHTML = chunk.data;
                    // TODO Dirty workaround, see with worker usage
                    const seekableElements = domAnchor.getElementsByClassName('r2seek');
                    for (const el of seekableElements) {
            Severity: Minor
            Found in www/m/js/modules/disasm/Disassembly.js - About 1 hr to fix

              Function drawControls has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  drawControls(dom) {
                      dom.innerHTML = '';
              
                      const more = Inputs.iconButton('list', 'Others representations');
                      more.id = 'disasm_more';
              Severity: Minor
              Found in www/m/js/modules/disasm/Disassembly.js - About 1 hr to fix

                Function addLongListDialog has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    addLongListDialog(list) {
                        var _this = this;
                        var dialog = document.createElement('dialog');
                        dialog.className = 'mdl-dialog';
                
                
                Severity: Minor
                Found in www/m/js/modules/disasm/Disassembly.js - About 1 hr to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function drawChunk has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    drawChunk(chunk, domAnchor) {
                        domAnchor.innerHTML = chunk.data;
                        // TODO Dirty workaround, see with worker usage
                        const seekableElements = domAnchor.getElementsByClassName('r2seek');
                        for (const el of seekableElements) {
                Severity: Minor
                Found in www/m/js/modules/disasm/Disassembly.js - About 1 hr to fix

                Cognitive Complexity

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

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

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

                Further reading

                'dialogPolyfill' is not defined.
                Open

                            dialogPolyfill.registerDialog(this.analysisDialog);

                Disallow Undeclared Variables (no-undef)

                This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

                Rule Details

                Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

                Examples of incorrect code for this rule:

                /*eslint no-undef: "error"*/
                
                var a = someFunction();
                b = 10;

                Examples of correct code for this rule with global declaration:

                /*global someFunction b:true*/
                /*eslint no-undef: "error"*/
                
                var a = someFunction();
                b = 10;

                The b:true syntax in /*global */ indicates that assignment to b is correct.

                Examples of incorrect code for this rule with global declaration:

                /*global b*/
                /*eslint no-undef: "error"*/
                
                b = 10;

                By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

                Options

                • typeof set to true will warn for variables used inside typeof check (Default false).

                typeof

                Examples of correct code for the default { "typeof": false } option:

                /*eslint no-undef: "error"*/
                
                if (typeof UndefinedIdentifier === "undefined") {
                    // do something ...
                }

                You can use this option if you want to prevent typeof check on a variable which has not been declared.

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

                /*eslint no-undef: ["error", { "typeof": true }] */
                
                if(typeof a === "string"){}

                Examples of correct code for the { "typeof": true } option with global declaration:

                /*global a*/
                /*eslint no-undef: ["error", { "typeof": true }] */
                
                if(typeof a === "string"){}

                Environments

                For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

                browser

                Examples of correct code for this rule with browser environment:

                /*eslint no-undef: "error"*/
                /*eslint-env browser*/
                
                setTimeout(function() {
                    alert("Hello");
                });

                node

                Examples of correct code for this rule with node environment:

                /*eslint no-undef: "error"*/
                /*eslint-env node*/
                
                var fs = require("fs");
                module.exports = function() {
                    console.log(fs);
                };

                When Not To Use It

                If explicit declaration of global variables is not to your taste.

                Compatibility

                This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

                'int2fixedHex' is not defined.
                Open

                        const currentOffset = (typeof this.initialOffset === 'number') ? int2fixedHex(this.initialOffset, 8) : this.initialOffset;

                Disallow Undeclared Variables (no-undef)

                This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

                Rule Details

                Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

                Examples of incorrect code for this rule:

                /*eslint no-undef: "error"*/
                
                var a = someFunction();
                b = 10;

                Examples of correct code for this rule with global declaration:

                /*global someFunction b:true*/
                /*eslint no-undef: "error"*/
                
                var a = someFunction();
                b = 10;

                The b:true syntax in /*global */ indicates that assignment to b is correct.

                Examples of incorrect code for this rule with global declaration:

                /*global b*/
                /*eslint no-undef: "error"*/
                
                b = 10;

                By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

                Options

                • typeof set to true will warn for variables used inside typeof check (Default false).

                typeof

                Examples of correct code for the default { "typeof": false } option:

                /*eslint no-undef: "error"*/
                
                if (typeof UndefinedIdentifier === "undefined") {
                    // do something ...
                }

                You can use this option if you want to prevent typeof check on a variable which has not been declared.

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

                /*eslint no-undef: ["error", { "typeof": true }] */
                
                if(typeof a === "string"){}

                Examples of correct code for the { "typeof": true } option with global declaration:

                /*global a*/
                /*eslint no-undef: ["error", { "typeof": true }] */
                
                if(typeof a === "string"){}

                Environments

                For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

                browser

                Examples of correct code for this rule with browser environment:

                /*eslint no-undef: "error"*/
                /*eslint-env browser*/
                
                setTimeout(function() {
                    alert("Hello");
                });

                node

                Examples of correct code for this rule with node environment:

                /*eslint no-undef: "error"*/
                /*eslint-env node*/
                
                var fs = require("fs");
                module.exports = function() {
                    console.log(fs);
                };

                When Not To Use It

                If explicit declaration of global variables is not to your taste.

                Compatibility

                This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

                'write' is not defined.
                Open

                        container.appendChild(Inputs.iconButton('mode_edit', 'Write', () => write()));

                Disallow Undeclared Variables (no-undef)

                This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

                Rule Details

                Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

                Examples of incorrect code for this rule:

                /*eslint no-undef: "error"*/
                
                var a = someFunction();
                b = 10;

                Examples of correct code for this rule with global declaration:

                /*global someFunction b:true*/
                /*eslint no-undef: "error"*/
                
                var a = someFunction();
                b = 10;

                The b:true syntax in /*global */ indicates that assignment to b is correct.

                Examples of incorrect code for this rule with global declaration:

                /*global b*/
                /*eslint no-undef: "error"*/
                
                b = 10;

                By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

                Options

                • typeof set to true will warn for variables used inside typeof check (Default false).

                typeof

                Examples of correct code for the default { "typeof": false } option:

                /*eslint no-undef: "error"*/
                
                if (typeof UndefinedIdentifier === "undefined") {
                    // do something ...
                }

                You can use this option if you want to prevent typeof check on a variable which has not been declared.

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

                /*eslint no-undef: ["error", { "typeof": true }] */
                
                if(typeof a === "string"){}

                Examples of correct code for the { "typeof": true } option with global declaration:

                /*global a*/
                /*eslint no-undef: ["error", { "typeof": true }] */
                
                if(typeof a === "string"){}

                Environments

                For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

                browser

                Examples of correct code for this rule with browser environment:

                /*eslint no-undef: "error"*/
                /*eslint-env browser*/
                
                setTimeout(function() {
                    alert("Hello");
                });

                node

                Examples of correct code for this rule with node environment:

                /*eslint no-undef: "error"*/
                /*eslint-env node*/
                
                var fs = require("fs");
                module.exports = function() {
                    console.log(fs);
                };

                When Not To Use It

                If explicit declaration of global variables is not to your taste.

                Compatibility

                This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

                'dialogPolyfill' is not defined.
                Open

                            dialogPolyfill.registerDialog(dialog);

                Disallow Undeclared Variables (no-undef)

                This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

                Rule Details

                Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

                Examples of incorrect code for this rule:

                /*eslint no-undef: "error"*/
                
                var a = someFunction();
                b = 10;

                Examples of correct code for this rule with global declaration:

                /*global someFunction b:true*/
                /*eslint no-undef: "error"*/
                
                var a = someFunction();
                b = 10;

                The b:true syntax in /*global */ indicates that assignment to b is correct.

                Examples of incorrect code for this rule with global declaration:

                /*global b*/
                /*eslint no-undef: "error"*/
                
                b = 10;

                By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

                Options

                • typeof set to true will warn for variables used inside typeof check (Default false).

                typeof

                Examples of correct code for the default { "typeof": false } option:

                /*eslint no-undef: "error"*/
                
                if (typeof UndefinedIdentifier === "undefined") {
                    // do something ...
                }

                You can use this option if you want to prevent typeof check on a variable which has not been declared.

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

                /*eslint no-undef: ["error", { "typeof": true }] */
                
                if(typeof a === "string"){}

                Examples of correct code for the { "typeof": true } option with global declaration:

                /*global a*/
                /*eslint no-undef: ["error", { "typeof": true }] */
                
                if(typeof a === "string"){}

                Environments

                For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

                browser

                Examples of correct code for this rule with browser environment:

                /*eslint no-undef: "error"*/
                /*eslint-env browser*/
                
                setTimeout(function() {
                    alert("Hello");
                });

                node

                Examples of correct code for this rule with node environment:

                /*eslint no-undef: "error"*/
                /*eslint-env node*/
                
                var fs = require("fs");
                module.exports = function() {
                    console.log(fs);
                };

                When Not To Use It

                If explicit declaration of global variables is not to your taste.

                Compatibility

                This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

                TODO found
                Open

                        // TODO: cache, faster

                TODO found
                Open

                        /* TODO, adapt to overview panel context

                TODO found
                Open

                        }); // TODO Add stop scroll

                TODO found
                Open

                        componentHandler.upgradeDom(); // TODO should be called when controls are binded to DOM

                TODO found
                Open

                        // TODO Dirty workaround, see with worker usage

                Missing JSDoc comment.
                Open

                    oncontextmenu(evt, offset) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    openAnalysisDialog() {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    extractOffset_(str) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    refreshContextMenu(offset) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    drawAnalysisDialog() {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    onvarmenu(evt, varName) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    drawControls(dom) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    resetContainer(container) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    getCurrentOffset() {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    drawContent(dom, callback) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    infiniteDrawingContent(where, pos, endCallback) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    drawHistory(dom) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    draw(callback) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    onfctmenu(evt, fct) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    getPresentBlock() {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    constructor(containerElement, lineHeight) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    init() {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                    drawContextualMenu(enableAoj) {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

                Missing JSDoc comment.
                Open

                export class Disassembly extends RadareInfiniteBlock {

                require JSDoc comments (require-jsdoc)

                JSDoc is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

                /**
                 * Adds two numbers together.
                 * @param {int} num1 The first number.
                 * @param {int} num2 The second number.
                 * @returns {int} The sum of the two numbers.
                 */
                function sum(num1, num2) {
                    return num1 + num2;
                }

                Some style guides require JSDoc comments for all functions as a way of explaining function behavior.

                Rule Details

                This rule requires JSDoc comments for specified nodes. Supported nodes:

                • "FunctionDeclaration"
                • "ClassDeclaration"
                • "MethodDefinition"
                • "ArrowFunctionExpression"

                Options

                This rule has a single object option:

                • "require" requires JSDoc comments for the specified nodes

                Default option settings are:

                {
                    "require-jsdoc": ["error", {
                        "require": {
                            "FunctionDeclaration": true,
                            "MethodDefinition": false,
                            "ClassDeclaration": false,
                            "ArrowFunctionExpression": false
                        }
                    }]
                }

                require

                Examples of incorrect code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                function foo() {
                    return 10;
                }
                
                var foo = () => {
                    return 10;
                }
                
                class Test{
                    getDate(){}
                }

                Examples of correct code for this rule with the { "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true } } option:

                /*eslint "require-jsdoc": ["error", {
                    "require": {
                        "FunctionDeclaration": true,
                        "MethodDefinition": true,
                        "ClassDeclaration": true
                    }
                }]*/
                
                /**
                 * It returns 10
                 */
                function foo() {
                    return 10;
                }
                
                /**
                 * It returns test + 10
                 * @params {int} test - some number
                 * @returns {int} sum of test and 10
                 */
                var foo = (test) => {
                    return test + 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = () => {
                    return 10;
                }
                
                /**
                 * It returns 10
                 */
                var foo = function() {
                    return 10;
                }
                
                var array = [1,2,3];
                array.filter(function(item) {
                    return item > 2;
                });
                
                /**
                 * It returns 10
                 */
                class Test{
                    /**
                    * returns the date
                    */
                    getDate(){}
                }
                
                setTimeout(() => {}, 10); // since it's an anonymous arrow function

                When Not To Use It

                If you do not require JSDoc for your functions, then you can leave this rule off.

                Related Rules

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

                                for (var j = 0 ; j < items[i].expand.length ; j++) {
                                    var subLi = document.createElement('li');
                                    subUl.appendChild(subLi);
                                    subLi.appendChild(document.createTextNode(items[i].expand[j].name));
                                    bindAction(subLi, items[i].expand[j].fct);
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 1 other location - About 4 hrs to fix
                www/m/js/modules/hexdump/Hexdump.js on lines 888..893

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

                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

                            li.addEventListener('mouseenter', function(evt) {
                                // Cleaning old "active"
                                var subactives = Array.prototype.slice.call(evt.target.parentNode.getElementsByClassName('subactive'));
                                for (var x = 0 ; x < subactives.length ; x++) {
                                    subactives[x].classList.remove('subactive');
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 1 other location - About 3 hrs to fix
                www/m/js/modules/hexdump/Hexdump.js on lines 849..856

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

                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

                        },{
                            name: 'Emulate code',
                            ugly: 'code',
                            active: false,
                            action: function(active) {
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 1 other location - About 1 hr to fix
                www/m/js/modules/disasm/Disassembly.js on lines 143..154

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 61.

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

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

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

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

                Refactorings

                Further Reading

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

                        },{
                            name: 'Analyse calls',
                            ugly: 'calls',
                            active: false,
                            action: function(active) {
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 1 other location - About 1 hr to fix
                www/m/js/modules/disasm/Disassembly.js on lines 164..175

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 61.

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

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

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

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

                Refactorings

                Further Reading

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

                                } else if (spans[i].className.indexOf('fcn') !== -1) {
                                    spans[i].addEventListener('contextmenu', function(id) {
                                        return function(evt) {
                                            return _this.onfctmenu(evt, id);
                                        };
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 2 other locations - About 1 hr to fix
                www/m/js/modules/disasm/Disassembly.js on lines 385..403
                www/m/js/modules/disasm/Disassembly.js on lines 397..403

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 59.

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

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

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

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

                Refactorings

                Further Reading

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

                                if (spans[i].className.indexOf('offset') !== -1) {
                                    spans[i].addEventListener('contextmenu', function(id) {
                                        return function(evt) {
                                            return _this.oncontextmenu(evt, id);
                                        };
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 2 other locations - About 1 hr to fix
                www/m/js/modules/disasm/Disassembly.js on lines 391..403
                www/m/js/modules/disasm/Disassembly.js on lines 397..403

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 59.

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

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

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

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

                Refactorings

                Further Reading

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

                                } else if (spans[i].className.indexOf('var') !== -1) {
                                    spans[i].addEventListener('contextmenu', function(id) {
                                        return function(evt) {
                                            return _this.onvarmenu(evt, id);
                                        };
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 2 other locations - About 1 hr to fix
                www/m/js/modules/disasm/Disassembly.js on lines 385..403
                www/m/js/modules/disasm/Disassembly.js on lines 391..403

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 59.

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

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

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

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

                Refactorings

                Further Reading

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

                        },{
                            name: 'Analyse reference',
                            ugly: 'ref',
                            active: false,
                            action: function(active) {
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 3 other locations - About 40 mins to fix
                www/m/js/modules/disasm/Disassembly.js on lines 123..133
                www/m/js/modules/disasm/Disassembly.js on lines 133..143
                www/m/js/modules/disasm/Disassembly.js on lines 182..192

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 49.

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

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

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

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

                Refactorings

                Further Reading

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

                        this.analysisMethods = [{
                            name: 'Analyse current offset',
                            ugly: 'curoffset',
                            active: true,
                            action: function(active) {
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 3 other locations - About 40 mins to fix
                www/m/js/modules/disasm/Disassembly.js on lines 133..143
                www/m/js/modules/disasm/Disassembly.js on lines 154..164
                www/m/js/modules/disasm/Disassembly.js on lines 182..192

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 49.

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

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

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

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

                Refactorings

                Further Reading

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

                        },{
                            name: 'Analyze symbols',
                            ugly: 'symbols',
                            active: false,
                            action: function(active) {
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 3 other locations - About 40 mins to fix
                www/m/js/modules/disasm/Disassembly.js on lines 123..133
                www/m/js/modules/disasm/Disassembly.js on lines 154..164
                www/m/js/modules/disasm/Disassembly.js on lines 182..192

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 49.

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

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

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

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

                Refactorings

                Further Reading

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

                        },{
                            name: 'Autoname functions',
                            ugly: 'fcts',
                            active: false,
                            action: function(active) {
                Severity: Major
                Found in www/m/js/modules/disasm/Disassembly.js and 3 other locations - About 40 mins to fix
                www/m/js/modules/disasm/Disassembly.js on lines 123..133
                www/m/js/modules/disasm/Disassembly.js on lines 133..143
                www/m/js/modules/disasm/Disassembly.js on lines 154..164

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 49.

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

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

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

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

                Refactorings

                Further Reading

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

                                    var indexOf = Array.prototype.slice.call(evt.target.parentNode.children).indexOf(evt.target);
                Severity: Minor
                Found in www/m/js/modules/disasm/Disassembly.js and 1 other location - About 35 mins to fix
                www/m/js/modules/hexdump/Hexdump.js on lines 879..879

                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

                There are no issues that match your filters.

                Category
                Status