Showing 889 of 1,485 total issues
Function $getTableCellNodeRect
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function $getTableCellNodeRect(tableCellNode: TableCellNode): {
rowIndex: number;
columnIndex: number;
rowSpan: number;
colSpan: 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 getTable
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function getTable(tableElement: HTMLElement): TableDOMTable {
const domRows: TableDOMRows = [];
const grid = {
columns: 0,
domRows,
- 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 getNodes
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
getNodes(): Array<LexicalNode> {
const cachedNodes = this._cachedNodes;
if (cachedNodes !== null) {
return cachedNodes;
}
- 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 updateDOM
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateDOM(
prevNode: TextNode,
dom: HTMLElement,
config: EditorConfig,
): boolean {
Function setupTracker
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupTracker(container: HTMLElement, node: NodeHasSize, nodeDOM: HTMLElement): MouseDragTracker {
let startingWidth: number = 0;
let startingHeight: number = 0;
let startingRatio: number = 0;
let hasHeight = false;
Function $internalCreateRangeSelection
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function $internalCreateRangeSelection(
lastSelection: null | BaseSelection,
domSelection: Selection | null,
editor: LexicalEditor,
event: UIEvent | Event | null,
Function getTable
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getTable(tableElement: HTMLElement): TableDOMTable {
const domRows: TableDOMRows = [];
const grid = {
columns: 0,
domRows,
Function init
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function init() {
const config = {
nodes: [
LinkNode,
Function selectTableNodeInDirection
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const selectTableNodeInDirection = (
tableObserver: TableObserver,
tableNode: TableNode,
x: number,
y: number,
Function $updateElementSelectionOnCreateDeleteNode
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function $updateElementSelectionOnCreateDeleteNode(
selection: RangeSelection,
parentNode: LexicalNode,
nodeOffset: number,
times = 1,
Function $updateSelectionResolveTextNodes
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $updateSelectionResolveTextNodes(selection: RangeSelection): void {
const anchor = selection.anchor;
const anchorOffset = anchor.offset;
const focus = selection.focus;
const focusOffset = focus.offset;
Function $getSelectionStyleValueForProperty
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function $getSelectionStyleValueForProperty(
selection: RangeSelection | TableSelection,
styleProperty: string,
defaultValue = '',
): string {
- 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 $updateCaretSelectionForUnicodeCharacter
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function $updateCaretSelectionForUnicodeCharacter(
selection: RangeSelection,
isBackward: boolean,
): void {
const anchor = selection.anchor;
- 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 $internalCreateRangeSelection
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function $internalCreateRangeSelection(
lastSelection: null | BaseSelection,
domSelection: Selection | null,
editor: LexicalEditor,
event: UIEvent | Event | null,
- 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 choice
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
choice(translation: string, count: number, replacements: Record<string, string> = {}): string {
const splitText = translation.split('|');
const exactCountRegex = /^{([0-9]+)}/;
const rangeRegex = /^\[([0-9]+),([0-9*]+)]/;
let result = null;
- 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 scrollIntoViewIfNeeded
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function scrollIntoViewIfNeeded(
editor: LexicalEditor,
selectionRect: DOMRect,
rootElement: 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 $getAdjacentNode
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function $getAdjacentNode(
focus: PointType,
isBackward: boolean,
): null | LexicalNode {
const focusOffset = focus.offset;
- 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 copyToClipboard
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function copyToClipboard(
editor: LexicalEditor,
event: null | ClipboardEvent,
data?: LexicalClipboardData,
): Promise<boolean> {
Function createDOMRange
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createDOMRange(
editor: LexicalEditor,
anchorNode: LexicalNode,
_anchorOffset: number,
focusNode: LexicalNode,
Function $computeTableMapSkipCellCheck
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function $computeTableMapSkipCellCheck(
grid: TableNode,
cellA: null | TableCellNode,
cellB: null | TableCellNode,
): [TableMapType, TableMapValueType | null, TableMapValueType | null] {