MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / formatSeverity

Function formatSeverity

src/types/codeScan.ts:115–131  ·  view source on GitHub ↗
(
  severity: CodeScanSeverity | undefined,
  style: 'plain' | 'markdown' = 'plain',
)

Source from the content-addressed store, hash-verified

113 * @returns Formatted severity string
114 */
115export function formatSeverity(
116 severity: CodeScanSeverity | undefined,
117 style: 'plain' | 'markdown' = 'plain',
118): string {
119 if (!severity) {
120 return '';
121 }
122
123 const emoji = getSeverityEmoji(severity);
124 const displayText = severity === CodeScanSeverity.NONE ? 'All Clear' : capitalize(severity);
125
126 if (style === 'markdown') {
127 return `_${emoji} ${displayText}_\n\n`;
128 }
129
130 return `${emoji} ${displayText}`;
131}
132
133/**
134 * Count comments by severity level

Callers 3

buildCommentBodyFunction · 0.90
displayScanResultsFunction · 0.90
prepareCommentsFunction · 0.90

Calls 2

getSeverityEmojiFunction · 0.85
capitalizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…