Showing 10 of 12 total issues
File deprecation.ts
has 267 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.
Function isDeclaration
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function isDeclaration(
id: TSESTree.Identifier | TSESTree.JSXIdentifier,
context: TSESLint.RuleContext<MessageIds, Options>,
) {
const parent = getParent(context);
- Read upRead up
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);
Function createRuleForIdentifier
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function createRuleForIdentifier(
context: TSESLint.RuleContext<'deprecated', Options>,
): TSESLint.RuleFunction<TSESTree.JSXIdentifier | TSESTree.Identifier> {
return function identifierRule(id) {
// Don't consider deprecations in certain cases:
- Read upRead up
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 createRuleForIdentifier
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createRuleForIdentifier(
context: TSESLint.RuleContext<'deprecated', Options>,
): TSESLint.RuleFunction<TSESTree.JSXIdentifier | TSESTree.Identifier> {
return function identifierRule(id) {
// Don't consider deprecations in certain cases:
Function identifierRule
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function identifierRule(id) {
// Don't consider deprecations in certain cases:
// - On JSX closing elements (only flag the opening element)
const isClosingElement =
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,
) {
- Read upRead up
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: ParserServicesWithTypeInformation,
context: TSESLint.RuleContext<MessageIds, Options>,
) {
- Read upRead up
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);
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) {
- Read upRead up
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"