Showing 384 of 1,490 total issues
Function drawMessage
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const drawMessage = async function (diagram, msgModel, lineStartY: number, diagObj: Diagram) {
const { startx, stopx, starty, message, type, sequenceIndex, sequenceVisible } = msgModel;
const textDims = utils.calculateTextDimensions(message, messageFont(conf));
const textObj = svgDrawCommon.getTextObj();
textObj.x = startx;
Function drawClass
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawClass = function (elem, classDef, conf, diagObj) {
log.debug('Rendering class ', classDef, conf);
const id = classDef.id;
const classInfo = {
Function addVertices
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addVertices = async function (vert, g, svgId, root, _doc, diagObj) {
const svg = !root ? select(`[id="${svgId}"]`) : root.select(`[id="${svgId}"]`);
const doc = !_doc ? document : _doc;
const keys = Object.keys(vert);
File stateDiagram.spec.js
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { parser } from './parser/stateDiagram.jison';
import stateDb from './stateDb.js';
describe('state diagram, ', function () {
describe('when parsing an info graph it', function () {
Function drawNode
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawNode = function (
db: MindmapDB,
elem: D3Element,
node: FilledMindMapNode,
fullSection: number,
Function draw
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const draw = async function (text, id, _version, diagObj) {
// Add temporary render element
diagObj.db.clear();
nodeDb = {};
portPos = {};
Function draw
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const draw = function (text, id, _version, diagObj) {
const conf = getConfig().class;
idCache = {};
log.info('Rendering diagram ' + text);
Function getNodeFromBlock
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getNodeFromBlock(block: Block, db: BlockDB, positioned = false) {
const vertex = block;
let classStr = 'default';
if ((vertex?.classes?.length || 0) > 0) {
Function drawInsideBoundary
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawInsideBoundary(
diagram,
parentBoundaryAlias,
parentBounds,
currentBoundaries,
Function drawRelationshipFromLayout
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const drawRelationshipFromLayout = function (svg, rel, g, insert, diagObj) {
relCnt++;
// Find the edge relating to this relationship
const edge = g.edge(
File mermaidAPI.ts
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* This is the API to be used when optionally handling the integration with the web page, instead of
* using the default integration provided by mermaid.js.
*
* The core of this api is the [**render**](Setup.md?id=render) function which, given a graph
Function extractor
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const extractor = (graph, depth) => {
log.warn('extractor - ', depth, graphlibJson.write(graph), graph.children('D'));
if (depth > 10) {
log.error('Bailing out');
return;
File mindmap.spec.ts
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @ts-expect-error No types available for JISON
import { parser as mindmap } from './parser/mindmap.jison';
import mindmapDB from './mindmapDb.js';
// Todo fix utils functions for tests
import { setLogLevel } from '../../diagram-api/diagramAPI.js';
Function svgDrawLineForCommits
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function svgDrawLineForCommits(svg, fromId, toId, direction, color) {
logger.debug('svgDrawLineForCommits: ', fromId, toId);
const fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'));
const toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'));
switch (direction) {
File theme-default.js
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { invert, lighten, rgba, adjust, darken, isDark } from 'khroma';
import { mkBorder } from './theme-helpers.js';
import {
oldAttributeBackgroundColorEven,
oldAttributeBackgroundColorOdd,
Function render
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const render = async function (
id: string,
text: string,
svgContainingElement?: Element
): Promise<RenderResult> {
Function merge
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const merge = function (otherBranch, custom_id, override_type, custom_tag) {
otherBranch = common.sanitizeText(otherBranch, getConfig());
custom_id = common.sanitizeText(custom_id, getConfig());
const currentCommit = commits[branches[curBranch]];
File xyChart.spec.js
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
describe('XY Chart', () => {
it('should render the simplest possible chart', () => {
imgSnapshotTest(
Function insertMarkers
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const insertMarkers = function (elem) {
elem
.append('defs')
.append('marker')
.attr('id', 'extensionStart')
Function constructor
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
/* Base variables */
this.background = '#f4f4f4';
this.primaryColor = '#ECECFF';