cbillowes/curious-programmer-helium

View on GitHub

Showing 25 of 25 total issues

Function render has 201 lines of code (exceeds 50 allowed). Consider refactoring.
Open

  render() {
    return (
      <ul className="timeline">
        <TimelineItem
          type="work"
Severity: Major
Found in src/components/About/Companies/DStv.jsx - About 7 hrs to fix

    Function render has 161 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

      render() {
        return (
          <Layout>
            <div className="credits-container container">
              <Metadata
    Severity: Major
    Found in src/pages/credits.jsx - About 5 hrs to fix

      Function render has 120 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

        render() {
          return (
            <div id="additional-information">
              <div>
                <h2>Additional information about Data collection and processing</h2>
      Severity: Major
      Found in src/components/PrivacyPolicy/AdditionalInformation.jsx - About 3 hrs to fix

        Function render has 118 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

          render() {
            const date = new Date()
        
            return (
              <Layout>
        Severity: Major
        Found in src/pages/license.jsx - About 3 hrs to fix

          Function render has 105 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

            render() {
              return (
                <div id="mode-and-place-of-processing-data">
                  <h2>Mode and place of processing the Data</h2>
                  <h3>Methods of processing</h3>
          Severity: Major
          Found in src/components/PrivacyPolicy/PlaceOfProcessing.jsx - About 3 hrs to fix

            Function render has 101 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

              render() {
                return (
                  <ul className="timeline">
                    <TimelineItem
                      type="work"
            Severity: Major
            Found in src/components/About/Companies/Education.jsx - About 3 hrs to fix

              Function render has 81 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

                render() {
                  return (
                    <ul className="timeline">
                      <TimelineItem
                        type="community"
              Severity: Major
              Found in src/components/About/Companies/CloudAfrica.jsx - About 2 hrs to fix

                Function render has 77 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                  render() {
                    const { active } = this.props
                
                    return (
                
                
                Severity: Major
                Found in src/components/About/TimelineLegend.jsx - About 2 hrs to fix

                  Function render has 74 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                    render() {
                      return (
                        <div id="rights-of-users">
                          <h2>The rights of Users</h2>
                          <p>
                  Severity: Major
                  Found in src/components/PrivacyPolicy/RightsOfUsers.jsx - About 1 hr to fix

                    Function render has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                      render() {
                        return (
                          <div id="detailed-information">
                            <h2>Detailed information on the processing of Personal Data</h2>
                            <p>
                    Severity: Major
                    Found in src/components/PrivacyPolicy/DetailedInformation.jsx - About 1 hr to fix

                      Function render has 59 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                        render() {
                          return (
                            <ul className="timeline it-em">
                              <TimelineItem
                                type="work"
                      Severity: Major
                      Found in src/components/About/Companies/ITEM.jsx - About 1 hr to fix

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

                            @classmethod
                            def from_crawler(cls, crawler):
                                # This method is used by Scrapy to create your spiders.
                                s = cls()
                                crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
                        Severity: Major
                        Found in __scrapy__/crawler/curiousprogrammer/middlewares.py and 1 other location - About 1 hr to fix
                        __scrapy__/crawler/curiousprogrammer/middlewares.py on lines 64..69

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

                        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

                            @classmethod
                            def from_crawler(cls, crawler):
                                # This method is used by Scrapy to create your spiders.
                                s = cls()
                                crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
                        Severity: Major
                        Found in __scrapy__/crawler/curiousprogrammer/middlewares.py and 1 other location - About 1 hr to fix
                        __scrapy__/crawler/curiousprogrammer/middlewares.py on lines 16..21

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

                        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

                        Function onCreateNode has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                        Open

                        exports.onCreateNode = ({ node, actions, getNode }) => {
                          const { createNodeField } = actions
                          let slug
                          if (node.internal.type === "MarkdownRemark") {
                            const fileNode = getNode(node.parent)
                        Severity: Minor
                        Found in gatsby-node.js - About 35 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        marked Regular Expression Denial of Service
                        Open

                            "marked": {
                              "version": "0.3.19",
                              "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz",
                              "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg=="
                            },
                        Severity: Minor
                        Found in package-lock.json by nodesecurity

                        Regular Expression Denial of Service

                        Overview:

                        The marked module is vulnerable to a regular expression denial of service. Based on the information published in the public issue, 1k characters can block for around 6 seconds.

                        Recommendation:

                        Consider another markdown parser until the issue can be addressed.

                        'next' is never reassigned. Use 'const' instead.
                        Open

                                  let next =
                        Severity: Minor
                        Found in gatsby-node.js by eslint

                        Suggest using const (prefer-const)

                        If a variable is never reassigned, using the const declaration is better.

                        const declaration tells readers, "this variable is never reassigned," reducing cognitive load and improving maintainability.

                        Rule Details

                        This rule is aimed at flagging variables that are declared using let keyword, but never reassigned after the initial assignment.

                        Examples of incorrect code for this rule:

                        /*eslint prefer-const: "error"*/
                        /*eslint-env es6*/
                        
                        // it's initialized and never reassigned.
                        let a = 3;
                        console.log(a);
                        
                        let a;
                        a = 0;
                        console.log(a);
                        
                        // `i` is redefined (not reassigned) on each loop step.
                        for (let i in [1, 2, 3]) {
                            console.log(i);
                        }
                        
                        // `a` is redefined (not reassigned) on each loop step.
                        for (let a of [1, 2, 3]) {
                            console.log(a);
                        }

                        Examples of correct code for this rule:

                        /*eslint prefer-const: "error"*/
                        /*eslint-env es6*/
                        
                        // using const.
                        const a = 0;
                        
                        // it's never initialized.
                        let a;
                        console.log(a);
                        
                        // it's reassigned after initialized.
                        let a;
                        a = 0;
                        a = 1;
                        console.log(a);
                        
                        // it's initialized in a different block from the declaration.
                        let a;
                        if (true) {
                            a = 0;
                        }
                        console.log(a);
                        
                        // it's initialized at a place that we cannot write a variable declaration.
                        let a;
                        if (true) a = 0;
                        console.log(a);
                        
                        // `i` gets a new binding each iteration
                        for (const i in [1, 2, 3]) {
                          console.log(i);
                        }
                        
                        // `a` gets a new binding each iteration
                        for (const a of [1, 2, 3]) {
                          console.log(a);
                        }
                        
                        // `end` is never reassigned, but we cannot separate the declarations without modifying the scope.
                        for (let i = 0, end = 10; i < end; ++i) {
                            console.log(a);
                        }
                        
                        // suggest to use `no-var` rule.
                        var b = 3;
                        console.log(b);

                        Options

                        {
                            "prefer-const": ["error", {
                                "destructuring": "any",
                                "ignoreReadBeforeAssign": false
                            }]
                        }

                        destructuring

                        The kind of the way to address variables in destructuring. There are 2 values:

                        • "any" (default) - If any variables in destructuring should be const, this rule warns for those variables.
                        • "all" - If all variables in destructuring should be const, this rule warns the variables. Otherwise, ignores them.

                        Examples of incorrect code for the default {"destructuring": "any"} option:

                        /*eslint prefer-const: "error"*/
                        /*eslint-env es6*/
                        
                        let {a, b} = obj;    /*error 'b' is never reassigned, use 'const' instead.*/
                        a = a + 1;

                        Examples of correct code for the default {"destructuring": "any"} option:

                        /*eslint prefer-const: "error"*/
                        /*eslint-env es6*/
                        
                        // using const.
                        const {a: a0, b} = obj;
                        const a = a0 + 1;
                        
                        // all variables are reassigned.
                        let {a, b} = obj;
                        a = a + 1;
                        b = b + 1;

                        Examples of incorrect code for the {"destructuring": "all"} option:

                        /*eslint prefer-const: ["error", {"destructuring": "all"}]*/
                        /*eslint-env es6*/
                        
                        // all of `a` and `b` should be const, so those are warned.
                        let {a, b} = obj;    /*error 'a' is never reassigned, use 'const' instead.
                                                     'b' is never reassigned, use 'const' instead.*/

                        Examples of correct code for the {"destructuring": "all"} option:

                        /*eslint prefer-const: ["error", {"destructuring": "all"}]*/
                        /*eslint-env es6*/
                        
                        // 'b' is never reassigned, but all of `a` and `b` should not be const, so those are ignored.
                        let {a, b} = obj;
                        a = a + 1;

                        ignoreReadBeforeAssign

                        This is an option to avoid conflicting with no-use-before-define rule (without "nofunc" option). If true is specified, this rule will ignore variables that are read between the declaration and the first assignment. Default is false.

                        Examples of correct code for the {"ignoreReadBeforeAssign": true} option:

                        /*eslint prefer-const: ["error", {"ignoreReadBeforeAssign": true}]*/
                        /*eslint-env es6*/
                        
                        let timer;
                        function initialize() {
                            if (foo()) {
                                clearInterval(timer);
                            }
                        }
                        timer = setInterval(initialize, 100);

                        Examples of correct code for the default {"ignoreReadBeforeAssign": false} option:

                        /*eslint prefer-const: ["error", {"ignoreReadBeforeAssign": false}]*/
                        /*eslint-env es6*/
                        
                        const timer = setInterval(initialize, 100);
                        function initialize() {
                            if (foo()) {
                                clearInterval(timer);
                            }
                        }

                        When Not To Use It

                        If you don't want to be notified about variables that are never reassigned after initial assignment, you can safely disable this rule.

                        Related Rules

                        Assignment to property of function parameter 'node'.
                        Open

                              node.frontmatter.tags = []
                        Severity: Minor
                        Found in gatsby-node.js by eslint

                        Disallow Reassignment of Function Parameters (no-param-reassign)

                        Assignment to variables declared as function parameters can be misleading and lead to confusing behavior, as modifying function parameters will also mutate the arguments object. Often, assignment to function parameters is unintended and indicative of a mistake or programmer error.

                        This rule can be also configured to fail when function parameters are modified. Side effects on parameters can cause counter-intuitive execution flow and make errors difficult to track down.

                        Rule Details

                        This rule aims to prevent unintended behavior caused by modification or reassignment of function parameters.

                        Examples of incorrect code for this rule:

                        /*eslint no-param-reassign: "error"*/
                        
                        function foo(bar) {
                            bar = 13;
                        }
                        
                        function foo(bar) {
                            bar++;
                        }

                        Examples of correct code for this rule:

                        /*eslint no-param-reassign: "error"*/
                        
                        function foo(bar) {
                            var baz = bar;
                        }

                        Options

                        This rule takes one option, an object, with a boolean property "props" and an array "ignorePropertyModificationsFor". "props" is false by default. If "props" is set to true, this rule warns against the modification of parameter properties unless they're included in "ignorePropertyModificationsFor", which is an empty array by default.

                        props

                        Examples of correct code for the default { "props": false } option:

                        /*eslint no-param-reassign: ["error", { "props": false }]*/
                        
                        function foo(bar) {
                            bar.prop = "value";
                        }
                        
                        function foo(bar) {
                            delete bar.aaa;
                        }
                        
                        function foo(bar) {
                            bar.aaa++;
                        }

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

                        /*eslint no-param-reassign: ["error", { "props": true }]*/
                        
                        function foo(bar) {
                            bar.prop = "value";
                        }
                        
                        function foo(bar) {
                            delete bar.aaa;
                        }
                        
                        function foo(bar) {
                            bar.aaa++;
                        }

                        Examples of correct code for the { "props": true } option with "ignorePropertyModificationsFor" set:

                        /*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["bar"] }]*/
                        
                        function foo(bar) {
                            bar.prop = "value";
                        }
                        
                        function foo(bar) {
                            delete bar.aaa;
                        }
                        
                        function foo(bar) {
                            bar.aaa++;
                        }

                        When Not To Use It

                        If you want to allow assignment to function parameters, then you can safely disable this rule.

                        Further Reading

                        'edges' is never reassigned. Use 'const' instead.
                        Open

                                let edges = result.data.allMarkdownRemark.edges
                        Severity: Minor
                        Found in gatsby-node.js by eslint

                        Suggest using const (prefer-const)

                        If a variable is never reassigned, using the const declaration is better.

                        const declaration tells readers, "this variable is never reassigned," reducing cognitive load and improving maintainability.

                        Rule Details

                        This rule is aimed at flagging variables that are declared using let keyword, but never reassigned after the initial assignment.

                        Examples of incorrect code for this rule:

                        /*eslint prefer-const: "error"*/
                        /*eslint-env es6*/
                        
                        // it's initialized and never reassigned.
                        let a = 3;
                        console.log(a);
                        
                        let a;
                        a = 0;
                        console.log(a);
                        
                        // `i` is redefined (not reassigned) on each loop step.
                        for (let i in [1, 2, 3]) {
                            console.log(i);
                        }
                        
                        // `a` is redefined (not reassigned) on each loop step.
                        for (let a of [1, 2, 3]) {
                            console.log(a);
                        }

                        Examples of correct code for this rule:

                        /*eslint prefer-const: "error"*/
                        /*eslint-env es6*/
                        
                        // using const.
                        const a = 0;
                        
                        // it's never initialized.
                        let a;
                        console.log(a);
                        
                        // it's reassigned after initialized.
                        let a;
                        a = 0;
                        a = 1;
                        console.log(a);
                        
                        // it's initialized in a different block from the declaration.
                        let a;
                        if (true) {
                            a = 0;
                        }
                        console.log(a);
                        
                        // it's initialized at a place that we cannot write a variable declaration.
                        let a;
                        if (true) a = 0;
                        console.log(a);
                        
                        // `i` gets a new binding each iteration
                        for (const i in [1, 2, 3]) {
                          console.log(i);
                        }
                        
                        // `a` gets a new binding each iteration
                        for (const a of [1, 2, 3]) {
                          console.log(a);
                        }
                        
                        // `end` is never reassigned, but we cannot separate the declarations without modifying the scope.
                        for (let i = 0, end = 10; i < end; ++i) {
                            console.log(a);
                        }
                        
                        // suggest to use `no-var` rule.
                        var b = 3;
                        console.log(b);

                        Options

                        {
                            "prefer-const": ["error", {
                                "destructuring": "any",
                                "ignoreReadBeforeAssign": false
                            }]
                        }

                        destructuring

                        The kind of the way to address variables in destructuring. There are 2 values:

                        • "any" (default) - If any variables in destructuring should be const, this rule warns for those variables.
                        • "all" - If all variables in destructuring should be const, this rule warns the variables. Otherwise, ignores them.

                        Examples of incorrect code for the default {"destructuring": "any"} option:

                        /*eslint prefer-const: "error"*/
                        /*eslint-env es6*/
                        
                        let {a, b} = obj;    /*error 'b' is never reassigned, use 'const' instead.*/
                        a = a + 1;

                        Examples of correct code for the default {"destructuring": "any"} option:

                        /*eslint prefer-const: "error"*/
                        /*eslint-env es6*/
                        
                        // using const.
                        const {a: a0, b} = obj;
                        const a = a0 + 1;
                        
                        // all variables are reassigned.
                        let {a, b} = obj;
                        a = a + 1;
                        b = b + 1;

                        Examples of incorrect code for the {"destructuring": "all"} option:

                        /*eslint prefer-const: ["error", {"destructuring": "all"}]*/
                        /*eslint-env es6*/
                        
                        // all of `a` and `b` should be const, so those are warned.
                        let {a, b} = obj;    /*error 'a' is never reassigned, use 'const' instead.
                                                     'b' is never reassigned, use 'const' instead.*/

                        Examples of correct code for the {"destructuring": "all"} option:

                        /*eslint prefer-const: ["error", {"destructuring": "all"}]*/
                        /*eslint-env es6*/
                        
                        // 'b' is never reassigned, but all of `a` and `b` should not be const, so those are ignored.
                        let {a, b} = obj;
                        a = a + 1;

                        ignoreReadBeforeAssign

                        This is an option to avoid conflicting with no-use-before-define rule (without "nofunc" option). If true is specified, this rule will ignore variables that are read between the declaration and the first assignment. Default is false.

                        Examples of correct code for the {"ignoreReadBeforeAssign": true} option:

                        /*eslint prefer-const: ["error", {"ignoreReadBeforeAssign": true}]*/
                        /*eslint-env es6*/
                        
                        let timer;
                        function initialize() {
                            if (foo()) {
                                clearInterval(timer);
                            }
                        }
                        timer = setInterval(initialize, 100);

                        Examples of correct code for the default {"ignoreReadBeforeAssign": false} option:

                        /*eslint prefer-const: ["error", {"ignoreReadBeforeAssign": false}]*/
                        /*eslint-env es6*/
                        
                        const timer = setInterval(initialize, 100);
                        function initialize() {
                            if (foo()) {
                                clearInterval(timer);
                            }
                        }

                        When Not To Use It

                        If you don't want to be notified about variables that are never reassigned after initial assignment, you can safely disable this rule.

                        Related Rules

                        Use object destructuring.
                        Open

                              let tags = node.frontmatter.tags
                        Severity: Minor
                        Found in gatsby-node.js by eslint

                        Prefer destructuring from arrays and objects (prefer-destructuring)

                        With JavaScript ES6, a new syntax was added for creating variables from an array index or object property, called destructuring. This rule enforces usage of destructuring instead of accessing a property through a member expression.

                        Rule Details

                        Options

                        This rule takes two sets of configuration objects. The first object parameter determines what types of destructuring the rule applies to.

                        The two properties, array and object, can be used to turn on or off the destructuring requirement for each of those types independently. By default, both are true.

                        Alternatively, you can use separate configurations for different assignment types. It accepts 2 other keys instead of array and object.

                        One key is VariableDeclarator and the other is AssignmentExpression, which can be used to control the destructuring requirement for each of those types independently. Each property accepts an object that accepts two properties, array and object, which can be used to control the destructuring requirement for each of array and object independently for variable declarations and assignment expressions. By default, array and object are set to true for both VariableDeclarator and AssignmentExpression.

                        The rule has a second object with a single key, enforceForRenamedProperties, which determines whether the object destructuring applies to renamed variables.

                        Examples of incorrect code for this rule:

                        // With `array` enabled
                        var foo = array[0];
                        
                        // With `object` enabled
                        var foo = object.foo;
                        var foo = object['foo'];

                        Examples of correct code for this rule:

                        // With `array` enabled
                        var [ foo ] = array;
                        var foo = array[someIndex];
                        
                        // With `object` enabled
                        var { foo } = object;
                        
                        var foo = object.bar;
                        
                        let foo;
                        ({ foo } = object);

                        Examples of incorrect code when enforceForRenamedProperties is enabled:

                        var foo = object.bar;

                        Examples of correct code when enforceForRenamedProperties is enabled:

                        var { bar: foo } = object;

                        An example configuration, with the defaults array and object filled in, looks like this:

                        {
                          "rules": {
                            "prefer-destructuring": ["error", {
                              "array": true,
                              "object": true
                            }, {
                              "enforceForRenamedProperties": false
                            }]
                          }
                        }

                        The two properties, array and object, which can be used to turn on or off the destructuring requirement for each of those types independently. By default, both are true.

                        For example, the following configuration enforces only object destructuring, but not array destructuring:

                        {
                          "rules": {
                            "prefer-destructuring": ["error", {"object": true, "array": false}]
                          }
                        }

                        An example configuration, with the defaults VariableDeclarator and AssignmentExpression filled in, looks like this:

                        {
                          "rules": {
                            "prefer-destructuring": ["error", {
                              "VariableDeclarator": {
                                "array": false,
                                "object": true
                              },
                              "AssignmentExpression": {
                                "array": true,
                                "object": true
                              }
                            }, {
                              "enforceForRenamedProperties": false
                            }]
                          }
                        }

                        The two properties, VariableDeclarator and AssignmentExpression, which can be used to turn on or off the destructuring requirement for array and object. By default, all values are true.

                        For example, the following configuration enforces object destructuring in variable declarations and enforces array destructuring in assignment expressions.

                        {
                          "rules": {
                            "prefer-destructuring": ["error", {
                              "VariableDeclarator": {
                                "array": false,
                                "object": true
                              },
                              "AssignmentExpression": {
                                "array": true,
                                "object": false
                              }
                            }, {
                              "enforceForRenamedProperties": false
                            }]
                          }
                        }

                        Examples of correct code when object destructuring in VariableDeclarator is enforced:

                        /* eslint prefer-destructuring: ["error", {VariableDeclarator: {object: true}}] */
                        var {bar: foo} = object;

                        Examples of correct code when array destructuring in AssignmentExpression is enforced:

                        /* eslint prefer-destructuring: ["error", {AssignmentExpression: {array: true}}] */
                        [bar] = array;

                        When Not To Use It

                        If you want to be able to access array indices or object properties directly, you can either configure the rule to your tastes or disable the rule entirely.

                        Additionally, if you intend to access large array indices directly, like:

                        var foo = array[100];

                        Then the array part of this rule is not recommended, as destructuring does not match this use case very well.

                        Or for non-iterable 'array-like' objects:

                        var $ = require('jquery');
                        var foo = $('body')[0];
                        var [bar] = $('body'); // fails with a TypeError

                        Further Reading

                        If you want to learn more about destructuring, check out the links below:

                        Assignment to property of function parameter 'node'.
                        Open

                            node.frontmatter.title = _.startCase(node.frontmatter.title)
                        Severity: Minor
                        Found in gatsby-node.js by eslint

                        Disallow Reassignment of Function Parameters (no-param-reassign)

                        Assignment to variables declared as function parameters can be misleading and lead to confusing behavior, as modifying function parameters will also mutate the arguments object. Often, assignment to function parameters is unintended and indicative of a mistake or programmer error.

                        This rule can be also configured to fail when function parameters are modified. Side effects on parameters can cause counter-intuitive execution flow and make errors difficult to track down.

                        Rule Details

                        This rule aims to prevent unintended behavior caused by modification or reassignment of function parameters.

                        Examples of incorrect code for this rule:

                        /*eslint no-param-reassign: "error"*/
                        
                        function foo(bar) {
                            bar = 13;
                        }
                        
                        function foo(bar) {
                            bar++;
                        }

                        Examples of correct code for this rule:

                        /*eslint no-param-reassign: "error"*/
                        
                        function foo(bar) {
                            var baz = bar;
                        }

                        Options

                        This rule takes one option, an object, with a boolean property "props" and an array "ignorePropertyModificationsFor". "props" is false by default. If "props" is set to true, this rule warns against the modification of parameter properties unless they're included in "ignorePropertyModificationsFor", which is an empty array by default.

                        props

                        Examples of correct code for the default { "props": false } option:

                        /*eslint no-param-reassign: ["error", { "props": false }]*/
                        
                        function foo(bar) {
                            bar.prop = "value";
                        }
                        
                        function foo(bar) {
                            delete bar.aaa;
                        }
                        
                        function foo(bar) {
                            bar.aaa++;
                        }

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

                        /*eslint no-param-reassign: ["error", { "props": true }]*/
                        
                        function foo(bar) {
                            bar.prop = "value";
                        }
                        
                        function foo(bar) {
                            delete bar.aaa;
                        }
                        
                        function foo(bar) {
                            bar.aaa++;
                        }

                        Examples of correct code for the { "props": true } option with "ignorePropertyModificationsFor" set:

                        /*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["bar"] }]*/
                        
                        function foo(bar) {
                            bar.prop = "value";
                        }
                        
                        function foo(bar) {
                            delete bar.aaa;
                        }
                        
                        function foo(bar) {
                            bar.aaa++;
                        }

                        When Not To Use It

                        If you want to allow assignment to function parameters, then you can safely disable this rule.

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language