MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / render_finding_card

Function render_finding_card

atomic-cli/src/commands/triage/output.rs:419–457  ·  view source on GitHub ↗
(f: &Finding)

Source from the content-addressed store, hash-verified

417}
418
419fn render_finding_card(f: &Finding) -> String {
420 let sev = match f.severity.as_str() {
421 SEV_BLOCK => "block",
422 SEV_WARN => "warn",
423 SEV_INFO => "info",
424 _ => "info",
425 };
426 let mut card = String::new();
427 card.push_str(&format!(
428 "<div class=\"finding {sev}\" data-severity=\"{sev}\">\n"
429 ));
430 card.push_str(&format!(
431 "<div class=\"finding-head\"><span class=\"sev-badge {sev}\">{}</span><span class=\"code\">{}</span></div>\n",
432 html_escape(sev),
433 html_escape(&f.code)
434 ));
435 card.push_str(&format!(
436 "<div class=\"message\">{}</div>\n",
437 html_escape(&f.message)
438 ));
439 card.push_str(&format!(
440 "<div class=\"focus\">focus: <code>{}</code></div>\n",
441 html_escape(&f.focus)
442 ));
443 if let Some(q) = &f.suggested_query {
444 card.push_str(&format!(
445 "<div class=\"query\">query: <code>{}</code></div>\n",
446 html_escape(q)
447 ));
448 }
449 if let Some(r) = &f.remedy {
450 card.push_str(&format!(
451 "<div class=\"remedy\">remedy: {}</div>\n",
452 html_escape(r)
453 ));
454 }
455 card.push_str("</div>\n");
456 card
457}
458
459fn render_intent(intent: &IntentReport) -> String {
460 let conform = if intent.conforms {

Callers 1

render_htmlFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected