cBioPortal/iViz

View on GitHub
app/scripts/views/components/scatterPlot/scatterPlotTemplate.js

Summary

Maintainability
C
1 day
Test Coverage

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

    ready: function() {
      var _self = this;
      _self.showLoad = true;

      // make scatterplot can be closed even if ajax fails
Severity: Minor
Found in app/scripts/views/components/scatterPlot/scatterPlotTemplate.js - About 1 hr to fix

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

          attachPlotlySelectedEvent: function() {
            var _self = this;
            var data = iViz.getGroupNdx(_self.attributes.group_id);
    
            document.getElementById(this.chartId).on('plotly_selected',
    Severity: Minor
    Found in app/scripts/views/components/scatterPlot/scatterPlotTemplate.js - About 1 hr to fix

      Function data has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          data: function() {
            return {
              chartDivId:
                iViz.util.getDefaultDomId('chartDivId', this.attributes.attr_id),
              resetBtnId:
      Severity: Minor
      Found in app/scripts/views/components/scatterPlot/scatterPlotTemplate.js - About 1 hr to fix

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

              'addingChart': function(groupId, val) {
                if (this.attributes.group_id === groupId) {
                  if (this.attributes.filter.length > 0) {
                    if (val) {
                      this.invisibleDimension.filterAll();
        app/scripts/views/components/survivalChart/template.js on lines 88..106

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

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

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

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

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

        Refactorings

        Further Reading

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

                loadingBar :{
                  status: 0,
                  type: 'percentage',
                  divId: iViz.util.getDefaultDomId('progressBarId', this.attributes.attr_id),
                  opts: {},
        app/scripts/views/components/dataTable/tableViewTemplate.js on lines 55..61
        app/scripts/views/components/survivalChart/template.js on lines 46..52

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

        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

              showLoad: function(newVal) {
                if (newVal) {
                  this.initialInfinityLoadingBar();
                } else {
                  this.loadingBar.disable = true;
        Severity: Minor
        Found in app/scripts/views/components/scatterPlot/scatterPlotTemplate.js and 1 other location - About 35 mins to fix
        app/scripts/views/components/survivalChart/template.js on lines 66..72

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

        Line 138 exceeds the maximum line length of 80.
        Open

                        var _key = _dataObj.FRACTION_GENOME_ALTERED + '||' + _dataObj.MUTATION_COUNT;

        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/

        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/

        Line 15 exceeds the maximum line length of 80.
        Open

            ' :attributes="attributes" :filters.sync="attributes.filter"></chart-operations>' +

        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 20 exceeds the maximum line length of 80.
        Open

            '<progress-bar :div-id="loadingBar.divId" :type="loadingBar.type" :disable="loadingBar.disable" ' +

        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 12 exceeds the maximum line length of 80.
        Open

            ' :display-name="displayName" :has-chart-title="true" :groupid="attributes.group_id"' +

        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 19 exceeds the maximum line length of 80.
        Open

            '<div v-show="showLoad" class="progress-bar-parent-div" :class="{\'show-loading-bar\': showLoad}" >' +

        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 50 exceeds the maximum line length of 80.
        Open

                  divId: iViz.util.getDefaultDomId('progressBarId', this.attributes.attr_id),

        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 space before value for key 'loadingBar'.
        Open

                loadingBar :{

        enforce consistent spacing between keys and values in object literal properties (key-spacing)

        This rule enforces spacing around the colon in object literal properties. It can verify each property individually, or it can ensure horizontal alignment of adjacent properties in an object literal.

        Rule Details

        This rule enforces consistent spacing between keys and values in object literal properties. In the case of long lines, it is acceptable to add a new line wherever whitespace is allowed.

        Options

        This rule has an object option:

        • "beforeColon": false (default) disallows spaces between the key and the colon in object literals
        • "beforeColon": true requires at least one space between the key and the colon in object literals
        • "afterColon": true (default) requires at least one space between the colon and the value in object literals
        • "afterColon": false disallows spaces between the colon and the value in object literals
        • "mode": strict (default) enforces exactly one space before or after colons in object literals
        • "mode": minimum enforces one or more spaces before or after colons in object literals
        • "align": "value" enforces horizontal alignment of values in object literals
        • "align": "colon" enforces horizontal alignment of both colons and values in object literals.
        • "singleLine" specifies a spacing style for single-line object literals
        • "multiLine" specifies a spacing style for multi-line object literals

        Please note that you can either use the top-level options or the grouped options (singleLine and multiLine) but not both.

        beforeColon

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

        /*eslint key-spacing: ["error", { "beforeColon": false }]*/
        
        var obj = { "foo" : 42 };

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

        /*eslint key-spacing: ["error", { "beforeColon": false }]*/
        
        var obj = { "foo": 42 };

        Examples of incorrect code for this rule with the { "beforeColon": true } option:

        /*eslint key-spacing: ["error", { "beforeColon": true }]*/
        
        var obj = { "foo": 42 };

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

        /*eslint key-spacing: ["error", { "beforeColon": true }]*/
        
        var obj = { "foo" : 42 };

        afterColon

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

        /*eslint key-spacing: ["error", { "afterColon": true }]*/
        
        var obj = { "foo":42 };

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

        /*eslint key-spacing: ["error", { "afterColon": true }]*/
        
        var obj = { "foo": 42 };

        Examples of incorrect code for this rule with the { "afterColon": false } option:

        /*eslint key-spacing: ["error", { "afterColon": false }]*/
        
        var obj = { "foo": 42 };

        Examples of correct code for this rule with the { "afterColon": false } option:

        /*eslint key-spacing: ["error", { "afterColon": false }]*/
        
        var obj = { "foo":42 };

        mode

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

        /*eslint key-spacing: ["error", { "mode": "strict" }]*/
        
        call({
            foobar: 42,
            bat:    2 * 2
        });

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

        /*eslint key-spacing: ["error", { "mode": "strict" }]*/
        
        call({
            foobar: 42,
            bat: 2 * 2
        });

        Examples of correct code for this rule with the { "mode": "minimum" } option:

        /*eslint key-spacing: ["error", { "mode": "minimum" }]*/
        
        call({
            foobar: 42,
            bat:    2 * 2
        });

        align

        Examples of incorrect code for this rule with the { "align": "value" } option:

        /*eslint key-spacing: ["error", { "align": "value" }]*/
        
        var obj = {
            a: value,
            bcde:  42,
            fg :   foo()
        };

        Examples of correct code for this rule with the { "align": "value" } option:

        /*eslint key-spacing: ["error", { "align": "value" }]*/
        
        var obj = {
            a:    value,
            bcde: 42,
        
            fg: foo(),
            h:  function() {
                return this.a;
            },
            ijkl: 'Non-consecutive lines form a new group'
        };
        
        var obj = { a: "foo", longPropertyName: "bar" };

        Examples of incorrect code for this rule with the { "align": "colon" } option:

        /*eslint key-spacing: ["error", { "align": "colon" }]*/
        
        call({
            foobar: 42,
            bat:    2 * 2
        });

        Examples of correct code for this rule with the { "align": "colon" } option:

        /*eslint key-spacing: ["error", { "align": "colon" }]*/
        
        call({
            foobar: 42,
            bat   : 2 * 2
        });

        singleLine and multiLine

        Examples of correct code for this rule with sample { "singleLine": { }, "multiLine": { } } options:

        /*eslint "key-spacing": [2, {
            "singleLine": {
                "beforeColon": false,
                "afterColon": true
            },
            "multiLine": {
                "beforeColon": true,
                "afterColon": true,
                "align": "colon"
            }
        }]*/
        var obj = { one: 1, "two": 2, three: 3 };
        var obj2 = {
            "two" : 2,
            three : 3
        };

        When Not To Use It

        If you have another convention for property spacing that might not be consistent with the available options, or if you want to permit multiple styles concurrently you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Line 171 exceeds the maximum line length of 80.
        Open

                _self.attributes.group_type === 'patient' ? 'patient_uid' : 'sample_uid';

        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/

        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/

        Inconsistently quoted property 'showLoad' found.
        Open

            watch: {

        Quoting Style for Property Names (quote-props)

        Object literal property names can be defined in two ways: using literals or using strings. For example, these two objects are equivalent:

        var object1 = {
            property: true
        };
        
        var object2 = {
            "property": true
        };

        In many cases, it doesn't matter if you choose to use an identifier instead of a string or vice-versa. Even so, you might decide to enforce a consistent style in your code.

        There are, however, some occasions when you must use quotes:

        1. If you are using an ECMAScript 3 JavaScript engine (such as IE8) and you want to use a keyword (such as if) as a property name. This restriction was removed in ECMAScript 5.
        2. You want to use a non-identifier character in your property name, such as having a property with a space like "one two".

        Another example where quotes do matter is when using numeric literals as property keys:

        var object = {
            1e2: 1,
            100: 2
        };

        This may look alright at first sight, but this code in fact throws a syntax error in ECMAScript 5 strict mode. This happens because 1e2 and 100 are coerced into strings before getting used as the property name. Both String(1e2) and String(100) happen to be equal to "100", which causes the "Duplicate data property in object literal not allowed in strict mode" error. Issues like that can be tricky to debug, so some prefer to require quotes around all property names.

        Rule Details

        This rule aims to enforce use of quotes in property names and as such will flag any properties that don't use quotes (default behavior).

        Options

        There are four behaviors for this rule: "always" (default), "as-needed", "consistent" and "consistent-as-needed". You can define these options in your configuration as:

        {
            "quote-props": ["error", "as-needed"]
        }

        "always"

        When configured with "always" as the first option (the default), quoting for all properties will be enforced. Some believe that ensuring property names in object literals are always wrapped in quotes is generally a good idea, since depending on the property name you may need to quote them anyway. Consider this example:

        var object = {
            foo: "bar",
            baz: 42,
            "qux-lorem": true
        };

        Here, the properties foo and baz are not wrapped in quotes, but qux-lorem is, because it doesn’t work without the quotes. This is rather inconsistent. Instead, you may prefer to quote names of all properties:

        var object = {
            "foo": "bar",
            "baz": 42,
            "qux-lorem": true
        };

        or, if you prefer single quotes:

        var object = {
            'foo': 'bar',
            'baz': 42,
            'qux-lorem': true
        };

        When configured with "always" as the first option (the default), quoting for all properties will be enforced. The following patterns are considered problems:

        /*eslint quote-props: ["error", "always"]*/
        
        var object = {
            foo: "bar",
            baz: 42,
            "qux-lorem": true
        };

        The following patterns are not considered problems:

        /*eslint quote-props: ["error", "always"]*/
        /*eslint-env es6*/
        
        var object1 = {
            "foo": "bar",
            "baz": 42,
            "qux-lorem": true
        };
        
        var object2 = {
            'foo': 'bar',
            'baz': 42,
            'qux-lorem': true
        };
        
        var object3 = {
            foo() {
                return;
            }
        };

        "as-needed"

        When configured with "as-needed" as the first option, quotes will be enforced when they are strictly required, and unnecessary quotes will cause warnings. The following patterns are considered problems:

        /*eslint quote-props: ["error", "as-needed"]*/
        
        var object = {
            "a": 0,
            "0": 0,
            "true": 0,
            "null": 0
        };

        The following patterns are not considered problems:

        /*eslint quote-props: ["error", "as-needed"]*/
        /*eslint-env es6*/
        
        var object1 = {
            "a-b": 0,
            "0x0": 0,
            "1e2": 0
        };
        
        var object2 = {
            foo: 'bar',
            baz: 42,
            true: 0,
            0: 0,
            'qux-lorem': true
        };
        
        var object3 = {
            foo() {
                return;
            }
        };

        When the "as-needed" mode is selected, an additional keywords option can be provided. This flag indicates whether language keywords should be quoted as properties. By default it is set to false.

        {
            "quote-props": ["error", "as-needed", { "keywords": true }]
        }

        When keywords is set to true, the following patterns become problems:

        /*eslint quote-props: ["error", "as-needed", { "keywords": true }]*/
        
        var x = {
            while: 1,
            volatile: "foo"
        };

        Another modifier for this rule is the unnecessary option which defaults to true. Setting this to false will prevent the rule from complaining about unnecessarily quoted properties. This comes in handy when you only care about quoting keywords.

        {
            "quote-props": ["error", "as-needed", { "keywords": true, "unnecessary": false }]
        }

        When unnecessary is set to false, the following patterns stop being problems:

        /*eslint quote-props: ["error", "as-needed", { "keywords": true, "unnecessary": false }]*/
        
        var x = {
            "while": 1,
            "foo": "bar"  // Would normally have caused a warning
        };

        A numbers flag, with default value false, can also be used as a modifier for the "as-needed" mode. When it is set to true, numeric literals should always be quoted.

        {
            "quote-props": ["error", "as-needed", {"numbers": true}]
        }

        When numbers is set to true, the following patterns become problems:

        /*eslint quote-props: ["error", "as-needed", { "numbers": true }]*/
        
        var x = {
            100: 1
        }

        and the following patterns stop being problems:

        var x = {
            "100": 1
        }

        "consistent"

        When configured with "consistent", the patterns below are considered problems. Basically "consistent" means all or no properties are expected to be quoted, in other words quoting style can't be mixed within an object. Please note the latter situation (no quotation at all) isn't always possible as some property names require quoting.

        /*eslint quote-props: ["error", "consistent"]*/
        
        var object1 = {
            foo: "bar",
            "baz": 42,
            "qux-lorem": true
        };
        
        var object2 = {
            'foo': 'bar',
            baz: 42
        };

        The following patterns are not considered problems:

        /*eslint quote-props: ["error", "consistent"]*/
        
        var object1 = {
            "foo": "bar",
            "baz": 42,
            "qux-lorem": true
        };
        
        var object2 = {
            'foo': 'bar',
            'baz': 42
        };
        
        var object3 = {
            foo: 'bar',
            baz: 42
        };

        "consistent-as-needed"

        When configured with "consistent-as-needed", the behavior is similar to "consistent" with one difference. Namely, properties' quoting should be consistent (as in "consistent") but whenever all quotes are redundant a warning is raised. In other words if at least one property name has to be quoted (like qux-lorem) then all property names must be quoted, otherwise no properties can be quoted. The following patterns are considered problems:

        /*eslint quote-props: ["error", "consistent-as-needed"]*/
        
        var object1 = {
            foo: "bar",
            "baz": 42,
            "qux-lorem": true
        };
        
        var object2 = {
            'foo': 'bar',
            'baz': 42
        };

        The following patterns are not considered problems:

        /*eslint quote-props: ["error", "consistent-as-needed"]*/
        
        var object1 = {
            "foo": "bar",
            "baz": 42,
            "qux-lorem": true
        };
        
        var object2 = {
            foo: 'bar',
            baz: 42
        };

        When the "consistent-as-needed" mode is selected, an additional keywords option can be provided. This flag indicates whether language keywords can be used unquoted as properties. By default it is set to false.

        {
            "quote-props": ["error", "consistent-as-needed", { "keywords": true }]
        }

        When keywords is set to true, the following patterns are considered problems:

        /*eslint quote-props: ["error", "consistent-as-needed", { "keywords": true }]*/
        
        var x = {
            while: 1,
            volatile: "foo"
        };

        When Not To Use It

        If you don't care if property names are consistently wrapped in quotes or not, and you don't target legacy ES3 environments, turn this rule off.

        Further Reading

        Line 21 exceeds the maximum line length of 80.
        Open

            ' :status="loadingBar.status" :opts="loadingBar.opts"></progress-bar></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/

        Extra space after key 'loadingBar'.
        Open

                loadingBar :{

        enforce consistent spacing between keys and values in object literal properties (key-spacing)

        This rule enforces spacing around the colon in object literal properties. It can verify each property individually, or it can ensure horizontal alignment of adjacent properties in an object literal.

        Rule Details

        This rule enforces consistent spacing between keys and values in object literal properties. In the case of long lines, it is acceptable to add a new line wherever whitespace is allowed.

        Options

        This rule has an object option:

        • "beforeColon": false (default) disallows spaces between the key and the colon in object literals
        • "beforeColon": true requires at least one space between the key and the colon in object literals
        • "afterColon": true (default) requires at least one space between the colon and the value in object literals
        • "afterColon": false disallows spaces between the colon and the value in object literals
        • "mode": strict (default) enforces exactly one space before or after colons in object literals
        • "mode": minimum enforces one or more spaces before or after colons in object literals
        • "align": "value" enforces horizontal alignment of values in object literals
        • "align": "colon" enforces horizontal alignment of both colons and values in object literals.
        • "singleLine" specifies a spacing style for single-line object literals
        • "multiLine" specifies a spacing style for multi-line object literals

        Please note that you can either use the top-level options or the grouped options (singleLine and multiLine) but not both.

        beforeColon

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

        /*eslint key-spacing: ["error", { "beforeColon": false }]*/
        
        var obj = { "foo" : 42 };

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

        /*eslint key-spacing: ["error", { "beforeColon": false }]*/
        
        var obj = { "foo": 42 };

        Examples of incorrect code for this rule with the { "beforeColon": true } option:

        /*eslint key-spacing: ["error", { "beforeColon": true }]*/
        
        var obj = { "foo": 42 };

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

        /*eslint key-spacing: ["error", { "beforeColon": true }]*/
        
        var obj = { "foo" : 42 };

        afterColon

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

        /*eslint key-spacing: ["error", { "afterColon": true }]*/
        
        var obj = { "foo":42 };

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

        /*eslint key-spacing: ["error", { "afterColon": true }]*/
        
        var obj = { "foo": 42 };

        Examples of incorrect code for this rule with the { "afterColon": false } option:

        /*eslint key-spacing: ["error", { "afterColon": false }]*/
        
        var obj = { "foo": 42 };

        Examples of correct code for this rule with the { "afterColon": false } option:

        /*eslint key-spacing: ["error", { "afterColon": false }]*/
        
        var obj = { "foo":42 };

        mode

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

        /*eslint key-spacing: ["error", { "mode": "strict" }]*/
        
        call({
            foobar: 42,
            bat:    2 * 2
        });

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

        /*eslint key-spacing: ["error", { "mode": "strict" }]*/
        
        call({
            foobar: 42,
            bat: 2 * 2
        });

        Examples of correct code for this rule with the { "mode": "minimum" } option:

        /*eslint key-spacing: ["error", { "mode": "minimum" }]*/
        
        call({
            foobar: 42,
            bat:    2 * 2
        });

        align

        Examples of incorrect code for this rule with the { "align": "value" } option:

        /*eslint key-spacing: ["error", { "align": "value" }]*/
        
        var obj = {
            a: value,
            bcde:  42,
            fg :   foo()
        };

        Examples of correct code for this rule with the { "align": "value" } option:

        /*eslint key-spacing: ["error", { "align": "value" }]*/
        
        var obj = {
            a:    value,
            bcde: 42,
        
            fg: foo(),
            h:  function() {
                return this.a;
            },
            ijkl: 'Non-consecutive lines form a new group'
        };
        
        var obj = { a: "foo", longPropertyName: "bar" };

        Examples of incorrect code for this rule with the { "align": "colon" } option:

        /*eslint key-spacing: ["error", { "align": "colon" }]*/
        
        call({
            foobar: 42,
            bat:    2 * 2
        });

        Examples of correct code for this rule with the { "align": "colon" } option:

        /*eslint key-spacing: ["error", { "align": "colon" }]*/
        
        call({
            foobar: 42,
            bat   : 2 * 2
        });

        singleLine and multiLine

        Examples of correct code for this rule with sample { "singleLine": { }, "multiLine": { } } options:

        /*eslint "key-spacing": [2, {
            "singleLine": {
                "beforeColon": false,
                "afterColon": true
            },
            "multiLine": {
                "beforeColon": true,
                "afterColon": true,
                "align": "colon"
            }
        }]*/
        var obj = { one: 1, "two": 2, three: 3 };
        var obj2 = {
            "two" : 2,
            three : 3
        };

        When Not To Use It

        If you have another convention for property spacing that might not be consistent with the available options, or if you want to permit multiple styles concurrently you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Line 79 exceeds the maximum line length of 80.
        Open

                    this.attributes.group_type === 'patient' ? 'patient_uid' : 'sample_uid';

        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/

        There are no issues that match your filters.

        Category
        Status