packages/mermaid/src/diagrams/class/classDb.ts
File classDb.ts
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { Selection } from 'd3';
import { select } from 'd3';
import { log } from '../../logger.js';
import { getConfig } from '../../diagram-api/diagramAPI.js';
import common from '../common/common.js';
Function setClickFunc
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const setClickFunc = function (_domId: string, functionName: string, functionArgs: string) {
const domId = common.sanitizeText(_domId, getConfig());
const config = getConfig();
if (config.securityLevel !== 'loose') {
return;
Function setupToolTips
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const setupToolTips = function (element: Element) {
let tooltipElem: Selection<HTMLDivElement, unknown, HTMLElement, unknown> =
select('.mermaidTooltip');
// @ts-expect-error - Incorrect types
if ((tooltipElem._groups || tooltipElem)[0][0] === null) {