Showing 384 of 1,490 total issues
Function drawLabel
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawLabel = function (elem, txtObject) {
/**
* @param {any} x
* @param {any} y
* @param {any} width
Function contentLoaded
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const contentLoaded = async function () {
let pos = document.location.href.indexOf('?graph=');
if (pos > 0) {
pos = pos + 7;
const graphBase64 = document.location.href.substr(pos);
Function addRelationObjs
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function addRelationObjs(item1, item2, relationTitle) {
let id1 = startIdIfNeeded(item1.id.trim());
let type1 = startTypeIfNeeded(item1.id.trim(), item1.type);
let id2 = startIdIfNeeded(item2.id.trim());
let type2 = startTypeIfNeeded(item2.id.trim(), item2.type);
Function renderKatex
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const renderKatex = async (text: string, config: MermaidConfig): Promise<string> => {
if (!hasKatex(text)) {
return text;
}
Function byTspan
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {
Function byTspan
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {
Function addRel
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export const addRel = function (type, from, to, label, techn, descr, sprite, tags, link) {
Function insertNode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const insertNode = async (elem, node, dir) => {
let newEl;
let el;
// Add link when appropriate
Function createCssStyles
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const createCssStyles = (
config: MermaidConfig,
classDefs: Record<string, DiagramStyleClassDef> | null | undefined = {}
): string => {
let cssStyles = '';
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) {
Function getMaxChildSize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getMaxChildSize = (block: Block) => {
let maxWidth = 0;
let maxHeight = 0;
// find max width of children
// log.debug('getMaxChildSize abc95 (start) parent:', block.id);
Function getQuadrantPoints
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getQuadrantPoints(spaceData: CalculateSpaceData): QuadrantPointType[] {
const { quadrantSpace } = spaceData;
const { quadrantHeight, quadrantLeft, quadrantTop, quadrantWidth } = quadrantSpace;
Function intersectLine
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function intersectLine(p1, p2, q1, q2) {
// Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,
// p7 and p473.
var a1, a2, b1, b2, c1, c2;
Function subroutine
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const subroutine = async (parent, node) => {
const { shapeSvg, bbox } = await labelHelper(
parent,
node,
getClassesFromNode(node, undefined),
Function loadRegisteredDiagrams
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const loadRegisteredDiagrams = async () => {
log.debug(`Loading registered diagrams`);
// Load all lazy loaded diagrams in parallel
const results = await Promise.allSettled(
Object.entries(detectors).map(async ([key, { detector, loader }]) => {
Function setupToolTips
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const setupToolTips = function (element) {
let tooltipElem = select('.mermaidTooltip');
if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
tooltipElem = select('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);
}
Function sanitize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const sanitize = (options: any) => {
if (!options) {
return;
}
// Checking that options are not in the list of excluded options
Function insertEdge
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const insertEdge = function (edgesEl, edge, edgeData, diagObj, parentLookupDb, id) {
const offset = calcOffset(edge.sourceId, edge.targetId, parentLookupDb);
const src = edge.sections[0].startPoint;
const dest = edge.sections[0].endPoint;
Function createFormattedText
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createFormattedText(
width: number,
g: any,
structuredText: MarkdownWord[][],
addBackground = false
Function drawNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawNode = function (elem, node, fullSection, conf) {
const section = (fullSection % MAX_SECTIONS) - 1;
const nodeElem = elem.append('g');
node.section = section;
nodeElem.attr(