TargetProcess/tauCharts

View on GitHub
src/elements/coords.cartesian.axis.ts

Summary

Maintainability
F
5 days
Test Coverage

Function createAxis has 440 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createAxis(config: AxisConfig) {

    const orient = Orient[config.scaleGuide.scaleOrient];
    const scale = config.scale;
    const scaleGuide = config.scaleGuide;
Severity: Major
Found in src/elements/coords.cartesian.axis.ts - About 2 days to fix

    File coords.cartesian.axis.ts has 516 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {defaults, take, normalizeAngle} from '../utils/utils';
    import {selectOrAppend, classes} from '../utils/utils-dom';
    import {cutText, wrapText, avoidTickTextCollision} from '../utils/d3-decorators';
    import {CSS_PREFIX} from '../const';
    import * as utilsDraw from '../utils/utils-draw';
    Severity: Major
    Found in src/elements/coords.cartesian.axis.ts - About 1 day to fix

      Function drawText has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function drawText(ticks: TickDataBinding) {
                  const textAnchor = scaleGuide.textAnchor;
                  const ty = (ko * spacing);
                  const tdy = (orient === Orient.top ? '0em' : orient === Orient.bottom ? '0.71em' : '0.32em');
      
      
      Severity: Major
      Found in src/elements/coords.cartesian.axis.ts - About 2 hrs to fix

        Function drawAxisLabel has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function drawAxisLabel() {
                    const guide = labelGuide;
        
                    const labelTextNode = selectOrAppend(selection, `text.label`)
                        .attr('class', classes('label', guide.cssClass))
        Severity: Minor
        Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

          Function fixOuterTicksOverflow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function fixOuterTicksOverflow(text: d3Selection) {
                      if (values.length === 0) {
                          return;
                      }
          
          
          Severity: Minor
          Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

            Function createTicks has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function createTicks(): TickDataBinding {
                        return take((selection
                            .selectAll('.tick') as d3Selection)
                            .data(values, (x) => String(scale(x)))
                            .order())
            Severity: Minor
            Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

              Function drawLines has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function drawLines(ticks: TickDataBinding) {
                          const ly = (ko * tickSize);
                          const lx = (isOrdinalScale ? ((d) => (kh * scale.stepSize(d) / 2)) : null);
              
                          take(ticks)
              Severity: Minor
              Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

                Function updateTicks has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function updateTicks(ticks: TickDataBinding) {
                
                            take(ticks)
                
                                .then(({tickEnter, tickExit, tick}) => {
                Severity: Minor
                Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

                  Function createAxis has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function createAxis(config: AxisConfig) {
                  
                      const orient = Orient[config.scaleGuide.scaleOrient];
                      const scale = config.scale;
                      const scaleGuide = config.scaleGuide;
                  Severity: Minor
                  Found in src/elements/coords.cartesian.axis.ts - About 25 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

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

                              const tempLeft = selection
                                  .append('line')
                                  .attr('x1', position(value0))
                                  .attr('x2', position(value0))
                                  .attr('y1', 0)
                  Severity: Major
                  Found in src/elements/coords.cartesian.axis.ts and 1 other location - About 1 hr to fix
                  src/elements/coords.cartesian.axis.ts on lines 480..485

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

                  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

                              const tempRight = selection
                                  .append('line')
                                  .attr('x1', position(value1))
                                  .attr('x2', position(value1))
                                  .attr('y1', 0)
                  Severity: Major
                  Found in src/elements/coords.cartesian.axis.ts and 1 other location - About 1 hr to fix
                  src/elements/coords.cartesian.axis.ts on lines 474..479

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

                  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 (isOrdinalScale) {
                                          line
                                              .attr(`${x}1`, lx)
                                              .attr(`${x}2`, lx);
                                      }
                  Severity: Minor
                  Found in src/elements/coords.cartesian.axis.ts and 1 other location - About 35 mins to fix
                  src/elements/coords.cartesian.axis.ts on lines 273..277

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 46.

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

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

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

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

                  Refactorings

                  Further Reading

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

                                      if (isOrdinalScale) {
                                          lineEnter
                                              .attr(`${x}1`, lx)
                                              .attr(`${x}2`, lx);
                                      }
                  Severity: Minor
                  Found in src/elements/coords.cartesian.axis.ts and 1 other location - About 35 mins to fix
                  src/elements/coords.cartesian.axis.ts on lines 291..295

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 46.

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

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

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

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

                  Refactorings

                  Further Reading

                  == should be ===
                  Open

                              values = gridOnly ? values.filter((d => d == 0)) : [];

                  Rule: triple-equals

                  Requires === and !== in place of == and !=.

                  Config

                  Two arguments may be optionally provided:

                  • "allow-null-check" allows == and != when comparing to null.
                  • "allow-undefined-check" allows == and != when comparing to undefined.
                  Examples
                  "triple-equals": true
                  "triple-equals": true,allow-null-check
                  "triple-equals": true,allow-undefined-check
                  Schema
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "allow-null-check",
                        "allow-undefined-check"
                      ]
                    },
                    "minLength": 0,
                    "maxLength": 2
                  }

                  For more information see this page.

                  Shadowed name: 'ticks'
                  Open

                          function drawLines(ticks: TickDataBinding) {

                  Rule: no-shadowed-variable

                  Disallows shadowing variable declarations.

                  Rationale

                  When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

                  const a = 'no shadow';
                  function print() {
                      console.log(a);
                  }
                  print(); // logs 'no shadow'.
                  const a = 'no shadow';
                  function print() {
                      const a = 'shadow'; // TSLint will complain here.
                      console.log(a);
                  }
                  print(); // logs 'shadow'.

                  ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

                  Config

                  You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

                  The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

                  The following example shows how the "temporalDeadZone" option changes the linting result:

                  function fn(value) {
                      if (value) {
                          const tmp = value; // no error on this line if "temporalDeadZone" is false
                          return tmp;
                      }
                      let tmp = undefined;
                      if (!value) {
                          const tmp = value; // this line always contains an error
                          return tmp;
                      }
                  }
                  Examples
                  "no-shadowed-variable": true
                  "no-shadowed-variable": true,[object Object]
                  Schema
                  {
                    "type": "object",
                    "properties": {
                      "class": {
                        "type": "boolean"
                      },
                      "enum": {
                        "type": "boolean"
                      },
                      "function": {
                        "type": "boolean"
                      },
                      "import": {
                        "type": "boolean"
                      },
                      "interface": {
                        "type": "boolean"
                      },
                      "namespace": {
                        "type": "boolean"
                      },
                      "typeAlias": {
                        "type": "boolean"
                      },
                      "typeParameter": {
                        "type": "boolean"
                      },
                      "temporalDeadZone": {
                        "type": "boolean"
                      },
                      "underscore": {
                        "type": "boolean"
                      }
                    }
                  }

                  For more information see this page.

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

                              var iMaxTexts = -1;

                  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 hasOverflow = false;

                  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

                              for (var i = textParts.length - 1; i > 0; i--) {

                  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.

                  Shadowed name: 'ticks'
                  Open

                          function drawText(ticks: TickDataBinding) {

                  Rule: no-shadowed-variable

                  Disallows shadowing variable declarations.

                  Rationale

                  When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

                  const a = 'no shadow';
                  function print() {
                      console.log(a);
                  }
                  print(); // logs 'no shadow'.
                  const a = 'no shadow';
                  function print() {
                      const a = 'shadow'; // TSLint will complain here.
                      console.log(a);
                  }
                  print(); // logs 'shadow'.

                  ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

                  Config

                  You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

                  The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

                  The following example shows how the "temporalDeadZone" option changes the linting result:

                  function fn(value) {
                      if (value) {
                          const tmp = value; // no error on this line if "temporalDeadZone" is false
                          return tmp;
                      }
                      let tmp = undefined;
                      if (!value) {
                          const tmp = value; // this line always contains an error
                          return tmp;
                      }
                  }
                  Examples
                  "no-shadowed-variable": true
                  "no-shadowed-variable": true,[object Object]
                  Schema
                  {
                    "type": "object",
                    "properties": {
                      "class": {
                        "type": "boolean"
                      },
                      "enum": {
                        "type": "boolean"
                      },
                      "function": {
                        "type": "boolean"
                      },
                      "import": {
                        "type": "boolean"
                      },
                      "interface": {
                        "type": "boolean"
                      },
                      "namespace": {
                        "type": "boolean"
                      },
                      "typeAlias": {
                        "type": "boolean"
                      },
                      "typeParameter": {
                        "type": "boolean"
                      },
                      "temporalDeadZone": {
                        "type": "boolean"
                      },
                      "underscore": {
                        "type": "boolean"
                      }
                    }
                  }

                  For more information see this page.

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

                      var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.

                  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 'dy' is never reassigned; use 'const' instead of 'let'.
                  Open

                                  let dy = (k * (orient === Orient.top || orient === Orient.bottom ?

                  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.

                  Shadowed name: 'ticks'
                  Open

                          function updateTicks(ticks: TickDataBinding) {

                  Rule: no-shadowed-variable

                  Disallows shadowing variable declarations.

                  Rationale

                  When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

                  const a = 'no shadow';
                  function print() {
                      console.log(a);
                  }
                  print(); // logs 'no shadow'.
                  const a = 'no shadow';
                  function print() {
                      const a = 'shadow'; // TSLint will complain here.
                      console.log(a);
                  }
                  print(); // logs 'shadow'.

                  ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

                  Config

                  You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

                  The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

                  The following example shows how the "temporalDeadZone" option changes the linting result:

                  function fn(value) {
                      if (value) {
                          const tmp = value; // no error on this line if "temporalDeadZone" is false
                          return tmp;
                      }
                      let tmp = undefined;
                      if (!value) {
                          const tmp = value; // this line always contains an error
                          return tmp;
                      }
                  }
                  Examples
                  "no-shadowed-variable": true
                  "no-shadowed-variable": true,[object Object]
                  Schema
                  {
                    "type": "object",
                    "properties": {
                      "class": {
                        "type": "boolean"
                      },
                      "enum": {
                        "type": "boolean"
                      },
                      "function": {
                        "type": "boolean"
                      },
                      "import": {
                        "type": "boolean"
                      },
                      "interface": {
                        "type": "boolean"
                      },
                      "namespace": {
                        "type": "boolean"
                      },
                      "typeAlias": {
                        "type": "boolean"
                      },
                      "typeParameter": {
                        "type": "boolean"
                      },
                      "temporalDeadZone": {
                        "type": "boolean"
                      },
                      "underscore": {
                        "type": "boolean"
                      }
                    }
                  }

                  For more information see this page.

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

                                  var rect = nodes[iMaxTexts].getBoundingClientRect();

                  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.

                  Shadowed name: 'x'
                  Open

                                  .data(values, (x) => String(scale(x)))

                  Rule: no-shadowed-variable

                  Disallows shadowing variable declarations.

                  Rationale

                  When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

                  const a = 'no shadow';
                  function print() {
                      console.log(a);
                  }
                  print(); // logs 'no shadow'.
                  const a = 'no shadow';
                  function print() {
                      const a = 'shadow'; // TSLint will complain here.
                      console.log(a);
                  }
                  print(); // logs 'shadow'.

                  ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

                  Config

                  You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

                  The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

                  The following example shows how the "temporalDeadZone" option changes the linting result:

                  function fn(value) {
                      if (value) {
                          const tmp = value; // no error on this line if "temporalDeadZone" is false
                          return tmp;
                      }
                      let tmp = undefined;
                      if (!value) {
                          const tmp = value; // this line always contains an error
                          return tmp;
                      }
                  }
                  Examples
                  "no-shadowed-variable": true
                  "no-shadowed-variable": true,[object Object]
                  Schema
                  {
                    "type": "object",
                    "properties": {
                      "class": {
                        "type": "boolean"
                      },
                      "enum": {
                        "type": "boolean"
                      },
                      "function": {
                        "type": "boolean"
                      },
                      "import": {
                        "type": "boolean"
                      },
                      "interface": {
                        "type": "boolean"
                      },
                      "namespace": {
                        "type": "boolean"
                      },
                      "typeAlias": {
                        "type": "boolean"
                      },
                      "typeParameter": {
                        "type": "boolean"
                      },
                      "temporalDeadZone": {
                        "type": "boolean"
                      },
                      "underscore": {
                        "type": "boolean"
                      }
                    }
                  }

                  For more information see this page.

                  Identifier 'k' is never reassigned; use 'const' instead of 'let'.
                  Open

                                  let k = isHorizontal ? 0.5 : -2;

                  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.

                  == should be ===
                  Open

                                      path.attr('d', orient === Orient.left || orient == Orient.right ?

                  Rule: triple-equals

                  Requires === and !== in place of == and !=.

                  Config

                  Two arguments may be optionally provided:

                  • "allow-null-check" allows == and != when comparing to null.
                  • "allow-undefined-check" allows == and != when comparing to undefined.
                  Examples
                  "triple-equals": true
                  "triple-equals": true,allow-null-check
                  "triple-equals": true,allow-undefined-check
                  Schema
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "allow-null-check",
                        "allow-undefined-check"
                      ]
                    },
                    "minLength": 0,
                    "maxLength": 2
                  }

                  For more information see this page.

                  Identifier 'kRot' is never reassigned; use 'const' instead of 'let'.
                  Open

                                  let kRot = (angle < 180 ? 1 : -1);

                  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.

                  == should be ===
                  Open

                                                      (d == 0) &&

                  Rule: triple-equals

                  Requires === and !== in place of == and !=.

                  Config

                  Two arguments may be optionally provided:

                  • "allow-null-check" allows == and != when comparing to null.
                  • "allow-undefined-check" allows == and != when comparing to undefined.
                  Examples
                  "triple-equals": true
                  "triple-equals": true,allow-null-check
                  "triple-equals": true,allow-undefined-check
                  Schema
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "allow-null-check",
                        "allow-undefined-check"
                      ]
                    },
                    "minLength": 0,
                    "maxLength": 2
                  }

                  For more information see this page.

                  Shadowed name: 'ticks'
                  Open

                                          const ticks = scale.ticks();

                  Rule: no-shadowed-variable

                  Disallows shadowing variable declarations.

                  Rationale

                  When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

                  const a = 'no shadow';
                  function print() {
                      console.log(a);
                  }
                  print(); // logs 'no shadow'.
                  const a = 'no shadow';
                  function print() {
                      const a = 'shadow'; // TSLint will complain here.
                      console.log(a);
                  }
                  print(); // logs 'shadow'.

                  ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

                  Config

                  You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

                  The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

                  The following example shows how the "temporalDeadZone" option changes the linting result:

                  function fn(value) {
                      if (value) {
                          const tmp = value; // no error on this line if "temporalDeadZone" is false
                          return tmp;
                      }
                      let tmp = undefined;
                      if (!value) {
                          const tmp = value; // this line always contains an error
                          return tmp;
                      }
                  }
                  Examples
                  "no-shadowed-variable": true
                  "no-shadowed-variable": true,[object Object]
                  Schema
                  {
                    "type": "object",
                    "properties": {
                      "class": {
                        "type": "boolean"
                      },
                      "enum": {
                        "type": "boolean"
                      },
                      "function": {
                        "type": "boolean"
                      },
                      "import": {
                        "type": "boolean"
                      },
                      "interface": {
                        "type": "boolean"
                      },
                      "namespace": {
                        "type": "boolean"
                      },
                      "typeAlias": {
                        "type": "boolean"
                      },
                      "typeParameter": {
                        "type": "boolean"
                      },
                      "temporalDeadZone": {
                        "type": "boolean"
                      },
                      "underscore": {
                        "type": "boolean"
                      }
                    }
                  }

                  For more information see this page.

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

                              var maxTextLn = 0;

                  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.

                  non-arrow functions are forbidden
                  Open

                      return function (d) {

                  Rule: only-arrow-functions

                  Disallows traditional (non-arrow) function expressions.

                  Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

                  Rationale

                  Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

                  Config

                  Two arguments may be optionally provided:

                  • "allow-declarations" allows standalone function declarations.
                  • "allow-named-functions" allows the expression function foo() {} but not function() {}.
                  Examples
                  "only-arrow-functions": true
                  "only-arrow-functions": true,allow-declarations,allow-named-functions
                  Schema
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "allow-declarations",
                        "allow-named-functions"
                      ]
                    },
                    "minLength": 0,
                    "maxLength": 1
                  }

                  For more information see this page.

                  Identifier 'oldPos' is never reassigned; use 'const' instead of 'let'.
                  Open

                              let oldPos = position;

                  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.

                  Shadowed name: 'i'
                  Open

                                  .attr('class', (d, i) => i % 2 ?

                  Rule: no-shadowed-variable

                  Disallows shadowing variable declarations.

                  Rationale

                  When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

                  const a = 'no shadow';
                  function print() {
                      console.log(a);
                  }
                  print(); // logs 'no shadow'.
                  const a = 'no shadow';
                  function print() {
                      const a = 'shadow'; // TSLint will complain here.
                      console.log(a);
                  }
                  print(); // logs 'shadow'.

                  ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

                  Config

                  You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

                  The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

                  The following example shows how the "temporalDeadZone" option changes the linting result:

                  function fn(value) {
                      if (value) {
                          const tmp = value; // no error on this line if "temporalDeadZone" is false
                          return tmp;
                      }
                      let tmp = undefined;
                      if (!value) {
                          const tmp = value; // this line always contains an error
                          return tmp;
                      }
                  }
                  Examples
                  "no-shadowed-variable": true
                  "no-shadowed-variable": true,[object Object]
                  Schema
                  {
                    "type": "object",
                    "properties": {
                      "class": {
                        "type": "boolean"
                      },
                      "enum": {
                        "type": "boolean"
                      },
                      "function": {
                        "type": "boolean"
                      },
                      "import": {
                        "type": "boolean"
                      },
                      "interface": {
                        "type": "boolean"
                      },
                      "namespace": {
                        "type": "boolean"
                      },
                      "typeAlias": {
                        "type": "boolean"
                      },
                      "typeParameter": {
                        "type": "boolean"
                      },
                      "temporalDeadZone": {
                        "type": "boolean"
                      },
                      "underscore": {
                        "type": "boolean"
                      }
                    }
                  }

                  For more information see this page.

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

                                  var textLength = textContent.length;

                  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 'textLength' is never reassigned; use 'const' instead of 'var'.
                  Open

                                  var textLength = textContent.length;

                  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.

                  non-arrow functions are forbidden
                  Open

                                          .attr('transform', function (d) {

                  Rule: only-arrow-functions

                  Disallows traditional (non-arrow) function expressions.

                  Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

                  Rationale

                  Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

                  Config

                  Two arguments may be optionally provided:

                  • "allow-declarations" allows standalone function declarations.
                  • "allow-named-functions" allows the expression function foo() {} but not function() {}.
                  Examples
                  "only-arrow-functions": true
                  "only-arrow-functions": true,allow-declarations,allow-named-functions
                  Schema
                  {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "allow-declarations",
                        "allow-named-functions"
                      ]
                    },
                    "minLength": 0,
                    "maxLength": 1
                  }

                  For more information see this page.

                  Shadowed name: 'selection'
                  Open

                              function fixTextPosForVerticalFacets(selection) {

                  Rule: no-shadowed-variable

                  Disallows shadowing variable declarations.

                  Rationale

                  When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

                  const a = 'no shadow';
                  function print() {
                      console.log(a);
                  }
                  print(); // logs 'no shadow'.
                  const a = 'no shadow';
                  function print() {
                      const a = 'shadow'; // TSLint will complain here.
                      console.log(a);
                  }
                  print(); // logs 'shadow'.

                  ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

                  Config

                  You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

                  The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

                  The following example shows how the "temporalDeadZone" option changes the linting result:

                  function fn(value) {
                      if (value) {
                          const tmp = value; // no error on this line if "temporalDeadZone" is false
                          return tmp;
                      }
                      let tmp = undefined;
                      if (!value) {
                          const tmp = value; // this line always contains an error
                          return tmp;
                      }
                  }
                  Examples
                  "no-shadowed-variable": true
                  "no-shadowed-variable": true,[object Object]
                  Schema
                  {
                    "type": "object",
                    "properties": {
                      "class": {
                        "type": "boolean"
                      },
                      "enum": {
                        "type": "boolean"
                      },
                      "function": {
                        "type": "boolean"
                      },
                      "import": {
                        "type": "boolean"
                      },
                      "interface": {
                        "type": "boolean"
                      },
                      "namespace": {
                        "type": "boolean"
                      },
                      "typeAlias": {
                        "type": "boolean"
                      },
                      "typeParameter": {
                        "type": "boolean"
                      },
                      "temporalDeadZone": {
                        "type": "boolean"
                      },
                      "underscore": {
                        "type": "boolean"
                      }
                    }
                  }

                  For more information see this page.

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

                          var values: any[];

                  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 'sign' is never reassigned; use 'const' instead of 'let'.
                  Open

                                  let sign = (orient === Orient.top || orient === Orient.left ? -1 : 1);

                  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 'rect' is never reassigned; use 'const' instead of 'var'.
                  Open

                                  var rect = nodes[iMaxTexts].getBoundingClientRect();

                  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