radare/radare2-webui

View on GitHub
www/m/js/core/BlockNavigator.js

Summary

Maintainability
D
1 day
Test Coverage

Function configureWorker_ has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    configureWorker_() {
        var _this = this;
        this.providerWorker.onmessage = function(e) {
            if (e.data.dir === NavigatorDirection.CURRENT) {
                if (typeof _this.curChunk.data.callback !== 'undefined') {
Severity: Minor
Found in www/m/js/core/BlockNavigator.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

Function get has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    get(which, callback, force) {
        var dir = (which === NavigatorDirection.BEFORE) ? 'prev' : 'next';

        var item;
        if (which === NavigatorDirection.CURRENT) {
Severity: Minor
Found in www/m/js/core/BlockNavigator.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 get has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    get(which, callback, force) {
        var dir = (which === NavigatorDirection.BEFORE) ? 'prev' : 'next';

        var item;
        if (which === NavigatorDirection.CURRENT) {
Severity: Major
Found in www/m/js/core/BlockNavigator.js - About 2 hrs to fix

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

        configureWorker_() {
            var _this = this;
            this.providerWorker.onmessage = function(e) {
                if (e.data.dir === NavigatorDirection.CURRENT) {
                    if (typeof _this.curChunk.data.callback !== 'undefined') {
    Severity: Minor
    Found in www/m/js/core/BlockNavigator.js - About 1 hr to fix

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

              this.providerWorker.onmessage = function(e) {
                  if (e.data.dir === NavigatorDirection.CURRENT) {
                      if (typeof _this.curChunk.data.callback !== 'undefined') {
                          for (var i = 0 ; i < _this.curChunk.data.callback.length ; i++) {
                              _this.curChunk.data.callback[i](e.data);
      Severity: Minor
      Found in www/m/js/core/BlockNavigator.js - About 1 hr to fix

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

            go(where) {
                var goNext = (where === NavigatorDirection.AFTER);
                var dir = (goNext) ? 'next' : 'prev';
                var howMany = this.gap;
        
        
        Severity: Minor
        Found in www/m/js/core/BlockNavigator.js - About 1 hr to fix

          Function go has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              go(where) {
                  var goNext = (where === NavigatorDirection.AFTER);
                  var dir = (goNext) ? 'next' : 'prev';
                  var howMany = this.gap;
          
          
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js - About 55 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Missing JSDoc comment.
          Open

              go(where) {
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          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

              reset() {
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          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

              isInside_(chunk, offset) {
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          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() {
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          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 BlockNavigator {
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          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() { }
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          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

              get(which, callback, force) {
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          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

              configureWorker_() {
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          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

          Unexpected use of undefined.
          Open

                              prev: (which === NavigatorDirection.AFTER) ? this.curChunk : undefined,
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          Disallow Use of undefined Variable (no-undefined)

          The undefined variable is unique in JavaScript because it is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of undefined. While ECMAScript 5 disallows overwriting undefined, it's still possible to shadow undefined, such as:

          function doSomething(data) {
              var undefined = "hi";
          
              // doesn't do what you think it does
              if (data === undefined) {
                  // ...
              }
          
          }

          This represents a problem for undefined that doesn't exist for null, which is a keyword and primitive value that can neither be overwritten nor shadowed.

          All uninitialized variables automatically get the value of undefined:

          var foo;
          
          console.log(foo === undefined);     // true (assuming no shadowing)

          For this reason, it's not necessary to explicitly initialize a variable to undefined.

          Taking all of this into account, some style guides forbid the use of undefined, recommending instead:

          • Variables that should be undefined are simply left uninitialized.
          • Checking if a value is undefined should be done with typeof.
          • Using the void operator to generate the value of undefined if necessary.

          Rule Details

          This rule aims to eliminate the use of undefined, and as such, generates a warning whenever it is used.

          Examples of incorrect code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = undefined;
          
          var undefined = "foo";
          
          if (foo === undefined) {
              // ...
          }
          
          function foo(undefined) {
              // ...
          }

          Examples of correct code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = void 0;
          
          var Undefined = "foo";
          
          if (typeof foo === "undefined") {
              // ...
          }
          
          global.undefined = "foo";

          When Not To Use It

          If you want to allow the use of undefined in your code, then you can safely turn this rule off.

          Further Reading

          Related Rules

          Unexpected use of undefined.
          Open

                              prev: undefined,
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          Disallow Use of undefined Variable (no-undefined)

          The undefined variable is unique in JavaScript because it is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of undefined. While ECMAScript 5 disallows overwriting undefined, it's still possible to shadow undefined, such as:

          function doSomething(data) {
              var undefined = "hi";
          
              // doesn't do what you think it does
              if (data === undefined) {
                  // ...
              }
          
          }

          This represents a problem for undefined that doesn't exist for null, which is a keyword and primitive value that can neither be overwritten nor shadowed.

          All uninitialized variables automatically get the value of undefined:

          var foo;
          
          console.log(foo === undefined);     // true (assuming no shadowing)

          For this reason, it's not necessary to explicitly initialize a variable to undefined.

          Taking all of this into account, some style guides forbid the use of undefined, recommending instead:

          • Variables that should be undefined are simply left uninitialized.
          • Checking if a value is undefined should be done with typeof.
          • Using the void operator to generate the value of undefined if necessary.

          Rule Details

          This rule aims to eliminate the use of undefined, and as such, generates a warning whenever it is used.

          Examples of incorrect code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = undefined;
          
          var undefined = "foo";
          
          if (foo === undefined) {
              // ...
          }
          
          function foo(undefined) {
              // ...
          }

          Examples of correct code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = void 0;
          
          var Undefined = "foo";
          
          if (typeof foo === "undefined") {
              // ...
          }
          
          global.undefined = "foo";

          When Not To Use It

          If you want to allow the use of undefined in your code, then you can safely turn this rule off.

          Further Reading

          Related Rules

          Unexpected use of undefined.
          Open

                              next: undefined
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          Disallow Use of undefined Variable (no-undefined)

          The undefined variable is unique in JavaScript because it is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of undefined. While ECMAScript 5 disallows overwriting undefined, it's still possible to shadow undefined, such as:

          function doSomething(data) {
              var undefined = "hi";
          
              // doesn't do what you think it does
              if (data === undefined) {
                  // ...
              }
          
          }

          This represents a problem for undefined that doesn't exist for null, which is a keyword and primitive value that can neither be overwritten nor shadowed.

          All uninitialized variables automatically get the value of undefined:

          var foo;
          
          console.log(foo === undefined);     // true (assuming no shadowing)

          For this reason, it's not necessary to explicitly initialize a variable to undefined.

          Taking all of this into account, some style guides forbid the use of undefined, recommending instead:

          • Variables that should be undefined are simply left uninitialized.
          • Checking if a value is undefined should be done with typeof.
          • Using the void operator to generate the value of undefined if necessary.

          Rule Details

          This rule aims to eliminate the use of undefined, and as such, generates a warning whenever it is used.

          Examples of incorrect code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = undefined;
          
          var undefined = "foo";
          
          if (foo === undefined) {
              // ...
          }
          
          function foo(undefined) {
              // ...
          }

          Examples of correct code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = void 0;
          
          var Undefined = "foo";
          
          if (typeof foo === "undefined") {
              // ...
          }
          
          global.undefined = "foo";

          When Not To Use It

          If you want to allow the use of undefined in your code, then you can safely turn this rule off.

          Further Reading

          Related Rules

          Unexpected use of undefined.
          Open

                          next: (!goNext) ? this.curChunk : undefined
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          Disallow Use of undefined Variable (no-undefined)

          The undefined variable is unique in JavaScript because it is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of undefined. While ECMAScript 5 disallows overwriting undefined, it's still possible to shadow undefined, such as:

          function doSomething(data) {
              var undefined = "hi";
          
              // doesn't do what you think it does
              if (data === undefined) {
                  // ...
              }
          
          }

          This represents a problem for undefined that doesn't exist for null, which is a keyword and primitive value that can neither be overwritten nor shadowed.

          All uninitialized variables automatically get the value of undefined:

          var foo;
          
          console.log(foo === undefined);     // true (assuming no shadowing)

          For this reason, it's not necessary to explicitly initialize a variable to undefined.

          Taking all of this into account, some style guides forbid the use of undefined, recommending instead:

          • Variables that should be undefined are simply left uninitialized.
          • Checking if a value is undefined should be done with typeof.
          • Using the void operator to generate the value of undefined if necessary.

          Rule Details

          This rule aims to eliminate the use of undefined, and as such, generates a warning whenever it is used.

          Examples of incorrect code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = undefined;
          
          var undefined = "foo";
          
          if (foo === undefined) {
              // ...
          }
          
          function foo(undefined) {
              // ...
          }

          Examples of correct code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = void 0;
          
          var Undefined = "foo";
          
          if (typeof foo === "undefined") {
              // ...
          }
          
          global.undefined = "foo";

          When Not To Use It

          If you want to allow the use of undefined in your code, then you can safely turn this rule off.

          Further Reading

          Related Rules

          Unexpected use of undefined.
          Open

                  this.curChunk = undefined;
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          Disallow Use of undefined Variable (no-undefined)

          The undefined variable is unique in JavaScript because it is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of undefined. While ECMAScript 5 disallows overwriting undefined, it's still possible to shadow undefined, such as:

          function doSomething(data) {
              var undefined = "hi";
          
              // doesn't do what you think it does
              if (data === undefined) {
                  // ...
              }
          
          }

          This represents a problem for undefined that doesn't exist for null, which is a keyword and primitive value that can neither be overwritten nor shadowed.

          All uninitialized variables automatically get the value of undefined:

          var foo;
          
          console.log(foo === undefined);     // true (assuming no shadowing)

          For this reason, it's not necessary to explicitly initialize a variable to undefined.

          Taking all of this into account, some style guides forbid the use of undefined, recommending instead:

          • Variables that should be undefined are simply left uninitialized.
          • Checking if a value is undefined should be done with typeof.
          • Using the void operator to generate the value of undefined if necessary.

          Rule Details

          This rule aims to eliminate the use of undefined, and as such, generates a warning whenever it is used.

          Examples of incorrect code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = undefined;
          
          var undefined = "foo";
          
          if (foo === undefined) {
              // ...
          }
          
          function foo(undefined) {
              // ...
          }

          Examples of correct code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = void 0;
          
          var Undefined = "foo";
          
          if (typeof foo === "undefined") {
              // ...
          }
          
          global.undefined = "foo";

          When Not To Use It

          If you want to allow the use of undefined in your code, then you can safely turn this rule off.

          Further Reading

          Related Rules

          Unexpected use of undefined.
          Open

                          item = undefined;
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          Disallow Use of undefined Variable (no-undefined)

          The undefined variable is unique in JavaScript because it is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of undefined. While ECMAScript 5 disallows overwriting undefined, it's still possible to shadow undefined, such as:

          function doSomething(data) {
              var undefined = "hi";
          
              // doesn't do what you think it does
              if (data === undefined) {
                  // ...
              }
          
          }

          This represents a problem for undefined that doesn't exist for null, which is a keyword and primitive value that can neither be overwritten nor shadowed.

          All uninitialized variables automatically get the value of undefined:

          var foo;
          
          console.log(foo === undefined);     // true (assuming no shadowing)

          For this reason, it's not necessary to explicitly initialize a variable to undefined.

          Taking all of this into account, some style guides forbid the use of undefined, recommending instead:

          • Variables that should be undefined are simply left uninitialized.
          • Checking if a value is undefined should be done with typeof.
          • Using the void operator to generate the value of undefined if necessary.

          Rule Details

          This rule aims to eliminate the use of undefined, and as such, generates a warning whenever it is used.

          Examples of incorrect code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = undefined;
          
          var undefined = "foo";
          
          if (foo === undefined) {
              // ...
          }
          
          function foo(undefined) {
              // ...
          }

          Examples of correct code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = void 0;
          
          var Undefined = "foo";
          
          if (typeof foo === "undefined") {
              // ...
          }
          
          global.undefined = "foo";

          When Not To Use It

          If you want to allow the use of undefined in your code, then you can safely turn this rule off.

          Further Reading

          Related Rules

          Unexpected use of undefined.
          Open

                              next: (which === NavigatorDirection.BEFORE) ? this.curChunk : undefined
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          Disallow Use of undefined Variable (no-undefined)

          The undefined variable is unique in JavaScript because it is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of undefined. While ECMAScript 5 disallows overwriting undefined, it's still possible to shadow undefined, such as:

          function doSomething(data) {
              var undefined = "hi";
          
              // doesn't do what you think it does
              if (data === undefined) {
                  // ...
              }
          
          }

          This represents a problem for undefined that doesn't exist for null, which is a keyword and primitive value that can neither be overwritten nor shadowed.

          All uninitialized variables automatically get the value of undefined:

          var foo;
          
          console.log(foo === undefined);     // true (assuming no shadowing)

          For this reason, it's not necessary to explicitly initialize a variable to undefined.

          Taking all of this into account, some style guides forbid the use of undefined, recommending instead:

          • Variables that should be undefined are simply left uninitialized.
          • Checking if a value is undefined should be done with typeof.
          • Using the void operator to generate the value of undefined if necessary.

          Rule Details

          This rule aims to eliminate the use of undefined, and as such, generates a warning whenever it is used.

          Examples of incorrect code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = undefined;
          
          var undefined = "foo";
          
          if (foo === undefined) {
              // ...
          }
          
          function foo(undefined) {
              // ...
          }

          Examples of correct code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = void 0;
          
          var Undefined = "foo";
          
          if (typeof foo === "undefined") {
              // ...
          }
          
          global.undefined = "foo";

          When Not To Use It

          If you want to allow the use of undefined in your code, then you can safely turn this rule off.

          Further Reading

          Related Rules

          Unexpected use of undefined.
          Open

                          prev: (goNext) ? this.curChunk : undefined,
          Severity: Minor
          Found in www/m/js/core/BlockNavigator.js by eslint

          Disallow Use of undefined Variable (no-undefined)

          The undefined variable is unique in JavaScript because it is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of undefined. While ECMAScript 5 disallows overwriting undefined, it's still possible to shadow undefined, such as:

          function doSomething(data) {
              var undefined = "hi";
          
              // doesn't do what you think it does
              if (data === undefined) {
                  // ...
              }
          
          }

          This represents a problem for undefined that doesn't exist for null, which is a keyword and primitive value that can neither be overwritten nor shadowed.

          All uninitialized variables automatically get the value of undefined:

          var foo;
          
          console.log(foo === undefined);     // true (assuming no shadowing)

          For this reason, it's not necessary to explicitly initialize a variable to undefined.

          Taking all of this into account, some style guides forbid the use of undefined, recommending instead:

          • Variables that should be undefined are simply left uninitialized.
          • Checking if a value is undefined should be done with typeof.
          • Using the void operator to generate the value of undefined if necessary.

          Rule Details

          This rule aims to eliminate the use of undefined, and as such, generates a warning whenever it is used.

          Examples of incorrect code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = undefined;
          
          var undefined = "foo";
          
          if (foo === undefined) {
              // ...
          }
          
          function foo(undefined) {
              // ...
          }

          Examples of correct code for this rule:

          /*eslint no-undefined: "error"*/
          
          var foo = void 0;
          
          var Undefined = "foo";
          
          if (typeof foo === "undefined") {
              // ...
          }
          
          global.undefined = "foo";

          When Not To Use It

          If you want to allow the use of undefined in your code, then you can safely turn this rule off.

          Further Reading

          Related Rules

          There are no issues that match your filters.

          Category
          Status