Showing 889 of 1,485 total issues
Function decodeEscapes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
protected static function decodeEscapes(string $input): string
{
$decoded = "";
$escaping = false;
- 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 getAdditionalOptionsString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getAdditionalOptionsString(): string
{
$options = [];
// Handle filters without UI support
- 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 deeply nested control flow statements. Open
Open
if ($isTextNode(anchorNode)) {
anchorNode.select();
}
Avoid deeply nested control flow statements. Open
Open
for (let i = 0; i < elements.length; i++) {
const element = elements[i];
target.append(element);
lastElement = element;
}
Avoid deeply nested control flow statements. Open
Open
if (node instanceof CollabTextNode) {
node._text = spliceString(node._text, offset, 0, insertDelta);
} else {
// TODO: maybe we can improve this by keeping around a redundant
// text node map, rather than removing all the text nodes, so there
Avoid deeply nested control flow statements. Open
Open
if (prevSibling.nodeName === 'P') {
prevSibling = prevSibling.firstChild;
}
Avoid deeply nested control flow statements. Open
Open
if (nextTextNode === null) {
throw new Error('moveNativeSelectionForward: TODO');
} else {
setNativeSelection(nextTextNode, 0, nextTextNode, 0);
}
Avoid deeply nested control flow statements. Open
Open
if (
offset === 0 &&
delCount === 1 &&
nodeIndex > 0 &&
prevCollabNode instanceof CollabTextNode &&
Avoid deeply nested control flow statements. Open
Open
} else if (!_$isTextNode) {
anchor.node = anchorNode.childNodes[anchorOffset - 1];
anchor.offset = anchor.node.nodeValue.length - 1;
} else {
anchor.offset--;
Avoid deeply nested control flow statements. Open
Open
if (lastTextNode === null) {
throw new Error('moveNativeSelectionBackward: TODO');
} else {
const textLength = lastTextNode.nodeValue!.length;
setNativeSelection(
Avoid deeply nested control flow statements. Open
Open
if (anchorCollabNode !== null && focusCollabNode !== null) {
const anchorKey = anchorCollabNode.getKey();
const focusKey = focusCollabNode.getKey();
selection = cursor.selection;
Avoid deeply nested control flow statements. Open
Open
if (anchorOffset < remaining) {
anchorOffset = currentNodeSize;
}
Avoid deeply nested control flow statements. Open
Open
if (prevSibling === null) {
prevSibling = anchorNode.parentElement.previousSibling.lastChild;
}
Avoid deeply nested control flow statements. Open
Open
if (nextSibling.nodeName === 'BR') {
anchor.node = nextSibling;
anchor.offset = 0;
} else {
anchor.node = nextSibling.firstChild;
Avoid deeply nested control flow statements. Open
Open
if (prevSibling.nodeName === 'BR') {
anchor.node = prevSibling;
anchor.offset = 0;
} else {
anchor.node = prevSibling.firstChild;
Function createBinding
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
editor: LexicalEditor,
provider: Provider,
id: string,
doc: Doc | null | undefined,
docMap: Map<string, Doc>,
Avoid deeply nested control flow statements. Open
Open
if (anchorNode.nodeName === 'BR') {
const parentNode = anchorNode.parentNode!;
const childNodes = Array.from(parentNode.childNodes);
anchorOffset = childNodes.indexOf(anchorNode as ChildNode);
anchorNode = parentNode;
Avoid deeply nested control flow statements. Open
Open
if (nextSibling === null) {
nextSibling = anchorNode.parentElement.nextSibling.lastChild;
}
Avoid deeply nested control flow statements. Open
Open
for (let i = 0; i < segmentsLength; i++) {
const segment = segments[i];
const nextIndex = segment.index + segment.segment.length;
if (segment.isWordLike) {
Avoid deeply nested control flow statements. Open
Open
for (let i = 0; i < elements.length; i++) {
const element = elements[i];
firstChild.insertBefore(element);
lastElement = element;
}