TargetProcess/tauCharts

View on GitHub
src/algebra.ts

Summary

Maintainability
C
1 day
Test Coverage

Function cross_period has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    cross_period(
        dataFn: () => any[],
        dimX: string,
        dimY: string,
        xPeriod: string,
Severity: Minor
Found in src/algebra.ts - About 1 hr to fix

    Function cross_period has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            dataFn: () => any[],
            dimX: string,
            dimY: string,
            xPeriod: string,
            yPeriod: string,
    Severity: Minor
    Found in src/algebra.ts - About 45 mins to fix

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

              return domY.reduce(
                  (memo, rowVal) => {
      
                      return memo.concat(domX.map((colVal) => {
      
      
      Severity: Major
      Found in src/algebra.ts and 1 other location - About 3 hrs to fix
      src/algebra.ts on lines 67..85

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

      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

              return domY.reduce(
                  (memo, rowVal) => {
      
                      return memo.concat(domX.map((colVal) => {
      
      
      Severity: Major
      Found in src/algebra.ts and 1 other location - About 3 hrs to fix
      src/algebra.ts on lines 21..39

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

      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 (xPeriod) {
                  domX = UnitDomainPeriodGenerator.generate(Math.min(...domainX), Math.max(...domainX), xPeriod, {utc});
              }
      Severity: Minor
      Found in src/algebra.ts and 1 other location - About 50 mins to fix
      src/algebra.ts on lines 63..65

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

              if (yPeriod) {
                  domY = UnitDomainPeriodGenerator.generate(Math.min(...domainY), Math.max(...domainY), yPeriod, {utc});
              }
      Severity: Minor
      Found in src/algebra.ts and 1 other location - About 50 mins to fix
      src/algebra.ts on lines 59..61

      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

      Identifier 'data' is never reassigned; use 'const' instead of 'var'.
      Open

              var data = dataFn();
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      missing whitespace
      Open

              return domainX.map((x)=>({[dim]: unify(x)}));
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: whitespace

      Enforces whitespace style conventions.

      Rationale

      Helps maintain a readable, consistent style in your codebase.

      Notes
      • Has Fix

      Config

      Several arguments may be optionally provided:

      • "check-branch" checks branching statements (if/else/for/while) are followed by whitespace.
      • "check-decl"checks that variable declarations have whitespace around the equals token.
      • "check-operator" checks for whitespace around operator tokens.
      • "check-module" checks for whitespace in import & export statements.
      • "check-separator" checks for whitespace after separator tokens (,/;).
      • "check-rest-spread" checks that there is no whitespace after rest/spread operator (...).
      • "check-type" checks for whitespace before a variable type specification.
      • "check-typecast" checks for whitespace between a typecast and its target.
      • "check-type-operator" checks for whitespace between type operators | and &.
      • "check-preblock" checks for whitespace before the opening brace of a block.
      • "check-postbrace" checks for whitespace after an opening brace.
      Examples
      "whitespace": true,check-branch,check-operator,check-typecast
      Schema
      {
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "check-branch",
            "check-decl",
            "check-operator",
            "check-module",
            "check-separator",
            "check-rest-spread",
            "check-type",
            "check-typecast",
            "check-type-operator",
            "check-preblock",
            "check-postbrace"
          ]
        },
        "minLength": 0,
        "maxLength": 11
      }

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var data = dataFn();
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domX = domainX.length === 0 ? [null] : domainX;
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

                          var r = {};
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Identifier 'domX' is never reassigned; use 'const' instead of 'var'.
      Open

              var domX = domainX.length === 0 ? [null] : domainX;
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Identifier 'domainX' is never reassigned; use 'const' instead of 'var'.
      Open

              var domainX = utils.unique(data.map(x => x[dimX]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domainX = utils.unique(data.map(x => x[dimX]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domainY = utils.unique(data.map(x => x[dimY]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Identifier 'domainX' is never reassigned; use 'const' instead of 'var'.
      Open

              var domainX = utils.unique(data.map(x => x[dim]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

      var FramesAlgebra: {[algebra: string]: FrameAlgebraFunction} = {
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Identifier 'domY' is never reassigned; use 'const' instead of 'var'.
      Open

              var domY = domainY.length === 0 ? [null] : domainY;
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Identifier 'FramesAlgebra' is never reassigned; use 'const' instead of 'var'.
      Open

      var FramesAlgebra: {[algebra: string]: FrameAlgebraFunction} = {
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domY = domainY.length === 0 ? [null] : domainY;
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Identifier 'r' is never reassigned; use 'const' instead of 'var'.
      Open

                          var r = {};
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Identifier 'data' is never reassigned; use 'const' instead of 'var'.
      Open

              var data = dataFn();
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Identifier 'domainY' is never reassigned; use 'const' instead of 'var'.
      Open

              var domainY = utils.unique(data.map(x => x[dimY]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domainX = utils.unique(data.map(x => x[dimX]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

      var unify = ((v) => utils.isDate(v) ? v.getTime() : v);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

                          var r = {};
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var data = dataFn();
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Identifier 'unify' is never reassigned; use 'const' instead of 'var'.
      Open

      var unify = ((v) => utils.isDate(v) ? v.getTime() : v);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      missing whitespace
      Open

              return domainX.map((x)=>({[dim]: unify(x)}));
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: whitespace

      Enforces whitespace style conventions.

      Rationale

      Helps maintain a readable, consistent style in your codebase.

      Notes
      • Has Fix

      Config

      Several arguments may be optionally provided:

      • "check-branch" checks branching statements (if/else/for/while) are followed by whitespace.
      • "check-decl"checks that variable declarations have whitespace around the equals token.
      • "check-operator" checks for whitespace around operator tokens.
      • "check-module" checks for whitespace in import & export statements.
      • "check-separator" checks for whitespace after separator tokens (,/;).
      • "check-rest-spread" checks that there is no whitespace after rest/spread operator (...).
      • "check-type" checks for whitespace before a variable type specification.
      • "check-typecast" checks for whitespace between a typecast and its target.
      • "check-type-operator" checks for whitespace between type operators | and &.
      • "check-preblock" checks for whitespace before the opening brace of a block.
      • "check-postbrace" checks for whitespace after an opening brace.
      Examples
      "whitespace": true,check-branch,check-operator,check-typecast
      Schema
      {
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "check-branch",
            "check-decl",
            "check-operator",
            "check-module",
            "check-separator",
            "check-rest-spread",
            "check-type",
            "check-typecast",
            "check-type-operator",
            "check-preblock",
            "check-postbrace"
          ]
        },
        "minLength": 0,
        "maxLength": 11
      }

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domainX = utils.unique(data.map(x => x[dim]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Identifier 'domainX' is never reassigned; use 'const' instead of 'var'.
      Open

              var domainX = utils.unique(data.map(x => x[dimX]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domX = domainX.length === 0 ? [null] : domainX;
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var data = dataFn();
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domainY = utils.unique(data.map(x => x[dimY]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var utc = (guide ? guide.utcTime : false);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Identifier 'data' is never reassigned; use 'const' instead of 'var'.
      Open

              var data = dataFn();
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Identifier 'utc' is never reassigned; use 'const' instead of 'var'.
      Open

              var utc = (guide ? guide.utcTime : false);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Identifier 'domainY' is never reassigned; use 'const' instead of 'var'.
      Open

              var domainY = utils.unique(data.map(x => x[dimY]), unify);
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      Forbidden 'var' keyword, use 'let' or 'const' instead
      Open

              var domY = domainY.length === 0 ? [null] : domainY;
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: no-var-keyword

      Disallows usage of the var keyword.

      Use let or const instead.

      Rationale

      Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

      Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

      Notes
      • Has Fix

      Config

      Not configurable.

      Examples
      "no-var-keyword": true

      For more information see this page.

      Identifier 'r' is never reassigned; use 'const' instead of 'var'.
      Open

                          var r = {};
      Severity: Minor
      Found in src/algebra.ts by tslint

      Rule: prefer-const

      Requires that variable declarations use const instead of let and var if possible.

      If a variable is only assigned to once when it is declared, it should be declared using 'const'

      Notes
      • Has Fix

      Config

      An optional object containing the property "destructuring" with two possible values:

      • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
      • "all" - Only warns if all variables in destructuring can be const.
      Examples
      "prefer-const": true
      "prefer-const": true,[object Object]
      Schema
      {
        "type": "object",
        "properties": {
          "destructuring": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          }
        }
      }

      For more information see this page.

      There are no issues that match your filters.

      Category
      Status