cBioPortal/iViz

View on GitHub
app/scripts/views/components/pieChart/pieChart.js

Summary

Maintainability
F
4 days
Test Coverage

Function PieChart has 421 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  iViz.view.component.PieChart = function(ndx, attributes, opts, cluster) {
    var content = this;
    var v = {};

    v.chart = '';
Severity: Major
Found in app/scripts/views/components/pieChart/pieChart.js - About 2 days to fix

    File pieChart.js has 461 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * @author Hongxin Zhang on 3/10/16.
     */
    
    'use strict';
    Severity: Minor
    Found in app/scripts/views/components/pieChart/pieChart.js - About 7 hrs to fix

      Function initDCPieChart has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function initDCPieChart() {
            if (v.opts.hasOwnProperty('chartId') &&
              v.data.hasOwnProperty('ndx') &&
              v.data.hasOwnProperty('attr_id')) {
              var width = v.opts.width || 130;
      Severity: Major
      Found in app/scripts/views/components/pieChart/pieChart.js - About 2 hrs to fix

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

            function drawMarker(_slice) {
              var _path = $(_slice).find('path');
              var _pointsInfo = _path
                .attr('d')
                .split(/[\s,MLHVCSQTAZ]/);
        Severity: Minor
        Found in app/scripts/views/components/pieChart/pieChart.js - About 1 hr to fix

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

              function initReactTable(targetId, inputData, opts) {
                var selectedRows = v.chart.filters();
          
                var opts_ = $.extend({
                  input: inputData,
          Severity: Minor
          Found in app/scripts/views/components/pieChart/pieChart.js - About 1 hr to fix

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

                  content.setDownloadData('svg', {
                    title: v.data.display_name,
                    chartDivId: v.opts.chartDivId,
                    chartId: v.opts.chartId,
                    fileName: v.data.display_name,
            Severity: Major
            Found in app/scripts/views/components/pieChart/pieChart.js and 1 other location - About 1 hr to fix
            app/scripts/views/components/pieChart/pieChart.js on lines 276..282

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 70.

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

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

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

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

            Refactorings

            Further Reading

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

                  content.setDownloadData('pdf', {
                    title: v.data.display_name,
                    chartDivId: v.opts.chartDivId,
                    chartId: v.opts.chartId,
                    fileName: v.data.display_name,
            Severity: Major
            Found in app/scripts/views/components/pieChart/pieChart.js and 1 other location - About 1 hr to fix
            app/scripts/views/components/pieChart/pieChart.js on lines 269..275

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 70.

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

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

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

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

            Refactorings

            Further Reading

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

                    animateTable('#' + v.opts.chartDivId, 'pie', function() {
                      vm.$dispatch('update-grid');
                      $('#' + v.opts.chartDivId).css('z-index', '1');
                    });
            Severity: Major
            Found in app/scripts/views/components/pieChart/pieChart.js and 1 other location - About 1 hr to fix
            app/scripts/views/components/pieChart/pieChart.js on lines 93..96

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

            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

                    animateTable('#' + v.opts.chartDivId, 'table', function() {
                      vm.$dispatch('update-grid');
                      $('#' + v.opts.chartDivId).css('z-index', '');
                    });
            Severity: Major
            Found in app/scripts/views/components/pieChart/pieChart.js and 1 other location - About 1 hr to fix
            app/scripts/views/components/pieChart/pieChart.js on lines 98..101

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 65.

            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

                content.updateDataForDownload = function(fileType) {
                  if (fileType === 'tsv') {
                    initTsvDownloadData();
                  } else if (['pdf', 'svg'].indexOf(fileType) !== -1) {
                    initCanvasDownloadData();
            Severity: Major
            Found in app/scripts/views/components/pieChart/pieChart.js and 1 other location - About 1 hr to fix
            app/scripts/views/components/barChart/barChart.js on lines 492..498

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

            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

            Line 347 exceeds the maximum line length of 80.
            Open

                    label.sampleRate = (_currentSampleSize <= 0 ? 0 : (Number(label.cases) * 100 / _currentSampleSize).toFixed(1).toString()) + '%';

            enforce a maximum line length (max-len)

            Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters).

            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" }; // very long

            Rule Details

            This rule enforces a maximum line length to increase code readability and maintainability.

            Note: This rule calculates the length of a line via code points, not characters. That means if you use a double-byte character in your code, it will count as 2 code points instead of 1, and 2 will be used to calculate line length. This is a technical limitation of JavaScript that is made easier with ES2015, and we will look to update this when ES2015 is available in Node.js.

            Options

            This rule has a number or object option:

            • "code" (default 80) enforces a maximum line length
            • "tabWidth" (default 4) specifies the character width for tab characters
            • "comments" enforces a maximum line length for comments; defaults to value of code
            • "ignorePattern" ignores lines matching a regular expression; can only match a single line and need to be double escaped when written in YAML or JSON
            • "ignoreComments": true ignores all trailing comments and comments on their own line
            • "ignoreTrailingComments": true ignores only trailing comments
            • "ignoreUrls": true ignores lines that contain a URL

            code

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = {
              "bar": "This is a bar.",
              "baz": { "qux": "This is a qux" },
              "easier": "to read"
            };

            tabWidth

            Examples of incorrect code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" } };

            Examples of correct code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = {
            \t  \t  \t  \t  "bar": "This is a bar.",
            \t  \t  \t  \t  "baz": { "qux": "This is a qux" }
            \t  \t  };

            comments

            Examples of incorrect code for this rule with the { "comments": 65 } option:

            /*eslint max-len: ["error", { "comments": 65 }]*/
            
            /**
             * This is a comment that violates the maximum line length we have specified
            **/

            ignoreComments

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

            /*eslint max-len: ["error", { "ignoreComments": true }]*/
            
            /**
             * This is a really really really really really really really really really long comment
            **/

            ignoreTrailingComments

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

            /*eslint max-len: ["error", { "ignoreTrailingComments": true }]*/
            
            var foo = 'bar'; // This is a really really really really really really really long comment

            ignoreUrls

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

            /*eslint max-len: ["error", { "ignoreUrls": true }]*/
            
            var url = 'https://www.example.com/really/really/really/really/really/really/really/long';

            ignorePattern

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

            /*eslint max-len: ["error", { "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\(/" }]*/
            
            var dep = require('really/really/really/really/really/really/really/really/long/module');

            Related Rules

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

            Missing JSDoc comment.
            Open

                function animateTable(target, view, callback) {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function updateReactTable() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function drawMarker(_slice) {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            When Not To Use It

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

            Related Rules

            Line 110 exceeds the maximum line length of 80.
            Open

                      classes: 'qtip-light qtip-rounded qtip-shadow forceZindex qtip-max-width iviz-pie-qtip iviz-pie-label-qtip'

            enforce a maximum line length (max-len)

            Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters).

            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" }; // very long

            Rule Details

            This rule enforces a maximum line length to increase code readability and maintainability.

            Note: This rule calculates the length of a line via code points, not characters. That means if you use a double-byte character in your code, it will count as 2 code points instead of 1, and 2 will be used to calculate line length. This is a technical limitation of JavaScript that is made easier with ES2015, and we will look to update this when ES2015 is available in Node.js.

            Options

            This rule has a number or object option:

            • "code" (default 80) enforces a maximum line length
            • "tabWidth" (default 4) specifies the character width for tab characters
            • "comments" enforces a maximum line length for comments; defaults to value of code
            • "ignorePattern" ignores lines matching a regular expression; can only match a single line and need to be double escaped when written in YAML or JSON
            • "ignoreComments": true ignores all trailing comments and comments on their own line
            • "ignoreTrailingComments": true ignores only trailing comments
            • "ignoreUrls": true ignores lines that contain a URL

            code

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = {
              "bar": "This is a bar.",
              "baz": { "qux": "This is a qux" },
              "easier": "to read"
            };

            tabWidth

            Examples of incorrect code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" } };

            Examples of correct code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = {
            \t  \t  \t  \t  "bar": "This is a bar.",
            \t  \t  \t  \t  "baz": { "qux": "This is a qux" }
            \t  \t  };

            comments

            Examples of incorrect code for this rule with the { "comments": 65 } option:

            /*eslint max-len: ["error", { "comments": 65 }]*/
            
            /**
             * This is a comment that violates the maximum line length we have specified
            **/

            ignoreComments

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

            /*eslint max-len: ["error", { "ignoreComments": true }]*/
            
            /**
             * This is a really really really really really really really really really long comment
            **/

            ignoreTrailingComments

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

            /*eslint max-len: ["error", { "ignoreTrailingComments": true }]*/
            
            var foo = 'bar'; // This is a really really really really really really really long comment

            ignoreUrls

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

            /*eslint max-len: ["error", { "ignoreUrls": true }]*/
            
            var url = 'https://www.example.com/really/really/really/really/really/really/really/long';

            ignorePattern

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

            /*eslint max-len: ["error", { "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\(/" }]*/
            
            var dep = require('really/really/really/really/really/really/really/really/long/module');

            Related Rules

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

            Missing JSDoc comment.
            Open

                function initReactData() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            When Not To Use It

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

            Related Rules

            Trailing spaces not allowed.
            Open

                  

            Disallow trailing spaces at the end of lines (no-trailing-spaces)

            (fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

            Sometimes in the course of editing files, you can end up with extra whitespace at the end of lines. These whitespace differences can be picked up by source control systems and flagged as diffs, causing frustration for developers. While this extra whitespace causes no functional issues, many code conventions require that trailing spaces be removed before checkin.

            Rule Details

            The following patterns are considered problems:

            /*eslint no-trailing-spaces: "error"*/
            
            // spaces, tabs and unicode whitespaces
            // are not allowed at the end of lines
            var foo = 0;//•••••
            var baz = 5;//••

            The following patterns are not considered problems:

            /*eslint no-trailing-spaces: "error"*/
            
            var foo = 0;
            
            var baz = 5;

            Options

            There is one option for this rule, skipBlankLines. When set to true, the rule will not flag any lines that are made up purely of whitespace. In short, if a line is zero-length after being trimmed of whitespace, then the rule will not flag that line when skipBlankLines is enabled.

            You can enable this option in your config like this:

            {
                "no-trailing-spaces": ["error", { "skipBlankLines": true }]
            }

            With this option enabled, The following patterns are not considered problems:

            /*eslint no-trailing-spaces: ["error", { "skipBlankLines": true }]*/
            
            var foo = 0;
            //••••
            var baz = 5;

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

            Missing JSDoc comment.
            Open

                function pieLabelMouseLeave(data) {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function updatePieLabels() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function initCanvasDownloadData() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function pieLabelMouseEnter(data) {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            When Not To Use It

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

            Related Rules

            Line 510 exceeds the maximum line length of 80.
            Open

                  v.renderedReactTable = ReactDOM.render(testElement, document.getElementById(targetId));

            enforce a maximum line length (max-len)

            Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters).

            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" }; // very long

            Rule Details

            This rule enforces a maximum line length to increase code readability and maintainability.

            Note: This rule calculates the length of a line via code points, not characters. That means if you use a double-byte character in your code, it will count as 2 code points instead of 1, and 2 will be used to calculate line length. This is a technical limitation of JavaScript that is made easier with ES2015, and we will look to update this when ES2015 is available in Node.js.

            Options

            This rule has a number or object option:

            • "code" (default 80) enforces a maximum line length
            • "tabWidth" (default 4) specifies the character width for tab characters
            • "comments" enforces a maximum line length for comments; defaults to value of code
            • "ignorePattern" ignores lines matching a regular expression; can only match a single line and need to be double escaped when written in YAML or JSON
            • "ignoreComments": true ignores all trailing comments and comments on their own line
            • "ignoreTrailingComments": true ignores only trailing comments
            • "ignoreUrls": true ignores lines that contain a URL

            code

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = {
              "bar": "This is a bar.",
              "baz": { "qux": "This is a qux" },
              "easier": "to read"
            };

            tabWidth

            Examples of incorrect code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" } };

            Examples of correct code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = {
            \t  \t  \t  \t  "bar": "This is a bar.",
            \t  \t  \t  \t  "baz": { "qux": "This is a qux" }
            \t  \t  };

            comments

            Examples of incorrect code for this rule with the { "comments": 65 } option:

            /*eslint max-len: ["error", { "comments": 65 }]*/
            
            /**
             * This is a comment that violates the maximum line length we have specified
            **/

            ignoreComments

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

            /*eslint max-len: ["error", { "ignoreComments": true }]*/
            
            /**
             * This is a really really really really really really really really really long comment
            **/

            ignoreTrailingComments

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

            /*eslint max-len: ["error", { "ignoreTrailingComments": true }]*/
            
            var foo = 'bar'; // This is a really really really really really really really long comment

            ignoreUrls

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

            /*eslint max-len: ["error", { "ignoreUrls": true }]*/
            
            var url = 'https://www.example.com/really/really/really/really/really/really/really/long';

            ignorePattern

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

            /*eslint max-len: ["error", { "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\(/" }]*/
            
            var dep = require('really/really/really/really/really/really/really/really/long/module');

            Related Rules

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

            Missing JSDoc comment.
            Open

                function initTsvDownloadData() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function removeMarker() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function getPieSlice(data) {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            When Not To Use It

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

            Related Rules

            Line 508 exceeds the maximum line length of 80.
            Open

                  var testElement = React.createElement(EnhancedFixedDataTableSpecial, opts_);

            enforce a maximum line length (max-len)

            Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters).

            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" }; // very long

            Rule Details

            This rule enforces a maximum line length to increase code readability and maintainability.

            Note: This rule calculates the length of a line via code points, not characters. That means if you use a double-byte character in your code, it will count as 2 code points instead of 1, and 2 will be used to calculate line length. This is a technical limitation of JavaScript that is made easier with ES2015, and we will look to update this when ES2015 is available in Node.js.

            Options

            This rule has a number or object option:

            • "code" (default 80) enforces a maximum line length
            • "tabWidth" (default 4) specifies the character width for tab characters
            • "comments" enforces a maximum line length for comments; defaults to value of code
            • "ignorePattern" ignores lines matching a regular expression; can only match a single line and need to be double escaped when written in YAML or JSON
            • "ignoreComments": true ignores all trailing comments and comments on their own line
            • "ignoreTrailingComments": true ignores only trailing comments
            • "ignoreUrls": true ignores lines that contain a URL

            code

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = {
              "bar": "This is a bar.",
              "baz": { "qux": "This is a qux" },
              "easier": "to read"
            };

            tabWidth

            Examples of incorrect code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" } };

            Examples of correct code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = {
            \t  \t  \t  \t  "bar": "This is a bar.",
            \t  \t  \t  \t  "baz": { "qux": "This is a qux" }
            \t  \t  };

            comments

            Examples of incorrect code for this rule with the { "comments": 65 } option:

            /*eslint max-len: ["error", { "comments": 65 }]*/
            
            /**
             * This is a comment that violates the maximum line length we have specified
            **/

            ignoreComments

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

            /*eslint max-len: ["error", { "ignoreComments": true }]*/
            
            /**
             * This is a really really really really really really really really really long comment
            **/

            ignoreTrailingComments

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

            /*eslint max-len: ["error", { "ignoreTrailingComments": true }]*/
            
            var foo = 'bar'; // This is a really really really really really really really long comment

            ignoreUrls

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

            /*eslint max-len: ["error", { "ignoreUrls": true }]*/
            
            var url = 'https://www.example.com/really/really/really/really/really/really/really/long';

            ignorePattern

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

            /*eslint max-len: ["error", { "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\(/" }]*/
            
            var dep = require('really/really/really/really/really/really/really/really/long/module');

            Related Rules

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

            Line 116 exceeds the maximum line length of 80.
            Open

                    content: '<div id="qtip-' + v.opts.chartDivId + '-content-react">Loading....</div>',

            enforce a maximum line length (max-len)

            Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters).

            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" }; // very long

            Rule Details

            This rule enforces a maximum line length to increase code readability and maintainability.

            Note: This rule calculates the length of a line via code points, not characters. That means if you use a double-byte character in your code, it will count as 2 code points instead of 1, and 2 will be used to calculate line length. This is a technical limitation of JavaScript that is made easier with ES2015, and we will look to update this when ES2015 is available in Node.js.

            Options

            This rule has a number or object option:

            • "code" (default 80) enforces a maximum line length
            • "tabWidth" (default 4) specifies the character width for tab characters
            • "comments" enforces a maximum line length for comments; defaults to value of code
            • "ignorePattern" ignores lines matching a regular expression; can only match a single line and need to be double escaped when written in YAML or JSON
            • "ignoreComments": true ignores all trailing comments and comments on their own line
            • "ignoreTrailingComments": true ignores only trailing comments
            • "ignoreUrls": true ignores lines that contain a URL

            code

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = {
              "bar": "This is a bar.",
              "baz": { "qux": "This is a qux" },
              "easier": "to read"
            };

            tabWidth

            Examples of incorrect code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" } };

            Examples of correct code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = {
            \t  \t  \t  \t  "bar": "This is a bar.",
            \t  \t  \t  \t  "baz": { "qux": "This is a qux" }
            \t  \t  };

            comments

            Examples of incorrect code for this rule with the { "comments": 65 } option:

            /*eslint max-len: ["error", { "comments": 65 }]*/
            
            /**
             * This is a comment that violates the maximum line length we have specified
            **/

            ignoreComments

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

            /*eslint max-len: ["error", { "ignoreComments": true }]*/
            
            /**
             * This is a really really really really really really really really really long comment
            **/

            ignoreTrailingComments

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

            /*eslint max-len: ["error", { "ignoreTrailingComments": true }]*/
            
            var foo = 'bar'; // This is a really really really really really really really long comment

            ignoreUrls

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

            /*eslint max-len: ["error", { "ignoreUrls": true }]*/
            
            var url = 'https://www.example.com/really/really/really/really/really/really/really/long';

            ignorePattern

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

            /*eslint max-len: ["error", { "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\(/" }]*/
            
            var dep = require('really/really/really/really/really/really/really/really/long/module');

            Related Rules

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

            Trailing spaces not allowed.
            Open

                  

            Disallow trailing spaces at the end of lines (no-trailing-spaces)

            (fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

            Sometimes in the course of editing files, you can end up with extra whitespace at the end of lines. These whitespace differences can be picked up by source control systems and flagged as diffs, causing frustration for developers. While this extra whitespace causes no functional issues, many code conventions require that trailing spaces be removed before checkin.

            Rule Details

            The following patterns are considered problems:

            /*eslint no-trailing-spaces: "error"*/
            
            // spaces, tabs and unicode whitespaces
            // are not allowed at the end of lines
            var foo = 0;//•••••
            var baz = 5;//••

            The following patterns are not considered problems:

            /*eslint no-trailing-spaces: "error"*/
            
            var foo = 0;
            
            var baz = 5;

            Options

            There is one option for this rule, skipBlankLines. When set to true, the rule will not flag any lines that are made up purely of whitespace. In short, if a line is zero-length after being trimmed of whitespace, then the rule will not flag that line when skipBlankLines is enabled.

            You can enable this option in your config like this:

            {
                "no-trailing-spaces": ["error", { "skipBlankLines": true }]
            }

            With this option enabled, The following patterns are not considered problems:

            /*eslint no-trailing-spaces: ["error", { "skipBlankLines": true }]*/
            
            var foo = 0;
            //••••
            var baz = 5;

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

            Missing JSDoc comment.
            Open

                function updateCurrentLabels() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            When Not To Use It

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

            Related Rules

            Newline required at end of file but not found.
            Open

            );

            Require file to end with single newline (eol-last)

            (fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

            Trailing newlines in non-empty files are a common UNIX idiom. Benefits of trailing newlines include the ability to concatenate or append to files as well as output files to the terminal without interfering with shell prompts.

            Rule Details

            This rule requires at least one newline at the end of non-empty files.

            Prior to v0.16.0 this rule also enforced that there was only a single line at the end of the file. If you still want this behaviour, consider enabling [no-multiple-empty-lines](no-multiple-empty-lines.md) with maxEOF and/or [no-trailing-spaces](no-trailing-spaces.md).

            Examples of incorrect code for this rule:

            /*eslint eol-last: "error"*/
            
            function doSmth() {
              var foo = 2;
            }

            Examples of correct code for this rule:

            /*eslint eol-last: "error"*/
            
            function doSmth() {
              var foo = 2;
            }

            Options

            This rule has a string option:

            • "unix" (default) enforces line feed (LF) as newline
            • "windows" enforces carriage return line feed (CRLF) as newline Source: http://eslint.org/docs/rules/

            Missing JSDoc comment.
            Open

                function updateQtipReactTable() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function updateTables() {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function getCurrentSampleSizeFromCategories(categories) {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            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

                function initReactTable(targetId, inputData, opts) {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            When Not To Use It

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

            Related Rules

            Line 521 exceeds the maximum line length of 80.
            Open

              iViz.view.component.PieChart.prototype = new iViz.view.component.GeneralChart('pieChart');

            enforce a maximum line length (max-len)

            Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters).

            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" }; // very long

            Rule Details

            This rule enforces a maximum line length to increase code readability and maintainability.

            Note: This rule calculates the length of a line via code points, not characters. That means if you use a double-byte character in your code, it will count as 2 code points instead of 1, and 2 will be used to calculate line length. This is a technical limitation of JavaScript that is made easier with ES2015, and we will look to update this when ES2015 is available in Node.js.

            Options

            This rule has a number or object option:

            • "code" (default 80) enforces a maximum line length
            • "tabWidth" (default 4) specifies the character width for tab characters
            • "comments" enforces a maximum line length for comments; defaults to value of code
            • "ignorePattern" ignores lines matching a regular expression; can only match a single line and need to be double escaped when written in YAML or JSON
            • "ignoreComments": true ignores all trailing comments and comments on their own line
            • "ignoreTrailingComments": true ignores only trailing comments
            • "ignoreUrls": true ignores lines that contain a URL

            code

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };

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

            /*eslint max-len: ["error", 80]*/
            
            var foo = {
              "bar": "This is a bar.",
              "baz": { "qux": "This is a qux" },
              "easier": "to read"
            };

            tabWidth

            Examples of incorrect code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" } };

            Examples of correct code for this rule with the default { "tabWidth": 4 } option:

            /*eslint max-len: ["error", 80, 4]*/
            
            \t  \t  var foo = {
            \t  \t  \t  \t  "bar": "This is a bar.",
            \t  \t  \t  \t  "baz": { "qux": "This is a qux" }
            \t  \t  };

            comments

            Examples of incorrect code for this rule with the { "comments": 65 } option:

            /*eslint max-len: ["error", { "comments": 65 }]*/
            
            /**
             * This is a comment that violates the maximum line length we have specified
            **/

            ignoreComments

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

            /*eslint max-len: ["error", { "ignoreComments": true }]*/
            
            /**
             * This is a really really really really really really really really really long comment
            **/

            ignoreTrailingComments

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

            /*eslint max-len: ["error", { "ignoreTrailingComments": true }]*/
            
            var foo = 'bar'; // This is a really really really really really really really long comment

            ignoreUrls

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

            /*eslint max-len: ["error", { "ignoreUrls": true }]*/
            
            var url = 'https://www.example.com/really/really/really/really/really/really/really/long';

            ignorePattern

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

            /*eslint max-len: ["error", { "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\(/" }]*/
            
            var dep = require('really/really/really/really/really/really/really/really/long/module');

            Related Rules

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

            Missing JSDoc comment.
            Open

                function pieLabelClick(selectedData) {

            Require JSDoc comment (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 generates warnings for nodes that do not have JSDoc comments when they should. Supported nodes:

            • FunctionDeclaration
            • ClassDeclaration
            • MethodDefinition

            Options

            This rule accepts a require object with its properties as

            • FunctionDeclaration (default: true)
            • ClassDeclaration (default: false)
            • MethodDefinition (default: false)

            Default option settings are

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

            The following patterns are considered problems:

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

            The following patterns are not considered problems:

            /*eslint "require-jsdoc": ["error", {
                "require": {
                    "FunctionDeclaration": true,
                    "MethodDefinition": true,
                    "ClassDeclaration": true
                }
            }]*/
            
            /**
            * It returns 10
            */
            function 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(){}
            }

            When Not To Use It

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

            Related Rules

            There are no issues that match your filters.

            Category
            Status