Showing 384 of 1,490 total issues
File stateRenderer-v2.js
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';
import { select } from 'd3';
import { getConfig } from '../../diagram-api/diagramAPI.js';
import { render } from '../../dagre-wrapper/index.js';
import { log } from '../../logger.js';
Function drawLoop
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawLoop = async function (elem, loopModel, labelText, conf) {
const {
boxMargin,
boxTextMargin,
labelBoxHeight,
Function draw
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const draw = (txt: string, id: string, _version: string, diagObj: Diagram) => {
const db = diagObj.db as typeof XYChartDB;
const themeConfig = db.getChartThemeConfig();
const chartConfig = db.getChartConfig();
function getDominantBaseLine(horizontalPos: TextVerticalPos) {
Function labelHelper
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const labelHelper = async (parent, node, _classes, isNode) => {
let classes;
const useHtmlLabels = node.useHtmlLabels || evaluate(getConfig().flowchart.htmlLabels);
if (!_classes) {
classes = 'node default';
Function makeGrid
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeGrid(theSidePad, theTopPad, w, h) {
let bottomXAxis = axisBottom(timeScale)
.tickSize(-h + theTopPad + conf.gridLineStartPadding)
.tickFormat(timeFormat(diagObj.db.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));
File mermaid-graphlib.spec.js
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as graphlibJson from 'dagre-d3-es/src/graphlib/json.js';
import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';
import {
validate,
adjustClustersAndEdges,
Function _drawTextCandidateFunc
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const _drawTextCandidateFunc = (function () {
/**
* @param {any} content
* @param {any} g
* @param {any} x
Function drawRels
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawRels = (elem, rels, conf) => {
const relsElem = elem.append('g');
let i = 0;
for (let rel of rels) {
let textColor = rel.textColor ? rel.textColor : '#444444';
Function getAxisLabels
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getAxisLabels(
xAxisPosition: typeof this.config.xAxisPosition,
showXAxis: boolean,
showYAxis: boolean,
spaceData: CalculateSpaceData
File svgDraw.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { arc as d3arc } from 'd3';
import * as svgDrawCommon from '../common/svgDrawCommon.js';
export const drawRect = function (elem, rectData) {
return svgDrawCommon.drawRect(elem, rectData);
File gitGraphRenderer-old.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { curveBasis, line, select } from 'd3';
import db from './gitGraphAst.js';
import { logger } from '../../logger.js';
import { interpolateToCurve } from '../../utils.js';
Function addEdges
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addEdges = async function (edges, g, diagObj) {
let cnt = 0;
let defaultStyle;
let defaultLabelStyle;
Function drawEdge
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawEdge = function (elem, path, relation) {
const getRelationType = function (type) {
switch (type) {
case stateDb.relationType.AGGREGATION:
return 'aggregation';
File theme.spec.js
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { imgSnapshotTest } from '../../helpers/util.ts';
describe('themeCSS balancing, it', () => {
it('should not allow unbalanced CSS definitions', () => {
imgSnapshotTest(
Function rectWithTitle
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const rectWithTitle = (parent, node) => {
// const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes);
let classes;
if (!node.classes) {
Function getQuadrants
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getQuadrants(spaceData: CalculateSpaceData): QuadrantQuadrantsType[] {
const { quadrantSpace } = spaceData;
const { quadrantHalfHeight, quadrantLeft, quadrantHalfWidth, quadrantTop } = quadrantSpace;
Function drawActorTypeActor
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const drawActorTypeActor = async function (elem, actor, conf, isFooter) {
const actorY = isFooter ? actor.stopy : actor.starty;
const center = actor.x + actor.width / 2;
const centerY = actorY + 80;
Function cherryPick
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const cherryPick = function (sourceId, targetId, tag, parentCommitId) {
log.debug('Entering cherryPick:', sourceId, targetId, tag);
sourceId = common.sanitizeText(sourceId, getConfig());
targetId = common.sanitizeText(targetId, getConfig());
tag = common.sanitizeText(tag, getConfig());
Function insertEdgeLabel
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const insertEdgeLabel = (elem, edge) => {
const useHtmlLabels = evaluate(getConfig().flowchart.htmlLabels);
// Create the actual text element
const labelElement =
edge.labelType === 'markdown'
File erDiagram.spec.js
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
describe('Entity Relationship Diagram', () => {
it('should render a simple ER diagram', () => {
imgSnapshotTest(