MCPcopy
hub / github.com/github/awesome-copilot / assessmentTab

Function assessmentTab

extensions/java-modernization-studio/renderer.mjs:324–364  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

322 }
323
324 function assessmentTab(s) {
325 const rep = s.report;
326 if (!rep || !(rep.findings && rep.findings.length)) {
327 return emptyState(
328 "No assessment yet",
329 "Run an assessment to scan this repo for its Java runtime, dependencies, vulnerabilities, and Azure cloud-readiness gaps. Findings land here as a prioritized, clickable checklist — nothing in your code changes.",
330 btn("Run assessment", "start_assessment", {}, { primary: true })
331 );
332 }
333 const by = sevCounts(rep.findings);
334 let html = '<div class="card"><h2>Assessment results';
335 if (rep.generatedAt) html += ' <span class="muted" style="font-weight:400">' + esc(fmtDate(rep.generatedAt)) + "</span>";
336 html += '<span class="spacer"></span>' + btn("Re-run", "start_assessment") + "</h2>";
337 if (rep.headline) html += '<p style="margin:0 0 6px;font-weight:600">' + esc(rep.headline) + "</p>";
338 if (rep.summary) html += '<p class="muted" style="margin:0 0 10px">' + esc(rep.summary) + "</p>";
339 if (rep.stack) {
340 const st = rep.stack;
341 html += '<div class="grid" style="margin-bottom:10px">' +
342 (st.buildTool ? kv("Build", esc(st.buildTool)) : "") +
343 (st.java ? kv("Java", esc(st.java)) : "") +
344 (st.framework ? kv("Framework", esc(st.framework)) : "") +
345 (st.database ? kv("Database", esc(st.database)) : "") +
346 (st.container ? kv("Container", esc(st.container)) : "") +
347 "</div>";
348 }
349 html += '<div class="sevrow">' + sevChip("P0", by.P0) + sevChip("P1", by.P1) + sevChip("P2", by.P2) + sevChip("P3", by.P3) + "</div></div>";
350
351 ["P0", "P1", "P2", "P3"].forEach((sev) => {
352 const items = rep.findings.filter((x) => x.severity === sev);
353 if (!items.length) return;
354 html += '<div class="cat">' + esc(sevName(sev)) + "</div>";
355 items.forEach((x) => (html += findingCard(x, s.ordering)));
356 });
357
358 if (rep.strengths && rep.strengths.length) {
359 html += '<div class="card"><h2>Already done well <span class="badge b-green">' + rep.strengths.length + "</span></h2><ul class=\"steps\">";
360 rep.strengths.forEach((x) => (html += '<li><span class="dot done"></span><span>' + esc(x) + "</span></li>"));
361 html += "</ul></div>";
362 }
363 return html;
364 }
365
366 // ---- assessment helpers --------------------------------------------------
367

Callers

nothing calls this directly

Calls 9

emptyStateFunction · 0.85
btnFunction · 0.85
sevCountsFunction · 0.85
escFunction · 0.85
fmtDateFunction · 0.85
kvFunction · 0.85
sevChipFunction · 0.85
sevNameFunction · 0.85
findingCardFunction · 0.85

Tested by

no test coverage detected