Showing 429 of 1,682 total issues
Function drawPopup
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawPopup = function (elem, actor, minMenuWidth, textAttrs, forceMenus) {
if (actor.links === undefined || actor.links === null || Object.keys(actor.links).length === 0) {
return { height: 0, width: 0 };
}
File blockDB.ts
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import clone from 'lodash-es/clone.js';
import * as configApi from '../../config.js';
import { getConfig } from '../../diagram-api/diagramAPI.js';
import type { DiagramDB } from '../../diagram-api/types.js';
import { log } from '../../logger.js';
Function addState
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addState = function (
id,
type = DEFAULT_STATE_TYPE,
doc = null,
descr = null,
Function draw
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const draw = (text, id, version) => {
try {
const conf = getConfig();
log.debug('Rendering example diagram\n' + text, 'Conf: ');
const THEME_COLOR_LIMIT = getConfig().themeVariables.THEME_COLOR_LIMIT;
Function addVertex
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addVertex = function (
id: string,
textObj: FlowText,
type: 'group',
style: string[],
Function addSubGraph
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addSubGraph = function (
_id: { text: string },
list: string[],
_title: { text: string; type: string }
) {
Function insertLineEndings
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const insertLineEndings = (parentNode, conf) => {
let containsNode = parentNode
.append('defs')
.append('marker')
.attr('id', ReqMarkers.CONTAINS + '_line_ending')
Function addRelations
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addRelations = function (relations: ClassRelation[], g: graphlib.Graph) {
const conf = getConfig().flowchart;
let cnt = 0;
relations.forEach(function (edge) {
Function addPersonOrSystem
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addPersonOrSystem = function (typeC4Shape, alias, label, descr, sprite, tags, link) {
// Don't allow label nulling
if (alias === null || label === null) {
return;
}
Function forkJoin
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const forkJoin = (parent: SVG, node: Node, dir: string) => {
const { themeVariables } = getConfig();
const { lineColor } = themeVariables;
const shapeSvg = parent
.insert('g')
Function drawTasks
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const drawTasks = function (
diagram: Selection<SVGElement, unknown, null, undefined>,
tasks: TimelineTask[],
sectionColor: number,
masterX: number,
Function drawCommits
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const drawCommits = (
svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>,
commits: Map<string, Commit>,
modifyGraph: boolean
) => {
Function genSections
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const genSections = (options) => {
let sections = '';
for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
options['lineColor' + i] = options['lineColor' + i] || options['cScaleInv' + i];
Function divider
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const divider = (parent, node) => {
const siteConfig = getConfig();
const { themeVariables, handDrawnSeed } = siteConfig;
const { nodeBorder } = themeVariables;
Function parseData
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const parseData = function (prevTaskId, dataStr) {
let ds;
if (dataStr.substr(0, 1) === ':') {
ds = dataStr.substr(1, dataStr.length);
} else {
Function fixCorners
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fixCorners = function (lineData) {
const { cornerPointPositions } = extractCornerPoints(lineData);
const newLineData = [];
for (let i = 0; i < lineData.length; i++) {
if (cornerPointPositions.includes(i)) {
Function choice
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const choice = (parent: SVG, node: Node) => {
const { labelStyles, nodeStyles } = styles2String(node);
node.labelStyle = labelStyles;
const { themeVariables } = getConfig();
const { lineColor } = themeVariables;
Function draw
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const draw = (text, id, _version, diagObj) => {
conf = getConfig().requirement;
const securityLevel = conf.securityLevel;
// Handle root and Document for when rendering in sandbox mode
Function calculateTextDimensions
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(text: string, config: TextDimensionConfig): TextDimensions => {
const { fontSize = 12, fontFamily = 'Arial', fontWeight = 400 } = config;
if (!text) {
return { width: 0, height: 0 };
}
Function styles2String
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const styles2String = (node: Node) => {
const { stylesArray } = compileStyles(node);
const labelStyles: string[] = [];
const nodeStyles: string[] = [];
const borderStyles: string[] = [];