fossasia/CommonsNet

View on GitHub
js/Controllers/WizardCtrl.js

Summary

Maintainability
F
3 days
Test Coverage

Function has too many statements (94). Maximum allowed is 30.
Open

    file.success(function (data) {
Severity: Minor
Found in js/Controllers/WizardCtrl.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 save has 174 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  vm.save = function () {


    var table = [];
    file.success(function (data) {
Severity: Major
Found in js/Controllers/WizardCtrl.js - About 6 hrs to fix

    Function has a complexity of 42.
    Open

        file.success(function (data) {
    Severity: Minor
    Found in js/Controllers/WizardCtrl.js by eslint

    Limit Cyclomatic Complexity (complexity)

    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

    function a(x) {
        if (true) {
            return x; // 1st path
        } else if (false) {
            return x+1; // 2nd path
        } else {
            return 4; // 3rd path
        }
    }

    Rule Details

    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

    Examples of incorrect code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else if (false) {
            return x+1;
        } else {
            return 4; // 3rd path
        }
    }

    Examples of correct code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else {
            return 4;
        }
    }

    Options

    Optionally, you may specify a max object property:

    "complexity": ["error", 2]

    is equivalent to

    "complexity": ["error", { "max": 2 }]

    Deprecated: the object property maximum is deprecated. Please use the property max instead.

    When Not To Use It

    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

    Further Reading

    Related Rules

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

    Consider simplifying this complex logical expression.
    Open

          if (vm.specialdevices === "yes" || vm.specialsettings === "yes" || vm.socialprofile === "yes" || vm.acceptterms === "yes" || vm.socialprofile === "yes" || vm.downloading === "yes" || vm.register === "yes" || vm.newsletter === "yes" || vm.mobilenumber === "yes" || vm.emailaddress === "yes" || vm.personaldetails === "yes" || vm.autoupdatedisabled === "yes" || vm.referencenumber === "yes") {
            result = result.replace("CONDITIONS", "Conditions to use Wifi:")
          }
          else {
            result = result.replace("CONDITIONS", 'There are not any conditions to use  Wifi ')
    Severity: Critical
    Found in js/Controllers/WizardCtrl.js - About 3 hrs to fix

      File WizardCtrl.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      app.controller('WizardController', ['$scope', 'wizard', 'file', function ($scope, wizard, file) {
        var vm = this;
        // vm.legalformatted = ''
        var table = [];
        wizard.success(function (data) {
      Severity: Minor
      Found in js/Controllers/WizardCtrl.js - About 2 hrs to fix

        Unexpected string concatenation of literals.
        Open

                result = result.replace("SECURITY_TYPE", "The network is secured under" + " " + vm.securitytypes);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("SPECIAL_DEVICES", 'use special devices like' + ' ' + vm.specialdevicesfield);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

              result = result.replace("NETWORK_NAME", "The network name is:" + " " + vm.ssid)
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Expected '===' and instead saw '=='.
        Open

              if (vm.currentStep == vm.steps[i].step) {
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Require === and !== (eqeqeq)

        It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

        The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

        • [] == false
        • [] == ![]
        • 3 == "03"

        If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

        Rule Details

        This rule is aimed at eliminating the type-unsafe equality operators.

        Examples of incorrect code for this rule:

        /*eslint eqeqeq: "error"*/
        
        if (x == 42) { }
        
        if ("" == text) { }
        
        if (obj.getStuff() != undefined) { }

        The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

        Options

        always

        The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

        Examples of incorrect code for the "always" option:

        /*eslint eqeqeq: ["error", "always"]*/
        
        a == b
        foo == true
        bananas != 1
        value == undefined
        typeof foo == 'undefined'
        'hello' != 'world'
        0 == 0
        true == true
        foo == null

        Examples of correct code for the "always" option:

        /*eslint eqeqeq: ["error", "always"]*/
        
        a === b
        foo === true
        bananas !== 1
        value === undefined
        typeof foo === 'undefined'
        'hello' !== 'world'
        0 === 0
        true === true
        foo === null

        This rule optionally takes a second argument, which should be an object with the following supported properties:

        • "null": Customize how this rule treats null literals. Possible values:
          • always (default) - Always use === or !==.
          • never - Never use === or !== with null.
          • ignore - Do not apply this rule to null.

        smart

        The "smart" option enforces the use of === and !== except for these cases:

        • Comparing two literal values
        • Evaluating the value of typeof
        • Comparing against null

        Examples of incorrect code for the "smart" option:

        /*eslint eqeqeq: ["error", "smart"]*/
        
        // comparing two variables requires ===
        a == b
        
        // only one side is a literal
        foo == true
        bananas != 1
        
        // comparing to undefined requires ===
        value == undefined

        Examples of correct code for the "smart" option:

        /*eslint eqeqeq: ["error", "smart"]*/
        
        typeof foo == 'undefined'
        'hello' != 'world'
        0 == 0
        true == true
        foo == null

        allow-null

        Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

        ["error", "always", {"null": "ignore"}]

        When Not To Use It

        If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("PAID", "The Wifi is paid" + " " + vm.paidfield);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("NUMBER_OF_DEVICES", "Only" + ' ' + vm.limitdevicesfield + ' ' + 'devices are allowed');
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("SPEED", "The speed is:" + " " + vm.datarate);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("STANDARD_WIFI", "The network uses" + " " + vm.wifistandards + " " + "standard")
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("SPECIAL_SETTINGS", 'run special settings like' + ' ' + vm.specialsettingsfield);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected trailing comma.
        Open

            },
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        require or disallow trailing commas (comma-dangle)

        Trailing commas in object literals are valid according to the ECMAScript 5 (and ECMAScript 3!) spec. However, IE8 (when not in IE8 document mode) and below will throw an error when it encounters trailing commas in JavaScript.

        var foo = {
            bar: "baz",
            qux: "quux",
        };

        Trailing commas simplify adding and removing items to objects and arrays, since only the lines you are modifying must be touched. Another argument in favor of trailing commas is that it improves the clarity of diffs when an item is added or removed from an object or array:

        Less clear:

        var foo = {
        -    bar: "baz",
        -    qux: "quux"
        +    bar: "baz"
         };

        More clear:

        var foo = {
             bar: "baz",
        -    qux: "quux",
         };

        Rule Details

        This rule enforces consistent use of trailing commas in object and array literals.

        Options

        This rule has a string option or an object option:

        {
            "comma-dangle": ["error", "never"],
            // or
            "comma-dangle": ["error", {
                "arrays": "never",
                "objects": "never",
                "imports": "never",
                "exports": "never",
                "functions": "ignore",
            }]
        }
        • "never" (default) disallows trailing commas
        • "always" requires trailing commas
        • "always-multiline" requires trailing commas when the last element or property is in a different line than the closing ] or } and disallows trailing commas when the last element or property is on the same line as the closing ] or }
        • "only-multiline" allows (but does not require) trailing commas when the last element or property is in a different line than the closing ] or } and disallows trailing commas when the last element or property is on the same line as the closing ] or }

        Trailing commas in function declarations and function calls are valid syntax since ECMAScript 2017; however, the string option does not check these situations for backwards compatibility.

        You can also use an object option to configure this rule for each type of syntax. Each of the following options can be set to "never", "always", "always-multiline", "only-multiline", or "ignore". The default for each option is "never" unless otherwise specified.

        • arrays is for array literals and array patterns of destructuring. (e.g. let [a,] = [1,];)
        • objects is for object literals and object patterns of destructuring. (e.g. let {a,} = {a: 1};)
        • imports is for import declarations of ES Modules. (e.g. import {a,} from "foo";)
        • exports is for export declarations of ES Modules. (e.g. export {a,};)
        • functions is for function declarations and function calls. (e.g. (function(a,){ })(b,);)
          functions is set to "ignore" by default for consistency with the string option.

        never

        Examples of incorrect code for this rule with the default "never" option:

        /*eslint comma-dangle: ["error", "never"]*/
        
        var foo = {
            bar: "baz",
            qux: "quux",
        };
        
        var arr = [1,2,];
        
        foo({
          bar: "baz",
          qux: "quux",
        });

        Examples of correct code for this rule with the default "never" option:

        /*eslint comma-dangle: ["error", "never"]*/
        
        var foo = {
            bar: "baz",
            qux: "quux"
        };
        
        var arr = [1,2];
        
        foo({
          bar: "baz",
          qux: "quux"
        });

        always

        Examples of incorrect code for this rule with the "always" option:

        /*eslint comma-dangle: ["error", "always"]*/
        
        var foo = {
            bar: "baz",
            qux: "quux"
        };
        
        var arr = [1,2];
        
        foo({
          bar: "baz",
          qux: "quux"
        });

        Examples of correct code for this rule with the "always" option:

        /*eslint comma-dangle: ["error", "always"]*/
        
        var foo = {
            bar: "baz",
            qux: "quux",
        };
        
        var arr = [1,2,];
        
        foo({
          bar: "baz",
          qux: "quux",
        });

        always-multiline

        Examples of incorrect code for this rule with the "always-multiline" option:

        /*eslint comma-dangle: ["error", "always-multiline"]*/
        
        var foo = {
            bar: "baz",
            qux: "quux"
        };
        
        var foo = { bar: "baz", qux: "quux", };
        
        var arr = [1,2,];
        
        var arr = [1,
            2,];
        
        var arr = [
            1,
            2
        ];
        
        foo({
          bar: "baz",
          qux: "quux"
        });

        Examples of correct code for this rule with the "always-multiline" option:

        /*eslint comma-dangle: ["error", "always-multiline"]*/
        
        var foo = {
            bar: "baz",
            qux: "quux",
        };
        
        var foo = {bar: "baz", qux: "quux"};
        var arr = [1,2];
        
        var arr = [1,
            2];
        
        var arr = [
            1,
            2,
        ];
        
        foo({
          bar: "baz",
          qux: "quux",
        });

        only-multiline

        Examples of incorrect code for this rule with the "only-multiline" option:

        /*eslint comma-dangle: ["error", "only-multiline"]*/
        
        var foo = { bar: "baz", qux: "quux", };
        
        var arr = [1,2,];
        
        var arr = [1,
            2,];

        Examples of correct code for this rule with the "only-multiline" option:

        /*eslint comma-dangle: ["error", "only-multiline"]*/
        
        var foo = {
            bar: "baz",
            qux: "quux",
        };
        
        var foo = {
            bar: "baz",
            qux: "quux"
        };
        
        var foo = {bar: "baz", qux: "quux"};
        var arr = [1,2];
        
        var arr = [1,
            2];
        
        var arr = [
            1,
            2,
        ];
        
        var arr = [
            1,
            2
        ];
        
        foo({
          bar: "baz",
          qux: "quux",
        });
        
        foo({
          bar: "baz",
          qux: "quux"
        });

        functions

        Examples of incorrect code for this rule with the {"functions": "never"} option:

        /*eslint comma-dangle: ["error", {"functions": "never"}]*/
        
        function foo(a, b,) {
        }
        
        foo(a, b,);
        new foo(a, b,);

        Examples of correct code for this rule with the {"functions": "never"} option:

        /*eslint comma-dangle: ["error", {"functions": "never"}]*/
        
        function foo(a, b) {
        }
        
        foo(a, b);
        new foo(a, b);

        Examples of incorrect code for this rule with the {"functions": "always"} option:

        /*eslint comma-dangle: ["error", {"functions": "always"}]*/
        
        function foo(a, b) {
        }
        
        foo(a, b);
        new foo(a, b);

        Examples of correct code for this rule with the {"functions": "always"} option:

        /*eslint comma-dangle: ["error", {"functions": "always"}]*/
        
        function foo(a, b,) {
        }
        
        foo(a, b,);
        new foo(a, b,);

        When Not To Use It

        You can turn this rule off if you are not concerned with dangling commas. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("LOGIN_NAME", "The login is:" + " " + vm.loginname);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("STANDARD_WIFI", "The network uses" + " " + vm.wifistandards + " " + "standard")
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("SERVICE_FIELD", "If you have any questions or troubles related to Wifi please contact" + " " + vm.servicefield);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("PASSWORD", "The password is:" + " " + vm.password);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("ISP", "The Internet Service Provider is:" + " " + vm.isp);
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

        Unexpected string concatenation of literals.
        Open

                result = result.replace("NUMBER_OF_DEVICES", "Only" + ' ' + vm.limitdevicesfield + ' ' + 'devices are allowed');
        Severity: Minor
        Found in js/Controllers/WizardCtrl.js by eslint

        Disallow unnecessary concatenation of strings (no-useless-concat)

        It's unnecessary to concatenate two strings together, such as:

        var foo = "a" + "b";

        This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:

        var foo = "ab";

        Rule Details

        This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.

        Examples of incorrect code for this rule:

        /*eslint no-useless-concat: "error"*/
        /*eslint-env es6*/
        
        // these are the same as "10"
        var a = `some` + `string`;
        var a = '1' + '0';
        var a = '1' + `0`;
        var a = `1` + '0';
        var a = `1` + `0`;

        Examples of correct code for this rule:

        /*eslint no-useless-concat: "error"*/
        
        // when a non string is included
        var c = a + b;
        var c = '1' + a;
        var a = 1 + '1';
        var c = 1 - 2;
        // when the string concatenation is multiline
        var c = "foo" +
            "bar";

        When Not To Use It

        If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule. Source: http://eslint.org/docs/rules/

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

              if ((vm.loginname !== "") && (typeof vm.loginname !== "undefined")) {
                result = result.replace("LOGIN_NAME", "The login is:" + " " + vm.loginname);
              }
              else {
                result = result.replace(' <text:p text:style-name="P209">LOGIN_NAME</text:p>', " ")
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 2 other locations - About 2 hrs to fix
        js/Controllers/WizardCtrl.js on lines 156..161
        js/Controllers/WizardCtrl.js on lines 171..176

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

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

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

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

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

        Refactorings

        Further Reading

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

              if ((vm.password !== "") && (typeof vm.password !== "undefined")) {
                result = result.replace("PASSWORD", "The password is:" + " " + vm.password);
              }
              else {
                result = result.replace('<text:p text:style-name="P209">PASSWORD</text:p>', " ")
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 2 other locations - About 2 hrs to fix
        js/Controllers/WizardCtrl.js on lines 163..168
        js/Controllers/WizardCtrl.js on lines 171..176

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

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

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

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

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

        Refactorings

        Further Reading

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

              if ((vm.datarate !== "") && (typeof vm.datarate !== "undefined")) {
                result = result.replace("SPEED", "The speed is:" + " " + vm.datarate);
              }
              else {
                result = result.replace(' <text:p text:style-name="P209">SPEED</text:p>', ' ')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 2 other locations - About 2 hrs to fix
        js/Controllers/WizardCtrl.js on lines 156..161
        js/Controllers/WizardCtrl.js on lines 163..168

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

        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 (vm.specialsettings === 'yes') {
                result = result.replace("SPECIAL_SETTINGS", 'run special settings like' + ' ' + vm.specialsettingsfield);
              }
              else {
                result = result.replace('<text:p text:style-name="P212">SPECIAL SETTINGS</text:p>', ' ');
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 1 other location - About 1 hr to fix
        js/Controllers/WizardCtrl.js on lines 243..248

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

        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 (vm.specialdevices === 'yes') {
                result = result.replace("SPECIAL_DEVICES", 'use special devices like' + ' ' + vm.specialdevicesfield);
              }
              else {
                result = result.replace('<text:p text:style-name="P212">SPECIAL_DEVICES</text:p>', ' ');
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 1 other location - About 1 hr to fix
        js/Controllers/WizardCtrl.js on lines 250..255

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

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

              if (vm.acceptterms === 'yes') {
                result = result.replace("ACCEPT_TERMS", 'accept terms of use');
              }
              else {
                result = result.replace('<text:p text:style-name="P212">ACCEPT_TERMS</text:p>', ' ');
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.dualbandyes === "yes") {
                result = result.replace("BANDWIDTH_CONTROL", "The Network uses a bandwidth control");
              }
              else {
                result = result.replace('<text:p text:style-name="P87">BANDWIDTH_CONTROL</text:p>', '')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322

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

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

              if (vm.personaldetails === 'yes') {
                result = result.replace("PERSONAL_DETAILS", 'provide personal details like age, gender etc.')
              }
              else {
                result = result.replace('<text:p text:style-name="P212">PERSONAL_DETAILS</text:p>', ' ')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.downloading === 'yes') {
                result = result.replace("DOWNLOAD", 'download terms of use pdf file');
              }
              else {
                result = result.replace('<text:p text:style-name="P212">DOWNLOAD</text:p>', ' ');
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.newsletter === 'yes') {
                result = result.replace("NEWSLETTER", 'sign up to a newsletter')
              }
              else {
                result = result.replace('<text:p text:style-name="P212">NEWSLETTER</text:p>', ' ')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.emailaddress === 'yes') {
                result = result.replace("EMAIL_ADDRESS", 'give an email address')
              }
              else {
                result = result.replace('<text:p text:style-name="P212">EMAIL_ADDRESS</text:p>', ' ')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.autoupdatedisabled === 'yes') {
                result = result.replace("DISABLE_FUNCTION", 'disable auto-update function')
              }
              else {
                result = result.replace('<text:p text:style-name="P212">DISABLE_FUNCTION</text:p>', ' ')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.mobilenumber === 'yes') {
                result = result.replace("MOBILE_NUMER", 'give a mobile number')
              }
              else {
                result = result.replace('<text:p text:style-name="P212">MOBILE_NUMER</text:p>', ' ')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.register === 'yes') {
                result = result.replace("REGISTER", 'register to website to use Wifi')
              }
              else {
                result = result.replace('<text:p text:style-name="P212">REGISTER</text:p>', ' ')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.socialprofile === 'yes') {
                result = result.replace("LIKE", 'like social profile');
              }
              else {
                result = result.replace('<text:p text:style-name="P212">LIKE</text:p>', ' ');
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 317..322
        js/Controllers/WizardCtrl.js on lines 341..346

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

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

              if (vm.referencenumber === 'yes') {
                result = result.replace("REFERENCE_NUMBER", 'have a reference number')
              }
              else {
                result = result.replace('<text:p text:style-name="P212">REFERENCE_NUMBER</text:p>', ' ')
        Severity: Major
        Found in js/Controllers/WizardCtrl.js and 10 other locations - About 50 mins to fix
        js/Controllers/WizardCtrl.js on lines 257..263
        js/Controllers/WizardCtrl.js on lines 266..273
        js/Controllers/WizardCtrl.js on lines 274..279
        js/Controllers/WizardCtrl.js on lines 280..285
        js/Controllers/WizardCtrl.js on lines 286..291
        js/Controllers/WizardCtrl.js on lines 292..297
        js/Controllers/WizardCtrl.js on lines 299..304
        js/Controllers/WizardCtrl.js on lines 305..310
        js/Controllers/WizardCtrl.js on lines 311..316
        js/Controllers/WizardCtrl.js on lines 341..346

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

        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