Showing 889 of 1,485 total issues
Function resolveSelectionPointOnBoundary
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolveSelectionPointOnBoundary(
point: TextPointType,
isBackward: boolean,
isCollapsed: boolean,
): void {
Function setTextThemeClassNames
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setTextThemeClassNames(
tag: string,
prevFormat: number,
nextFormat: number,
dom: HTMLElement,
File TrashCan.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace BookStack\Entities\Tools;
use BookStack\Entities\EntityProvider;
Consider simplifying this complex logical expression. Open
Open
if ($model instanceof Page) {
$parentPermission = ($currentParent instanceof Chapter) ? 'chapter-update' : 'book-update';
$hasCurrentParentPermission = userCan($parentPermission, $currentParent);
// This needs to check if there was an intended chapter location in the original sort map
Function deleteTextHandler
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const deleteTextHandler = (command: LexicalCommand<boolean>) => () => {
const selection = $getSelection();
if (!$isSelectionInTable(selection, tableNode)) {
return false;
Function onDocumentSelectionChange
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onDocumentSelectionChange(event: Event): void {
const target = event.target as null | Element | Document;
const targetWindow =
target == null
? null
Function importDOM
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static importDOM(): DOMConversionMap | null {
return {
h1: (node: Node) => ({
conversion: $convertHeadingElement,
priority: 0,
Function updateDOMBlockCursorElement
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function updateDOMBlockCursorElement(
editor: LexicalEditor,
rootElement: HTMLElement,
nextSelection: null | BaseSelection,
): void {
Function init
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function init(editor) {
const Code = await window.importVersioned('code');
/**
* @param {ViewUpdate} v
Method processAccessTokenCallback
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function processAccessTokenCallback(OidcAccessToken $accessToken, OidcProviderSettings $settings): User
{
$idTokenText = $accessToken->getIdToken();
$idToken = new OidcIdToken(
$idTokenText,
Function position
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function position(): void {
invariant(rootDOMNode !== null, 'Unexpected null rootDOMNode');
invariant(parentDOMNode !== null, 'Unexpected null parentDOMNode');
const {left: rootLeft, top: rootTop} = rootDOMNode.getBoundingClientRect();
const parentDOMNode_ = parentDOMNode;
Function $appendNodesToJSON
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function $appendNodesToJSON(
editor: LexicalEditor,
selection: BaseSelection | null,
currentNode: LexicalNode,
targetArray: Array<BaseSerializedNode> = [],
Function $insertDataTransferForRichText
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function $insertDataTransferForRichText(
dataTransfer: DataTransfer,
selection: BaseSelection,
editor: LexicalEditor,
): void {
Function $handleIndent
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function $handleIndent(listItemNode: ListItemNode): void {
// go through each node and decide where to move it.
const removed = new Set<NodeKey>();
if (isNestedListNode(listItemNode) || removed.has(listItemNode.getKey())) {
Function onClick
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onClick(event: PointerEvent, editor: LexicalEditor): void {
updateEditor(editor, () => {
const selection = $getSelection();
const domSelection = getDOMSelection(editor._window);
const lastSelection = $getPreviousSelection();
Function applyTextFormatFromStyle
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function applyTextFormatFromStyle(
style: CSSStyleDeclaration,
shouldApply?: TextFormatType,
) {
const fontWeight = style.fontWeight;
Method build
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function build(): array
{
// Note, while we attempt to use the user's preference here, the request to the manifest
// does not start a session, so we won't have current user context.
// This was attempted but removed since manifest calls could affect user session
Function register
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function register(editor) {
// Headers
for (let i = 1; i < 5; i++) {
editor.shortcuts.add(`meta+${i}`, '', ['FormatBlock', false, `h${i + 1}`]);
}
Function buildEditorUI
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function buildEditorUI(container: HTMLElement, element: HTMLElement, scrollContainer: HTMLElement, editor: LexicalEditor, options: Record<string, any>): EditorUiContext {
const manager = new EditorUIManager();
const context: EditorUiContext = {
editor,
containerDOM: container,
Function build
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
build() {
const generalFields: EditorFormFieldDefinition[] = [
{
label: 'Width', // Style - width
name: 'width',