Showing 889 of 1,485 total issues
File Utils.ts
has 478 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 deleteCharacter
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
deleteCharacter(isBackward: boolean): void {
const wasCollapsed = this.isCollapsed();
if (this.isCollapsed()) {
const anchor = this.anchor;
let anchorNode: TextNode | ElementNode | null = anchor.getNode();
- 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
ElementNode
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
export class ElementNode extends LexicalNode {
['constructor']!: KlassConstructor<typeof ElementNode>;
/** @internal */
__first: null | NodeKey;
/** @internal */
Function splice
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
splice(
start: number,
deleteCount: number,
nodesToInsert: Array<LexicalNode>,
): this {
- 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 SyncCursors.ts
has 451 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 LexicalListItemNode.ts
has 451 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 $createNodesFromDOM
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
function $createNodesFromDOM(
node: Node,
editor: LexicalEditor,
allArtificialNodes: Array<ArtificialNode__DO_NOT_USE>,
hasBlockAncestorLexicalNode: boolean,
- 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 $commitPendingUpdates
has 166 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function $commitPendingUpdates(
editor: LexicalEditor,
recoveryEditorState?: EditorState,
): void {
const pendingEditorState = editor._pendingEditorState;
File range-selection.ts
has 443 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 onKeyDown
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function onKeyDown(event: KeyboardEvent, editor: LexicalEditor): void {
lastKeyDownTimeStamp = event.timeStamp;
lastKeyCode = event.key;
if (editor.isComposing()) {
return;
- 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 updateDOMSelection
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
export function updateDOMSelection(
prevSelection: BaseSelection | null,
nextSelection: BaseSelection | null,
editor: LexicalEditor,
domSelection: Selection,
- 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 $reconcileChildren
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
function $reconcileChildren(
prevElement: ElementNode,
nextElement: ElementNode,
dom: HTMLElement,
): void {
- 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 applyChildrenYjsDelta
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
applyChildrenYjsDelta(
binding: Binding,
deltas: Array<{
insert?: string | object | AbstractType<unknown>;
delete?: number;
- 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 $commitPendingUpdates
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export function $commitPendingUpdates(
editor: LexicalEditor,
recoveryEditorState?: EditorState,
): void {
const pendingEditorState = editor._pendingEditorState;
- 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 $reconcileNodeChildren
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function $reconcileNodeChildren(
nextElement: ElementNode,
prevChildren: Array<NodeKey>,
nextChildren: Array<NodeKey>,
prevChildrenLength: number,
- 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 $flushMutations
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function $flushMutations(
editor: LexicalEditor,
mutations: Array<MutationRecord>,
observer: MutationObserver,
): void {
TextNode
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
export class TextNode extends LexicalNode {
['constructor']!: KlassConstructor<typeof TextNode>;
__text: string;
/** @internal */
__format: number;
File index.ts
has 401 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 $wrapNodesImpl
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function $wrapNodesImpl(
selection: BaseSelection,
nodes: LexicalNode[],
nodesLength: number,
createElement: () => ElementNode,
File LexicalAutoLinkNode.test.ts
has 396 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.