gund/eslint-plugin-deprecation

View on GitHub

Showing 8 of 10 total issues

Function isDeclaration has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function isDeclaration(
  id: TSESTree.Identifier | TSESTree.JSXIdentifier,
  context: TSESLint.RuleContext<MessageIds, Options>,
) {
  const parent = getParent(context);
Severity: Minor
Found in src/rules/deprecation.ts - About 2 hrs 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

Function isDeclaration has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function isDeclaration(
  id: TSESTree.Identifier | TSESTree.JSXIdentifier,
  context: TSESLint.RuleContext<MessageIds, Options>,
) {
  const parent = getParent(context);
Severity: Major
Found in src/rules/deprecation.ts - About 2 hrs to fix

    File deprecation.ts has 255 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU Lesser General Public
     * License as published by the Free Software Foundation; either
     * version 3 of the License, or (at your option) any later version.
    Severity: Minor
    Found in src/rules/deprecation.ts - About 2 hrs to fix

      Function createRuleForIdentifier has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function createRuleForIdentifier(
        context: TSESLint.RuleContext<'deprecated', Options>,
      ): TSESLint.RuleFunction<TSESTree.JSXIdentifier | TSESTree.Identifier> {
        return function identifierRule(id) {
          const services = ESLintUtils.getParserServices(context);
      Severity: Minor
      Found in src/rules/deprecation.ts - About 45 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

      Function getDeprecation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function getDeprecation(
        id: TSESTree.Identifier | TSESTree.JSXIdentifier,
        services: RequiredParserServices,
        context: TSESLint.RuleContext<MessageIds, Options>,
      ) {
      Severity: Minor
      Found in src/rules/deprecation.ts - About 45 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

      Function getSymbol has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function getSymbol(
        id: TSESTree.Identifier | TSESTree.JSXIdentifier,
        services: RequiredParserServices,
        tc: ts.TypeChecker,
      ) {
      Severity: Minor
      Found in src/rules/deprecation.ts - About 45 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

      Avoid too many return statements within this function.
      Open

            return parent.left === id && !isShortHandProperty(parent.parent);
      Severity: Major
      Found in src/rules/deprecation.ts - About 30 mins to fix

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

        function isCallExpression(
          node: TSESTree.Node | undefined,
          callee: TSESTree.Node,
        ): node is TSESTree.CallExpression | TSESTree.TaggedTemplateExpression {
          if (node) {
        Severity: Minor
        Found in src/rules/deprecation.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

        Severity
        Category
        Status
        Source
        Language