Emapic/emapic

View on GitHub
routes/utils_api.js

Summary

Maintainability
F
3 wks
Test Coverage

Function exports has 891 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(app) {

    // Function for ordering the votes in descending order
    function orderVotesDesc(results) {
        var orderedVotes = {},
Severity: Major
Found in routes/utils_api.js - About 4 days to fix

    Function exports has a Cognitive Complexity of 177 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(app) {
    
        // Function for ordering the votes in descending order
        function orderVotesDesc(results) {
            var orderedVotes = {},
    Severity: Minor
    Found in routes/utils_api.js - About 3 days to fix

    Cognitive Complexity

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

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

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

    Further reading

    File utils_api.js has 898 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var Promise = require('bluebird'),
        csv = Promise.promisifyAll(require('fast-csv')),
        moment = require('moment'),
        XLSX = require('excel4node'),
        sequelize = models.sequelize;
    Severity: Major
    Found in routes/utils_api.js - About 2 days to fix

      Function 'addLocationStatsXlsxSheet' has too many statements (86). Maximum allowed is 30.
      Open

          function addLocationStatsXlsxSheet(wb, results, i18n) {
      Severity: Minor
      Found in routes/utils_api.js by eslint

      enforce a maximum number of statements allowed in function blocks (max-statements)

      The max-statements rule allows you to specify the maximum number of statements allowed in a function.

      function foo() {
        var bar = 1; // one statement
        var baz = 2; // two statements
        var qux = 3; // three statements
      }

      Rule Details

      This rule enforces a maximum number of statements allowed in function blocks.

      Options

      This rule has a number or object option:

      • "max" (default 10) enforces a maximum number of statements allows in function blocks

      Deprecated: The object property maximum is deprecated; please use the object property max instead.

      This rule has an object option:

      • "ignoreTopLevelFunctions": true ignores top-level functions

      max

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

      /*eslint max-statements: ["error", 10]*/
      /*eslint-env es6*/
      
      function foo() {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
      
        var foo11 = 11; // Too many.
      }
      
      let foo = () => {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
      
        var foo11 = 11; // Too many.
      };

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

      /*eslint max-statements: ["error", 10]*/
      /*eslint-env es6*/
      
      function foo() {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
        return function () {
      
          // The number of statements in the inner function does not count toward the
          // statement maximum.
      
          return 42;
        };
      }
      
      let foo = () => {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
        return function () {
      
          // The number of statements in the inner function does not count toward the
          // statement maximum.
      
          return 42;
        };
      }

      ignoreTopLevelFunctions

      Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

      /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
      
      function foo() {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
        var foo11 = 11;
      }

      Related Rules

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

      Function addLocationStatsXlsxSheet has 165 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function addLocationStatsXlsxSheet(wb, results, i18n) {
              var ws = wb.addWorksheet(i18n.__('export_sheet_location_stats')),
                  headerStyle = wb.createStyle({
                      font: {
                          color: '#000000',
      Severity: Major
      Found in routes/utils_api.js - About 6 hrs to fix

        Function addResultsXlsxSheet has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function addResultsXlsxSheet(wb, questions, results, i18n) {
                var ws = wb.addWorksheet(i18n.__('export_sheet_answers')),
                    headerStyle = wb.createStyle({
                        font: {
                            color: '#000000',
        Severity: Major
        Found in routes/utils_api.js - About 5 hrs to fix

          Function addQuestionStatsXlsxSheet has 110 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function addQuestionStatsXlsxSheet(wb, questions, results, i18n) {
                  var ws = wb.addWorksheet(i18n.__('export_sheet_question_stats')),
                      headerStyle = wb.createStyle({
                          font: {
                              color: '#000000',
          Severity: Major
          Found in routes/utils_api.js - About 4 hrs to fix

            Function 'addResultsXlsxSheet' has too many statements (38). Maximum allowed is 30.
            Open

                function addResultsXlsxSheet(wb, questions, results, i18n) {
            Severity: Minor
            Found in routes/utils_api.js by eslint

            enforce a maximum number of statements allowed in function blocks (max-statements)

            The max-statements rule allows you to specify the maximum number of statements allowed in a function.

            function foo() {
              var bar = 1; // one statement
              var baz = 2; // two statements
              var qux = 3; // three statements
            }

            Rule Details

            This rule enforces a maximum number of statements allowed in function blocks.

            Options

            This rule has a number or object option:

            • "max" (default 10) enforces a maximum number of statements allows in function blocks

            Deprecated: The object property maximum is deprecated; please use the object property max instead.

            This rule has an object option:

            • "ignoreTopLevelFunctions": true ignores top-level functions

            max

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

            /*eslint max-statements: ["error", 10]*/
            /*eslint-env es6*/
            
            function foo() {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
            
              var foo11 = 11; // Too many.
            }
            
            let foo = () => {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
            
              var foo11 = 11; // Too many.
            };

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

            /*eslint max-statements: ["error", 10]*/
            /*eslint-env es6*/
            
            function foo() {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
              return function () {
            
                // The number of statements in the inner function does not count toward the
                // statement maximum.
            
                return 42;
              };
            }
            
            let foo = () => {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
              return function () {
            
                // The number of statements in the inner function does not count toward the
                // statement maximum.
            
                return 42;
              };
            }

            ignoreTopLevelFunctions

            Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

            /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
            
            function foo() {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
              var foo11 = 11;
            }

            Related Rules

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

            Function 'addQuestionStatsXlsxSheet' has too many statements (33). Maximum allowed is 30.
            Open

                function addQuestionStatsXlsxSheet(wb, questions, results, i18n) {
            Severity: Minor
            Found in routes/utils_api.js by eslint

            enforce a maximum number of statements allowed in function blocks (max-statements)

            The max-statements rule allows you to specify the maximum number of statements allowed in a function.

            function foo() {
              var bar = 1; // one statement
              var baz = 2; // two statements
              var qux = 3; // three statements
            }

            Rule Details

            This rule enforces a maximum number of statements allowed in function blocks.

            Options

            This rule has a number or object option:

            • "max" (default 10) enforces a maximum number of statements allows in function blocks

            Deprecated: The object property maximum is deprecated; please use the object property max instead.

            This rule has an object option:

            • "ignoreTopLevelFunctions": true ignores top-level functions

            max

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

            /*eslint max-statements: ["error", 10]*/
            /*eslint-env es6*/
            
            function foo() {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
            
              var foo11 = 11; // Too many.
            }
            
            let foo = () => {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
            
              var foo11 = 11; // Too many.
            };

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

            /*eslint max-statements: ["error", 10]*/
            /*eslint-env es6*/
            
            function foo() {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
              return function () {
            
                // The number of statements in the inner function does not count toward the
                // statement maximum.
            
                return 42;
              };
            }
            
            let foo = () => {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
              return function () {
            
                // The number of statements in the inner function does not count toward the
                // statement maximum.
            
                return 42;
              };
            }

            ignoreTopLevelFunctions

            Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

            /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
            
            function foo() {
              var foo1 = 1;
              var foo2 = 2;
              var foo3 = 3;
              var foo4 = 4;
              var foo5 = 5;
              var foo6 = 6;
              var foo7 = 7;
              var foo8 = 8;
              var foo9 = 9;
              var foo10 = 10;
              var foo11 = 11;
            }

            Related Rules

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

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

                            transform: function(result) {
                                // First line is always the header, which doesn't need transforming
                                if (results.indexOf(result) === 0) {
                                    return result;
                                }
            Severity: Minor
            Found in routes/utils_api.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                          if (j !== 'name' && j !== 'total_responses' && j !== 'iso_code' &&
                              j !== 'country_id' && j !== 'adm_code' && j !== 'adm_type' &&
                              j !== 'country_iso_code' &&  j !== 'geojson') {
                              question = j.split('_')[0];
                              if (isNaN(question.replace('q', '')) ||
              Severity: Critical
              Found in routes/utils_api.js - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (ansId === questions[l].Answers[m].sortorder) {
                                                ans = questions[l].Answers[m].answer;
                                            }
                Severity: Major
                Found in routes/utils_api.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (questions[j].Answers[l].sortorder === -1) {
                                                  otherAns = questions[j].Answers[l];
                                                  break;
                                              }
                  Severity: Major
                  Found in routes/utils_api.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ('q' + questions[q].question_order === l) {
                                                question = questions[q];
                                                break;
                                            }
                    Severity: Major
                    Found in routes/utils_api.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (question !== null) {
                                                  var answer = null;
                                                  for (var n = 0, nLen = answers[question.question_order].length; n<nLen; n++) {
                                                      if (answers[question.question_order][n].sortorder === orderedVotes[l][m].name.split('_')[1]) {
                                                          answer = answers[question.question_order][n];
                      Severity: Major
                      Found in routes/utils_api.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if (ansId === questions[j].Answers[l].sortorder) {
                                                        ans = questions[j].Answers[l].answer;
                                                    }
                        Severity: Major
                        Found in routes/utils_api.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if (answers[questions[j].question_order][k].sortorder === parseInt(results[i]['q' + questions[j].question_order + '.id'], 10)) {
                                                          answer = answers[questions[j].question_order][k];
                                                          break;
                                                      }
                          Severity: Major
                          Found in routes/utils_api.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if (ansId === questions[l].Answers[n].sortorder) {
                                                            ans = questions[l].Answers[n].answer;
                                                        }
                            Severity: Major
                            Found in routes/utils_api.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if (ansId === questions[j].Answers[l].sortorder) {
                                                              ans = questions[j].Answers[l].answer;
                                                              break;
                                                          }
                              Severity: Major
                              Found in routes/utils_api.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if ((answer.sortorder === -1) && (('q' + questions[j].question_order + '.value') in results[i])) {
                                                                value = answer.answer + ' (' + results[i]['q' + questions[j].question_order + '.value'] + ')';
                                                            } else {
                                                                value = answer.answer;
                                                            }
                                Severity: Major
                                Found in routes/utils_api.js - About 45 mins to fix

                                  'i' is already defined.
                                  Open

                                          for (var i = 1, iLen = finalResults.length; i<iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'j' is already defined.
                                  Open

                                              for (var j = 3, jLen = finalResults[i].length; j<jLen; j++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'i' is already defined.
                                  Open

                                              for (var i = 0, iLen = municipalitiesCodes.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                          for (var i = 0, iLen = results.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                              for (var i = 0, iLen = provincesCodes.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'province' is already defined.
                                  Open

                                                      province = provinces[municipality.province],
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'j' is already defined.
                                  Open

                                              for (var j = 0, jLen = finalResults[i].length; j<jLen; j++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'i' is already defined.
                                  Open

                                              for (var i = 0, iLen = countriesCodes.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                          for (var i = 0, iLen = results.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'j' is already defined.
                                  Open

                                          for (var j = 0, jLen = finalResults[0].length; j<jLen; j++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'i' is already defined.
                                  Open

                                          for (var i = 0, iLen = results.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                          for (var i = 0, iLen = questionsIds.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'firstRow' is already defined.
                                  Open

                                              var firstRow = row;
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'answer' is already defined.
                                  Open

                                                  var answer = question.answers[answerIds[j]];
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'code' is already defined.
                                  Open

                                                  var code = municipalitiesCodes[i],
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'jLen' is already defined.
                                  Open

                                              for (var j = 3, jLen = finalResults[i].length; j<jLen; j++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'jLen' is already defined.
                                  Open

                                              for (var j = 0, jLen = answerIds.length; j < jLen; j++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                              for (var i = 0, iLen = countriesCodes.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'country' is already defined.
                                  Open

                                                      country = countries[province.country];
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  Expected a 'break' statement before 'case'.
                                  Open

                                                  case 'text-answer':
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  Disallow Case Statement Fallthrough (no-fallthrough)

                                  The switch statement in JavaScript is one of the more error-prone constructs of the language thanks in part to the ability to "fall through" from one case to the next. For example:

                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                  
                                      case 2:
                                          doSomethingElse();
                                  }

                                  In this example, if foo is 1, then execution will flow through both cases, as the first falls through to the second. You can prevent this by using break, as in this example:

                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          break;
                                  
                                      case 2:
                                          doSomethingElse();
                                  }

                                  That works fine when you don't want a fallthrough, but what if the fallthrough is intentional, there is no way to indicate that in the language. It's considered a best practice to always indicate when a fallthrough is intentional using a comment which matches the /falls?\s?through/i regular expression:

                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          // falls through
                                  
                                      case 2:
                                          doSomethingElse();
                                  }
                                  
                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          // fall through
                                  
                                      case 2:
                                          doSomethingElse();
                                  }
                                  
                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          // fallsthrough
                                  
                                      case 2:
                                          doSomethingElse();
                                  }

                                  In this example, there is no confusion as to the expected behavior. It is clear that the first case is meant to fall through to the second case.

                                  Rule Details

                                  This rule is aimed at eliminating unintentional fallthrough of one case to the other. As such, it flags any fallthrough scenarios that are not marked by a comment.

                                  Examples of incorrect code for this rule:

                                  /*eslint no-fallthrough: "error"*/
                                  
                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                  
                                      case 2:
                                          doSomething();
                                  }

                                  Examples of correct code for this rule:

                                  /*eslint no-fallthrough: "error"*/
                                  
                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          break;
                                  
                                      case 2:
                                          doSomething();
                                  }
                                  
                                  function bar(foo) {
                                      switch(foo) {
                                          case 1:
                                              doSomething();
                                              return;
                                  
                                          case 2:
                                              doSomething();
                                      }
                                  }
                                  
                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          throw new Error("Boo!");
                                  
                                      case 2:
                                          doSomething();
                                  }
                                  
                                  switch(foo) {
                                      case 1:
                                      case 2:
                                          doSomething();
                                  }
                                  
                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          // falls through
                                  
                                      case 2:
                                          doSomething();
                                  }

                                  Note that the last case statement in these examples does not cause a warning because there is nothing to fall through into.

                                  Options

                                  This rule accepts a single options argument:

                                  • Set the commentPattern option to a regular expression string to change the test for intentional fallthrough comment

                                  commentPattern

                                  Examples of correct code for the { "commentPattern": "break[\\s\\w]*omitted" } option:

                                  /*eslint no-fallthrough: ["error", { "commentPattern": "break[\\s\\w]*omitted" }]*/
                                  
                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          // break omitted
                                  
                                      case 2:
                                          doSomething();
                                  }
                                  
                                  switch(foo) {
                                      case 1:
                                          doSomething();
                                          // caution: break is omitted intentionally
                                  
                                      default:
                                          doSomething();
                                  }

                                  When Not To Use It

                                  If you don't want to enforce that each case statement should end with a throw, return, break, or comment, then you can safely turn this rule off.

                                  Related Rules

                                  'i' is already defined.
                                  Open

                                          for (var i = 0, iLen = results.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'code' is already defined.
                                  Open

                                                  var code = provincesCodes[i],
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                              for (var i = 0, iLen = municipalitiesCodes.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'i' is already defined.
                                  Open

                                          for (var i = 0, iLen = finalResults[0].length; i<iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'j' is already defined.
                                  Open

                                              for (var j = 0, jLen = answerIds.length; j < jLen; j++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'i' is already defined.
                                  Open

                                              for (var i = 0, iLen = provincesCodes.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'i' is already defined.
                                  Open

                                          for (var i = 2, iLen = 8; i <= iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'jLen' is already defined.
                                  Open

                                          for (var j = 0, jLen = finalResults[0].length; j<jLen; j++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'i' is already defined.
                                  Open

                                          for (var i = 0, iLen = finalResults.length; i<iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                          for (var i = 0, iLen = finalResults.length; i<iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'jLen' is already defined.
                                  Open

                                              for (var j = 0, jLen = finalResults[i].length; j<jLen; j++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                          for (var i = 0, iLen = finalResults[0].length; i<iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'i' is already defined.
                                  Open

                                          for (var i = 0, iLen = questionsIds.length; i < iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                          for (var i = 2, iLen = 8; i <= iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'iLen' is already defined.
                                  Open

                                          for (var i = 1, iLen = finalResults.length; i<iLen; i++) {
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

                                  'country' is already defined.
                                  Open

                                                      country = countries[province.country];
                                  Severity: Minor
                                  Found in routes/utils_api.js by eslint

                                  disallow variable redeclaration (no-redeclare)

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

                                  Rule Details

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

                                  Examples of incorrect code for this rule:

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

                                  Examples of correct code for this rule:

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

                                  Options

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

                                  builtinGlobals

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

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

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

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

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

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

                                              for (var l = 0, lLen = questions.length; l < lLen; l++) {
                                                  var ansId, ans;
                                                  switch (questions[l].type) {
                                                      case 'list-radio':
                                                          ans = ansId = parseInt(result['q' + questions[l].question_order + '.id'], 10);
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 2 days to fix
                                  routes/utils_api.js on lines 714..748

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

                                  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

                                                      for (var l = 0, lLen = questions.length; l < lLen; l++) {
                                                          var ansId, ans;
                                                          switch (questions[l].type) {
                                                              case 'list-radio':
                                                                  ans = ansId = parseInt(result['q' + questions[l].question_order + '.id'], 10);
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 2 days to fix
                                  routes/utils_api.js on lines 121..155

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

                                  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

                                                  case 'list-radio-other':
                                                      var otherAns = null;
                                                      for (var j = 0, jLen = questions[i].Answers.length; j < jLen; j++) {
                                                          if (questions[i].Answers[j].sortorder === -1) {
                                                              otherAns = questions[i].Answers[j];
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 6 hrs to fix
                                  routes/utils_api.js on lines 675..685

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

                                  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

                                                  case 'list-radio-other':
                                                      var otherAns = null;
                                                      for (var j = 0, jLen = questions[i].Answers.length; j < jLen; j++) {
                                                          if (questions[i].Answers[j].sortorder === -1) {
                                                              otherAns = questions[i].Answers[j];
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 6 hrs to fix
                                  routes/utils_api.js on lines 87..97

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

                                  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

                                                              answers.push({
                                                                  answer : question.Answers[i].answer,
                                                                  legend : question.Answers[i].legend,
                                                                  id : question.Answers[i].id,
                                                                  imageUrl : (question.Answers[i].img !== null && question.Answers[i].img.length > 0) ? '/answer_img/' + question.Answers[i].id : null,
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 5 hrs to fix
                                  routes/utils_api.js on lines 934..940

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

                                  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

                                                              otherAnswer = {
                                                                  answer : question.Answers[i].answer,
                                                                  legend : question.Answers[i].legend,
                                                                  id : question.Answers[i].id,
                                                                  imageUrl : (question.Answers[i].img !== null && question.Answers[i].img.length > 0) ? '/answer_img/' + question.Answers[i].id : null,
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 5 hrs to fix
                                  routes/utils_api.js on lines 926..932

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              if (result.municipality_code) {
                                                  if (!(municipalities[result.municipality_code])) {
                                                      municipalities[result.municipality_code] = {
                                                          name: result.municipality,
                                                          nr: 0,
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 2 hrs to fix
                                  routes/utils_api.js on lines 380..389

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              if (result.province_code) {
                                                  if (!(provinces[result.province_code])) {
                                                      provinces[result.province_code] = {
                                                          name: result.province,
                                                          nr: 0,
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 2 hrs to fix
                                  routes/utils_api.js on lines 390..399

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

                                  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

                                              headerStyle = wb.createStyle({
                                                  font: {
                                                      color: '#000000',
                                                      size: 11,
                                                      bold: true
                                  Severity: Major
                                  Found in routes/utils_api.js and 2 other locations - About 2 hrs to fix
                                  routes/utils_api.js on lines 40..56
                                  routes/utils_api.js on lines 323..339

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

                                  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

                                              headerStyle = wb.createStyle({
                                                  font: {
                                                      color: '#000000',
                                                      size: 11,
                                                      bold: true
                                  Severity: Major
                                  Found in routes/utils_api.js and 2 other locations - About 2 hrs to fix
                                  routes/utils_api.js on lines 195..211
                                  routes/utils_api.js on lines 323..339

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

                                  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

                                              headerStyle = wb.createStyle({
                                                  font: {
                                                      color: '#000000',
                                                      size: 11,
                                                      bold: true
                                  Severity: Major
                                  Found in routes/utils_api.js and 2 other locations - About 2 hrs to fix
                                  routes/utils_api.js on lines 40..56
                                  routes/utils_api.js on lines 195..211

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 77.

                                  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

                                              ws.cell(row, 7).formula('sum(G' + firstRow + ':G' + (row++ - 1) + ')').style(boldStyle).style(italicStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 1 hr to fix
                                  routes/utils_api.js on lines 459..459

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

                                  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

                                              ws.cell(row, 7).formula('sum(G' + firstRow + ':G' + (row++ - 1) + ')').style(boldStyle).style(italicStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 1 hr to fix
                                  routes/utils_api.js on lines 430..430

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                                  ws.cell(row, 5).formula('D' + row + '/D$' + (row++ + (jLen - j))).style(boldStyle).style(shareStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 3 other locations - About 1 hr to fix
                                  routes/utils_api.js on lines 427..427
                                  routes/utils_api.js on lines 456..456
                                  routes/utils_api.js on lines 489..489

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                                  ws.cell(row, 8).formula('G' + row + '/G$' + (row++ + (iLen - i))).style(boldStyle).style(shareStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 3 other locations - About 1 hr to fix
                                  routes/utils_api.js on lines 305..305
                                  routes/utils_api.js on lines 456..456
                                  routes/utils_api.js on lines 489..489

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                                  ws.cell(row, 8).formula('G' + row + '/G$' + (row++ + (iLen - i))).style(boldStyle).style(shareStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 3 other locations - About 1 hr to fix
                                  routes/utils_api.js on lines 305..305
                                  routes/utils_api.js on lines 427..427
                                  routes/utils_api.js on lines 489..489

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                                  ws.cell(row, 8).formula('G' + row + '/G$' + (row++ + (iLen - i))).style(boldStyle).style(shareStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 3 other locations - About 1 hr to fix
                                  routes/utils_api.js on lines 305..305
                                  routes/utils_api.js on lines 427..427
                                  routes/utils_api.js on lines 456..456

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                                          if (results[i]['q' + questions[j].question_order + '.value'] && results[i]['q' + questions[j].question_order + '.value'].trim()){
                                                              msg += "<li><label>" + questions[j].question + ':<br></label><span>' + results[i]['q' + questions[j].question_order + '.value'].trim() + '</span></li>';
                                                          }
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 1 hr to fix
                                  routes/utils_api.js on lines 592..597

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 61.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                                          if (results[i]['q' + questions[j].question_order + '.value'] && results[i]['q' + questions[j].question_order + '.value'].trim()){
                                                              msg += "<li><label>" + questions[j].question + ':</label><div class="survey-answer-img"><a href="' +
                                                                  results[i]['q' + questions[j].question_order + '.value'].trim() + '" target="_blank"><img title="' +
                                                                  req.i18n.__('click_image_full_size') + '"  class="' + questions[j].type + '" src="' +
                                                                  results[i]['q' + questions[j].question_order + '.value'].trim() + '"></img></a></div></li>';
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 1 hr to fix
                                  routes/utils_api.js on lines 586..588

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 61.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                                              msg += "<li><label>" + questions[j].question + ':<br></label><span>' + results[i]['q' + questions[j].question_order + '.value'].trim() + '</span></li>';
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 1 hr to fix
                                  routes/utils_api.js on lines 593..594

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

                                  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

                                                              msg += "<li><label>" + questions[j].question + ':</label><div class="survey-answer-img"><a href="' +
                                                                  results[i]['q' + questions[j].question_order + '.value'].trim() + '" target="_blank"><img title="' +
                                  Severity: Major
                                  Found in routes/utils_api.js and 1 other location - About 1 hr to fix
                                  routes/utils_api.js on lines 587..587

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

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

                                              ws.cell(row, 1, row, 3, true).string(i18n.__('export_header_answer')).style(borderStyle).style(boldStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 6 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 308..308
                                  routes/utils_api.js on lines 411..411
                                  routes/utils_api.js on lines 429..429
                                  routes/utils_api.js on lines 435..435
                                  routes/utils_api.js on lines 458..458
                                  routes/utils_api.js on lines 491..491

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 47.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              ws.cell(row, 1, row, 3, true).string(i18n.__('export_header_total')).style(italicStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 6 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 297..297
                                  routes/utils_api.js on lines 411..411
                                  routes/utils_api.js on lines 429..429
                                  routes/utils_api.js on lines 435..435
                                  routes/utils_api.js on lines 458..458
                                  routes/utils_api.js on lines 491..491

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 47.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          ws.cell(row, 1, row, 7, true).string(i18n.__('export_header_provinces_with_answers')).style(headerStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 6 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 297..297
                                  routes/utils_api.js on lines 308..308
                                  routes/utils_api.js on lines 411..411
                                  routes/utils_api.js on lines 429..429
                                  routes/utils_api.js on lines 458..458
                                  routes/utils_api.js on lines 491..491

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 47.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          ws.cell(row, 1, row, 7, true).string(i18n.__('export_header_countries_with_answers')).style(headerStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 6 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 297..297
                                  routes/utils_api.js on lines 308..308
                                  routes/utils_api.js on lines 429..429
                                  routes/utils_api.js on lines 435..435
                                  routes/utils_api.js on lines 458..458
                                  routes/utils_api.js on lines 491..491

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 47.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              ws.cell(row, 1, row, 6, true).string(i18n.__('export_header_total')).style(italicStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 6 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 297..297
                                  routes/utils_api.js on lines 308..308
                                  routes/utils_api.js on lines 411..411
                                  routes/utils_api.js on lines 429..429
                                  routes/utils_api.js on lines 435..435
                                  routes/utils_api.js on lines 458..458

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 47.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              ws.cell(row, 5, row, 6, true).string(i18n.__('export_header_total')).style(italicStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 6 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 297..297
                                  routes/utils_api.js on lines 308..308
                                  routes/utils_api.js on lines 411..411
                                  routes/utils_api.js on lines 435..435
                                  routes/utils_api.js on lines 458..458
                                  routes/utils_api.js on lines 491..491

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 47.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              ws.cell(row, 3, row, 6, true).string(i18n.__('export_header_total')).style(italicStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 6 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 297..297
                                  routes/utils_api.js on lines 308..308
                                  routes/utils_api.js on lines 411..411
                                  routes/utils_api.js on lines 429..429
                                  routes/utils_api.js on lines 435..435
                                  routes/utils_api.js on lines 491..491

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 47.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              ws.cell(row++, 8).string(i18n.__('export_header_share_answers')).style(boldStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 3 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 299..299
                                  routes/utils_api.js on lines 419..419
                                  routes/utils_api.js on lines 476..476

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 46.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              ws.cell(row++, 5).string(i18n.__('export_header_share_answers')).style(borderStyle).style(boldStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 3 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 419..419
                                  routes/utils_api.js on lines 445..445
                                  routes/utils_api.js on lines 476..476

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 46.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              ws.cell(row++, 8).string(i18n.__('export_header_share_answers')).style(boldStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 3 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 299..299
                                  routes/utils_api.js on lines 445..445
                                  routes/utils_api.js on lines 476..476

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 46.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                              ws.cell(row++, 8).string(i18n.__('export_header_share_answers')).style(boldStyle).style(borderStyle);
                                  Severity: Major
                                  Found in routes/utils_api.js and 3 other locations - About 35 mins to fix
                                  routes/utils_api.js on lines 299..299
                                  routes/utils_api.js on lines 419..419
                                  routes/utils_api.js on lines 445..445

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 46.

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

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

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

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

                                  Refactorings

                                  Further Reading

                                  There are no issues that match your filters.

                                  Category
                                  Status