Showing 889 of 1,485 total issues
File LexicalSelectionHelpers.test.ts
has 2520 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalSelection.ts
has 2308 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalTableSelectionHelpers.ts
has 1595 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalUtils.ts
has 1523 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function applyTableHandlers
has 709 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function applyTableHandlers(
tableNode: TableNode,
tableElement: HTMLTableElementWithWithTableSelectionState,
editor: LexicalEditor,
hasTabHandler: boolean,
File LexicalNode.test.ts
has 1268 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function insertText
has a Cognitive Complexity of 149 (exceeds 5 allowed). Consider refactoring. Open
insertText(text: string): void {
const anchor = this.anchor;
const focus = this.focus;
const format = this.format;
const style = this.style;
- 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
File LexicalListItemNode.test.ts
has 1174 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function $handleArrowKey
has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring. Open
function $handleArrowKey(
editor: LexicalEditor,
event: KeyboardEvent,
direction: Direction,
tableNode: TableNode,
- 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
File LexicalEvents.ts
has 1106 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalTextNode.ts
has 1044 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function registerRichText
has 490 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function registerRichText(editor: LexicalEditor): () => void {
const removeListener = mergeRegister(
editor.registerCommand(
CLICK_COMMAND,
(payload) => {
File index.ts
has 954 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalEditor.ts
has 867 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalUpdates.ts
has 848 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalTableUtils.ts
has 790 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Function modify
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
Selection.prototype.modify = function (alter, direction, granularity) {
// This is not a thorough implementation, it was more to get tests working
// given the refactor to use this selection method.
const symbol = Object.getOwnPropertySymbols(this)[0];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- 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
File index.ts
has 780 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalTextNode.test.ts
has 771 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
File LexicalReconciler.ts
has 678 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.