Showing 384 of 1,490 total issues
File sequenceDiagram.spec.js
has 1740 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { vi } from 'vitest';
import { setSiteConfig } from '../../diagram-api/diagramAPI.js';
import mermaidAPI from '../../mermaidAPI.js';
import { Diagram, getDiagramFromText } from '../../Diagram.js';
import { addDiagrams } from '../../diagram-api/diagram-orchestration.js';
File classDiagram.spec.ts
has 1513 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @ts-expect-error Jison doesn't export types
import { parser } from './parser/classDiagram.jison';
import classDb from './classDb.js';
import { vi, describe, it, expect } from 'vitest';
const spyOn = vi.spyOn;
File sequenceRenderer.ts
has 1360 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @ts-nocheck TODO: fix file
import { select } from 'd3';
import svgDraw, { drawKatex, ACTOR_TYPE_WIDTH, drawText, fixLifeLineHeights } from './svgDraw.js';
import { log } from '../../logger.js';
import common, { calculateMathMLDimensions, hasKatex } from '../common/common.js';
Function draw
has 568 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const draw = function (text, id, version, diagObj) {
const conf = getConfig().gantt;
const securityLevel = getConfig().securityLevel;
// Handle root and Document for when rendering in sandbox mode
File gitGraph.spec.js
has 1003 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { imgSnapshotTest } from '../../helpers/util.ts';
describe('Git Graph diagram', () => {
it('1: should render a simple gitgraph with commit on main branch', () => {
imgSnapshotTest(
File sequencediagram.spec.js
has 986 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/// <reference types="Cypress" />
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
context('Sequence diagram', () => {
File nodes.js
has 982 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { select } from 'd3';
import { log } from '../logger.js';
import { labelHelper, updateNodeBounds, insertPolygonShape } from './shapes/util.js';
import { getConfig } from '../diagram-api/diagramAPI.js';
import intersect from './intersect/index.js';
File flowchart-v2.spec.js
has 943 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
describe('Flowchart v2', () => {
it('1: should render a simple flowchart', () => {
imgSnapshotTest(
File gitGraphParserV2.spec.js
has 913 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import gitGraphAst from './gitGraphAst.js';
import { parser } from './parser/gitGraph.jison';
describe('when parsing a gitGraph', function () {
beforeEach(function () {
File svgDraw.js
has 875 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import common, { calculateMathMLDimensions, hasKatex, renderKatex } from '../common/common.js';
import * as svgDrawCommon from '../common/svgDrawCommon.js';
import { addFunction } from '../../interactionDb.js';
import { ZERO_WIDTH_SPACE, parseFontSize } from '../../utils.js';
import { sanitizeUrl } from '@braintree/sanitize-url';
File flowchart.spec.js
has 864 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
describe('Graph', () => {
it('1: should render a simple flowchart no htmlLabels', () => {
imgSnapshotTest(
File flowchart-elk.spec.js
has 802 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
describe.skip('Flowchart ELK', () => {
it('1-elk: should render a simple flowchart', () => {
imgSnapshotTest(
File c4Db.js
has 733 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { getConfig } from '../../diagram-api/diagramAPI.js';
import { sanitizeText } from '../common/common.js';
import {
setAccTitle,
getAccTitle,
Function draw
has 320 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const draw = async function (_text: string, id: string, _version: string, diagObj: Diagram) {
const { securityLevel, sequence } = getConfig();
conf = sequence;
// Handle root and Document for when rendering in sandbox mode
let sandboxElement;
File flowRenderer-elk.js
has 668 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { select, line, curveLinear } from 'd3';
import { insertNode } from '../../../dagre-wrapper/nodes.js';
import insertMarkers from '../../../dagre-wrapper/markers.js';
import { insertEdgeLabel } from '../../../dagre-wrapper/edges.js';
import { findCommonAncestor } from './render-utils.js';
File ganttRenderer.js
has 634 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import dayjs from 'dayjs';
import { log } from '../../logger.js';
import {
select,
scaleTime,
File gantt.spec.js
has 633 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
describe('Gantt diagram', () => {
beforeEach(() => {
cy.clock(new Date('1010-10-10').getTime());
File mermaidAPI.spec.ts
has 633 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
import { vi } from 'vitest';
// -------------------------------------
// Mocks and mocking
File utils.ts
has 629 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { sanitizeUrl } from '@braintree/sanitize-url';
import type { CurveFactory } from 'd3';
import {
curveBasis,
curveBasisClosed,
File flowDb.js
has 618 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { select } from 'd3';
import utils from '../../utils.js';
import { getConfig, defaultConfig } from '../../diagram-api/diagramAPI.js';
import common from '../common/common.js';
import { log } from '../../logger.js';