tutanus 0.12.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +1 -1
  2. package/dist/analysts/azure-pipelines/reports/generator-report-azure.d.ts.map +1 -1
  3. package/dist/analysts/azure-pipelines/reports/generator-report-azure.js.map +1 -1
  4. package/dist/analysts/circleci/reports/generator-report-circleci.d.ts.map +1 -1
  5. package/dist/analysts/circleci/reports/generator-report-circleci.js.map +1 -1
  6. package/dist/analysts/github-actions/reports/generator-report-github-actions.d.ts.map +1 -1
  7. package/dist/analysts/github-actions/reports/generator-report-github-actions.js +1 -1
  8. package/dist/analysts/github-actions/reports/generator-report-github-actions.js.map +1 -1
  9. package/dist/analysts/gitlab-ci/reports/generator-report-gitlab-ci.d.ts.map +1 -1
  10. package/dist/analysts/gitlab-ci/reports/generator-report-gitlab-ci.js.map +1 -1
  11. package/dist/analysts/jenkins/reports/generator-report-jenkins.d.ts.map +1 -1
  12. package/dist/analysts/jenkins/reports/generator-report-jenkins.js.map +1 -1
  13. package/dist/app/github/dashboard/routes.js +1 -1
  14. package/dist/app/github/dashboard/routes.js.map +1 -1
  15. package/dist/app/github/push-analysis/push-report.d.ts.map +1 -1
  16. package/dist/app/github/push-analysis/push-report.js.map +1 -1
  17. package/dist/core/messages/pt/analysts/detector-bugs-ml-messages.d.ts +1 -1
  18. package/dist/core/messages/pt/analysts/detector-bugs-ml-messages.d.ts.map +1 -1
  19. package/dist/core/messages/pt/analysts/detector-bugs-ml-messages.js +1 -1
  20. package/dist/core/messages/pt/analysts/detector-bugs-ml-messages.js.map +1 -1
  21. package/dist/guardian/gpg.js +1 -1
  22. package/dist/guardian/gpg.js.map +1 -1
  23. package/dist/shared/memory.d.ts +1 -1
  24. package/dist/shared/memory.d.ts.map +1 -1
  25. package/dist/shared/memory.js.map +1 -1
  26. package/dist/types/index.d.ts +2 -2
  27. package/dist/types/index.d.ts.map +1 -1
  28. package/dist/types/index.js.map +1 -1
  29. package/dist/types/reports/fragmentation.d.ts +2 -0
  30. package/dist/types/reports/fragmentation.d.ts.map +1 -1
  31. package/dist/types/reports/fragmentation.js.map +1 -1
  32. package/package.json +57 -57
  33. package/out/404/index.html +0 -1
  34. package/out/404.html +0 -1
  35. package/out/__next.__PAGE__.txt +0 -9
  36. package/out/__next._full.txt +0 -18
  37. package/out/__next._head.txt +0 -5
  38. package/out/__next._index.txt +0 -6
  39. package/out/__next._tree.txt +0 -3
  40. package/out/_next/static/Dy2DC2TpDR2_OQeYOGFyo/_buildManifest.js +0 -11
  41. package/out/_next/static/Dy2DC2TpDR2_OQeYOGFyo/_clientMiddlewareManifest.js +0 -1
  42. package/out/_next/static/Dy2DC2TpDR2_OQeYOGFyo/_ssgManifest.js +0 -1
  43. package/out/_next/static/chunks/01xlw8hd842-c.js +0 -1
  44. package/out/_next/static/chunks/03~yq9q893hmn.js +0 -1
  45. package/out/_next/static/chunks/07lhk_q6pmm3r.js +0 -1
  46. package/out/_next/static/chunks/0bt5g~o.csanc.js +0 -2
  47. package/out/_next/static/chunks/0d3shmwh5_nmn.js +0 -1
  48. package/out/_next/static/chunks/0dgq26a5_oy.a.js +0 -4
  49. package/out/_next/static/chunks/0ht900cau6_ur.js +0 -31
  50. package/out/_next/static/chunks/0ka051yepewro.js +0 -1
  51. package/out/_next/static/chunks/0oxf3p2ntxm1..js +0 -11
  52. package/out/_next/static/chunks/0ut5u8b4o16.c.js +0 -1
  53. package/out/_next/static/chunks/14jxvso77~-n_.css +0 -1
  54. package/out/_next/static/chunks/turbopack-0lfyi3tcd5~9z.js +0 -1
  55. package/out/_next/static/media/icon-1.002u9bkvzfbrc.png +0 -0
  56. package/out/_not-found/__next._full.txt +0 -16
  57. package/out/_not-found/__next._head.txt +0 -5
  58. package/out/_not-found/__next._index.txt +0 -6
  59. package/out/_not-found/__next._not-found.__PAGE__.txt +0 -5
  60. package/out/_not-found/__next._not-found.txt +0 -5
  61. package/out/_not-found/__next._tree.txt +0 -3
  62. package/out/_not-found/index.html +0 -1
  63. package/out/_not-found/index.txt +0 -16
  64. package/out/changelog/__next._full.txt +0 -573
  65. package/out/changelog/__next._head.txt +0 -5
  66. package/out/changelog/__next._index.txt +0 -6
  67. package/out/changelog/__next._tree.txt +0 -4
  68. package/out/changelog/__next.changelog.__PAGE__.txt +0 -560
  69. package/out/changelog/__next.changelog.txt +0 -5
  70. package/out/changelog/index.html +0 -550
  71. package/out/changelog/index.txt +0 -573
  72. package/out/github/dashboard/__next._full.txt +0 -20
  73. package/out/github/dashboard/__next._head.txt +0 -5
  74. package/out/github/dashboard/__next._index.txt +0 -6
  75. package/out/github/dashboard/__next._tree.txt +0 -3
  76. package/out/github/dashboard/__next.github.dashboard.__PAGE__.txt +0 -9
  77. package/out/github/dashboard/__next.github.dashboard.txt +0 -4
  78. package/out/github/dashboard/__next.github.txt +0 -5
  79. package/out/github/dashboard/index.html +0 -1
  80. package/out/github/dashboard/index.txt +0 -20
  81. package/out/index.html +0 -1
  82. package/out/index.txt +0 -18
  83. package/out/privacy-policy/__next._full.txt +0 -38
  84. package/out/privacy-policy/__next._head.txt +0 -5
  85. package/out/privacy-policy/__next._index.txt +0 -6
  86. package/out/privacy-policy/__next._tree.txt +0 -4
  87. package/out/privacy-policy/__next.privacy-policy.__PAGE__.txt +0 -23
  88. package/out/privacy-policy/__next.privacy-policy.txt +0 -5
  89. package/out/privacy-policy/index.html +0 -1
  90. package/out/privacy-policy/index.txt +0 -38
  91. package/out/terms-of-use/__next._full.txt +0 -37
  92. package/out/terms-of-use/__next._head.txt +0 -5
  93. package/out/terms-of-use/__next._index.txt +0 -6
  94. package/out/terms-of-use/__next._tree.txt +0 -4
  95. package/out/terms-of-use/__next.terms-of-use.__PAGE__.txt +0 -18
  96. package/out/terms-of-use/__next.terms-of-use.txt +0 -5
  97. package/out/terms-of-use/index.html +0 -1
  98. package/out/terms-of-use/index.txt +0 -37
package/README.md CHANGED
@@ -49,7 +49,7 @@ Proveniência e Autoria: Este documento integra o projeto Tutanus (licença MIT-
49
49
 
50
50
  ```bash
51
51
  # 1. Instalar
52
- npm install -g tutanus-cli
52
+ npm install -g tutanus
53
53
 
54
54
  # 2. Analisar seu projeto
55
55
  cd meu-projeto
@@ -1 +1 @@
1
- {"version":3,"file":"generator-report-azure.d.ts","sourceRoot":"","sources":["../../../../src/analysts/azure-pipelines/reports/generator-report-azure.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAEvG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAOrE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CA8ClI;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAgEnG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAMpE;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAczG;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,mBAAmB,CAsB/M"}
1
+ {"version":3,"file":"generator-report-azure.d.ts","sourceRoot":"","sources":["../../../../src/analysts/azure-pipelines/reports/generator-report-azure.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAEvG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAOrE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CA8ClI;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAgEnG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAMpE;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAczG;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,mBAAmB,CAsB/M"}
@@ -1 +1 @@
1
- {"version":3,"file":"generator-report-azure.js","sourceRoot":"","sources":["../../../../src/analysts/azure-pipelines/reports/generator-report-azure.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,E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C,CAAC,EAAE,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7J,OAAO;QACL,eAAe;QACf,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,cAAc,EAAE,QAAQ,CAAC,MAAM,IAAI,CAAC;QACpC,UAAU;QACV,WAAW;QACX,mBAAmB,EAAE,MAAM;QAC3B,aAAa,EAAE,UAAU;QACzB,SAAS,EAAE,QAAQ;QACnB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { messages } from '@core/messages';\nimport type { Ocorrencia } from '@';\n\nimport type { DadosRelatorioAzure, OpcoesRelatorio } from '../../../types/analysts/azure-pipelines.js';\n\nexport function gerarRelatorioJson(dados: DadosRelatorioAzure): string {\n return JSON.stringify({\n $schema: 'tutanus://schemas/azure-pipelines-report/v1',\n geradoEm: new Date().toISOString(),\n versao: '0.7.0',\n ...dados\n }, null, 2);\n}\n\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioAzure, opcoes?: { titulo?: string; incluirDetalhes?: boolean }): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - Azure Pipelines';\n linhas.push(`# ${titulo}`);\n linhas.push('');\n linhas.push(`**Repositório:** ${dados.nomeRepositorio}`);\n linhas.push(`**Data:** ${dados.dataAnalise}`);\n linhas.push(`**Tempo de Análise:** ${dados.tempoAnaliseMs}ms`);\n linhas.push('');\n linhas.push('## Resumo');\n linhas.push('');\n linhas.push(`| Métrica | Valor |`);\n linhas.push(`|---|---|`);\n linhas.push(`| Score Geral | ${dados.scoreGeral}/100 |`);\n linhas.push(`| Total de Pipelines | ${dados.totalPipelines} |`);\n linhas.push(`| Total de Ocorrências | ${dados.ocorrencias.length} |`);\n linhas.push('');\n linhas.push('## Severidade');\n linhas.push('');\n linhas.push(`| Severidade | Quantidade |`);\n linhas.push(`|---|---|`);\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) {\n linhas.push(`| ${sev} | ${count} |`);\n }\n linhas.push('');\n linhas.push('## Pipelines Analisados');\n linhas.push('');\n linhas.push(`| Pipeline | Score | Ocorrências |`);\n linhas.push(`|---|---|---|`);\n for (const pipe of dados.pipelines) {\n linhas.push(`| ${pipe.nome} | ${pipe.score}/100 | ${pipe.ocorrencias} |`);\n }\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('');\n linhas.push('## Ocorrências Detalhadas');\n linhas.push('');\n linhas.push(`| Arquivo | Linha | Severidade | Tipo | Mensagem |`);\n linhas.push(`|---|---|---|---|---|`);\n for (const ocorrencia of dados.ocorrencias.slice(0, 200)) {\n const msg = (ocorrencia.mensagem || '').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ');\n linhas.push(`| \\`${ocorrencia.relPath}\\` | ${ocorrencia.linha || '-'} | ${ocorrencia.nivel || 'info'} | ${ocorrencia.tipo || ''} | ${msg} |`);\n }\n }\n linhas.push('');\n linhas.push(`*Gerado por Tutanus v0.7.0*`);\n return linhas.join('\\n');\n}\n\nexport function gerarRelatorioHtml(dados: DadosRelatorioAzure, opcoes?: { titulo?: string }): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - Azure Pipelines';\n const scoreColor = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${titulo}</title>\n <style>\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0d1117; color: #c9d1d9; padding: 2rem; }\n .container { max-width: 1200px; margin: 0 auto; }\n h1 { color: #0078d7; margin-bottom: 0.5rem; }\n h2 { color: #0078d7; margin: 2rem 0 1rem; border-bottom: 1px solid #21262d; padding-bottom: 0.5rem; }\n .meta { color: #8b949e; margin-bottom: 2rem; }\n .score-card { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 2rem; text-align: center; margin-bottom: 2rem; }\n .score-value { font-size: 4rem; font-weight: bold; color: ${scoreColor}; }\n .score-label { color: #8b949e; font-size: 1.2rem; }\n table { width: 100%; border-collapse: collapse; margin: 1rem 0; }\n th { background: #161b22; color: #0078d7; padding: 0.75rem 1rem; text-align: left; border-bottom: 2px solid #30363d; }\n td { padding: 0.75rem 1rem; border-bottom: 1px solid #21262d; }\n tr:hover { background: #161b22; }\n .badge { padding: 0.25rem 0.5rem; border-radius: 12px; font-size: 0.85rem; font-weight: 600; }\n .badge-erro { background: rgba(239,68,68,0.2); color: #ef4444; }\n .badge-aviso { background: rgba(245,158,11,0.2); color: #f59e0b; }\n .badge-info { background: rgba(56,139,253,0.2); color: #388bfd; }\n .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }\n .summary-item { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 1rem; }\n .summary-item .label { color: #8b949e; font-size: 0.85rem; }\n .summary-item .value { font-size: 1.5rem; font-weight: bold; color: #0078d7; }\n .footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #21262d; color: #8b949e; font-size: 0.85rem; text-align: center; }\n code { background: #161b22; padding: 0.2rem 0.4rem; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <h1>${titulo}</h1>\n <div class=\"meta\">\n <p><strong>Repositório:</strong> ${dados.nomeRepositorio} | <strong>Data:</strong> ${dados.dataAnalise} | <strong>Tempo:</strong> ${dados.tempoAnaliseMs}ms</p>\n </div>\n <div class=\"score-card\">\n <div class=\"score-value\">${dados.scoreGeral}</div>\n <div class=\"score-label\">Score Geral (0-100)</div>\n </div>\n <h2>Resumo</h2>\n <div class=\"summary-grid\">\n <div class=\"summary-item\"><div class=\"label\">Pipelines</div><div class=\"value\">${dados.totalPipelines}</div></div>\n <div class=\"summary-item\"><div class=\"label\">Ocorrências</div><div class=\"value\">${dados.ocorrencias.length}</div></div>\n ${Object.entries(dados.resumoPorSeveridade).map(([sev, count]) => `<div class=\"summary-item\"><div class=\"label\">${sev}</div><div class=\"value\">${count}</div></div>`).join('')}\n </div>\n <h2>Pipelines</h2>\n <table><thead><tr><th>Pipeline</th><th>Score</th><th>Ocorrências</th></tr></thead>\n <tbody>${dados.pipelines.map(p => `<tr><td>${p.nome}</td><td style=\"color:${p.score >= 80 ? '#10b981' : p.score >= 50 ? '#f59e0b' : '#ef4444'};font-weight:bold\">${p.score}/100</td><td>${p.ocorrencias}</td></tr>`).join('')}</tbody>\n </table>\n <h2>Ocorrências</h2>\n <table><thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead>\n <tbody>${dados.ocorrencias.slice(0, 200).map(o => `<tr><td><code>${o.relPath}</code></td><td>${o.linha || '-'}</td><td><span class=\"badge badge-${o.nivel || 'info'}\">${o.nivel || 'info'}</span></td><td>${o.tipo || ''}</td><td>${o.mensagem || ''}</td></tr>`).join('')}</tbody>\n </table>\n ${dados.ocorrencias.length > 200 ? `<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length}</p>` : ''}\n <div class=\"footer\"><p>Gerado por Tutanus v0.7.0</p></div>\n </div>\n</body>\n</html>`;\n}\n\nexport function gerarRelatorioCsv(dados: DadosRelatorioAzure): string {\n const linhas: string[] = ['Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao'];\n for (const o of dados.ocorrencias) {\n linhas.push([o.relPath, String(o.linha || ''), o.nivel || 'info', o.tipo || '', (o.mensagem || '').replace(/\"/g, '\"\"'), (o.sugestao || '').replace(/\"/g, '\"\"')].map(c => `\"${c}\"`).join(','));\n }\n return linhas.join('\\n');\n}\n\nexport async function gerarRelatorio(dados: DadosRelatorioAzure, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json': return gerarRelatorioJson(dados);\n case 'markdown': return gerarRelatorioMarkdown(dados, { titulo: opcoes.titulo, incluirDetalhes: opcoes.incluirDetalhes });\n case 'html': return gerarRelatorioHtml(dados, { titulo: opcoes.titulo });\n case 'csv': return gerarRelatorioCsv(dados);\n default: throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n const dir = path.dirname(opcoes.output);\n fs.mkdirSync(dir, { recursive: true });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\n\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, pipelines?: Array<{ nome: string; score: number; ocorrencias: number }>): DadosRelatorioAzure {\n const pipeList = pipelines || [];\n const resumo: Record<string, number> = {};\n const resumoTipo: Record<string, number> = {};\n for (const o of ocorrencias) {\n const nivel = String(o.nivel || 'info');\n resumo[nivel] = (resumo[nivel] || 0) + 1;\n const tipo = o.tipo || 'desconhecido';\n resumoTipo[tipo] = (resumoTipo[tipo] || 0) + 1;\n }\n const scoreGeral = pipeList.length > 0 ? Math.round(pipeList.reduce((s, p) => s + p.score, 0) / pipeList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return {\n nomeRepositorio,\n dataAnalise: new Date().toISOString(),\n totalPipelines: pipeList.length || 1,\n scoreGeral,\n ocorrencias,\n resumoPorSeveridade: resumo,\n resumoPorTipo: resumoTipo,\n pipelines: pipeList,\n tempoAnaliseMs\n };\n}\n"]}
1
+ {"version":3,"file":"generator-report-azure.js","sourceRoot":"","sources":["../../../../src/analysts/azure-pipelines/reports/generator-report-azure.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM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AAE,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7J,OAAO;QACL,eAAe;QACf,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,cAAc,EAAE,QAAQ,CAAC,MAAM,IAAI,CAAC;QACpC,UAAU;QACV,WAAW;QACX,mBAAmB,EAAE,MAAM;QAC3B,aAAa,EAAE,UAAU;QACzB,SAAS,EAAE,QAAQ;QACnB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { messages } from '@core/messages';\n\nimport type { Ocorrencia } from '@';\n\nimport type { DadosRelatorioAzure, OpcoesRelatorio } from '../../../types/analysts/azure-pipelines.js';\n\nexport function gerarRelatorioJson(dados: DadosRelatorioAzure): string {\n return JSON.stringify({\n $schema: 'tutanus://schemas/azure-pipelines-report/v1',\n geradoEm: new Date().toISOString(),\n versao: '0.7.0',\n ...dados\n }, null, 2);\n}\n\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioAzure, opcoes?: { titulo?: string; incluirDetalhes?: boolean }): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - Azure Pipelines';\n linhas.push(`# ${titulo}`);\n linhas.push('');\n linhas.push(`**Repositório:** ${dados.nomeRepositorio}`);\n linhas.push(`**Data:** ${dados.dataAnalise}`);\n linhas.push(`**Tempo de Análise:** ${dados.tempoAnaliseMs}ms`);\n linhas.push('');\n linhas.push('## Resumo');\n linhas.push('');\n linhas.push(`| Métrica | Valor |`);\n linhas.push(`|---|---|`);\n linhas.push(`| Score Geral | ${dados.scoreGeral}/100 |`);\n linhas.push(`| Total de Pipelines | ${dados.totalPipelines} |`);\n linhas.push(`| Total de Ocorrências | ${dados.ocorrencias.length} |`);\n linhas.push('');\n linhas.push('## Severidade');\n linhas.push('');\n linhas.push(`| Severidade | Quantidade |`);\n linhas.push(`|---|---|`);\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) {\n linhas.push(`| ${sev} | ${count} |`);\n }\n linhas.push('');\n linhas.push('## Pipelines Analisados');\n linhas.push('');\n linhas.push(`| Pipeline | Score | Ocorrências |`);\n linhas.push(`|---|---|---|`);\n for (const pipe of dados.pipelines) {\n linhas.push(`| ${pipe.nome} | ${pipe.score}/100 | ${pipe.ocorrencias} |`);\n }\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('');\n linhas.push('## Ocorrências Detalhadas');\n linhas.push('');\n linhas.push(`| Arquivo | Linha | Severidade | Tipo | Mensagem |`);\n linhas.push(`|---|---|---|---|---|`);\n for (const ocorrencia of dados.ocorrencias.slice(0, 200)) {\n const msg = (ocorrencia.mensagem || '').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ');\n linhas.push(`| \\`${ocorrencia.relPath}\\` | ${ocorrencia.linha || '-'} | ${ocorrencia.nivel || 'info'} | ${ocorrencia.tipo || ''} | ${msg} |`);\n }\n }\n linhas.push('');\n linhas.push(`*Gerado por Tutanus v0.7.0*`);\n return linhas.join('\\n');\n}\n\nexport function gerarRelatorioHtml(dados: DadosRelatorioAzure, opcoes?: { titulo?: string }): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - Azure Pipelines';\n const scoreColor = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${titulo}</title>\n <style>\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0d1117; color: #c9d1d9; padding: 2rem; }\n .container { max-width: 1200px; margin: 0 auto; }\n h1 { color: #0078d7; margin-bottom: 0.5rem; }\n h2 { color: #0078d7; margin: 2rem 0 1rem; border-bottom: 1px solid #21262d; padding-bottom: 0.5rem; }\n .meta { color: #8b949e; margin-bottom: 2rem; }\n .score-card { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 2rem; text-align: center; margin-bottom: 2rem; }\n .score-value { font-size: 4rem; font-weight: bold; color: ${scoreColor}; }\n .score-label { color: #8b949e; font-size: 1.2rem; }\n table { width: 100%; border-collapse: collapse; margin: 1rem 0; }\n th { background: #161b22; color: #0078d7; padding: 0.75rem 1rem; text-align: left; border-bottom: 2px solid #30363d; }\n td { padding: 0.75rem 1rem; border-bottom: 1px solid #21262d; }\n tr:hover { background: #161b22; }\n .badge { padding: 0.25rem 0.5rem; border-radius: 12px; font-size: 0.85rem; font-weight: 600; }\n .badge-erro { background: rgba(239,68,68,0.2); color: #ef4444; }\n .badge-aviso { background: rgba(245,158,11,0.2); color: #f59e0b; }\n .badge-info { background: rgba(56,139,253,0.2); color: #388bfd; }\n .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }\n .summary-item { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 1rem; }\n .summary-item .label { color: #8b949e; font-size: 0.85rem; }\n .summary-item .value { font-size: 1.5rem; font-weight: bold; color: #0078d7; }\n .footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #21262d; color: #8b949e; font-size: 0.85rem; text-align: center; }\n code { background: #161b22; padding: 0.2rem 0.4rem; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <h1>${titulo}</h1>\n <div class=\"meta\">\n <p><strong>Repositório:</strong> ${dados.nomeRepositorio} | <strong>Data:</strong> ${dados.dataAnalise} | <strong>Tempo:</strong> ${dados.tempoAnaliseMs}ms</p>\n </div>\n <div class=\"score-card\">\n <div class=\"score-value\">${dados.scoreGeral}</div>\n <div class=\"score-label\">Score Geral (0-100)</div>\n </div>\n <h2>Resumo</h2>\n <div class=\"summary-grid\">\n <div class=\"summary-item\"><div class=\"label\">Pipelines</div><div class=\"value\">${dados.totalPipelines}</div></div>\n <div class=\"summary-item\"><div class=\"label\">Ocorrências</div><div class=\"value\">${dados.ocorrencias.length}</div></div>\n ${Object.entries(dados.resumoPorSeveridade).map(([sev, count]) => `<div class=\"summary-item\"><div class=\"label\">${sev}</div><div class=\"value\">${count}</div></div>`).join('')}\n </div>\n <h2>Pipelines</h2>\n <table><thead><tr><th>Pipeline</th><th>Score</th><th>Ocorrências</th></tr></thead>\n <tbody>${dados.pipelines.map(p => `<tr><td>${p.nome}</td><td style=\"color:${p.score >= 80 ? '#10b981' : p.score >= 50 ? '#f59e0b' : '#ef4444'};font-weight:bold\">${p.score}/100</td><td>${p.ocorrencias}</td></tr>`).join('')}</tbody>\n </table>\n <h2>Ocorrências</h2>\n <table><thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead>\n <tbody>${dados.ocorrencias.slice(0, 200).map(o => `<tr><td><code>${o.relPath}</code></td><td>${o.linha || '-'}</td><td><span class=\"badge badge-${o.nivel || 'info'}\">${o.nivel || 'info'}</span></td><td>${o.tipo || ''}</td><td>${o.mensagem || ''}</td></tr>`).join('')}</tbody>\n </table>\n ${dados.ocorrencias.length > 200 ? `<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length}</p>` : ''}\n <div class=\"footer\"><p>Gerado por Tutanus v0.7.0</p></div>\n </div>\n</body>\n</html>`;\n}\n\nexport function gerarRelatorioCsv(dados: DadosRelatorioAzure): string {\n const linhas: string[] = ['Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao'];\n for (const o of dados.ocorrencias) {\n linhas.push([o.relPath, String(o.linha || ''), o.nivel || 'info', o.tipo || '', (o.mensagem || '').replace(/\"/g, '\"\"'), (o.sugestao || '').replace(/\"/g, '\"\"')].map(c => `\"${c}\"`).join(','));\n }\n return linhas.join('\\n');\n}\n\nexport async function gerarRelatorio(dados: DadosRelatorioAzure, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json': return gerarRelatorioJson(dados);\n case 'markdown': return gerarRelatorioMarkdown(dados, { titulo: opcoes.titulo, incluirDetalhes: opcoes.incluirDetalhes });\n case 'html': return gerarRelatorioHtml(dados, { titulo: opcoes.titulo });\n case 'csv': return gerarRelatorioCsv(dados);\n default: throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n const dir = path.dirname(opcoes.output);\n fs.mkdirSync(dir, { recursive: true });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\n\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, pipelines?: Array<{ nome: string; score: number; ocorrencias: number }>): DadosRelatorioAzure {\n const pipeList = pipelines || [];\n const resumo: Record<string, number> = {};\n const resumoTipo: Record<string, number> = {};\n for (const o of ocorrencias) {\n const nivel = String(o.nivel || 'info');\n resumo[nivel] = (resumo[nivel] || 0) + 1;\n const tipo = o.tipo || 'desconhecido';\n resumoTipo[tipo] = (resumoTipo[tipo] || 0) + 1;\n }\n const scoreGeral = pipeList.length > 0 ? Math.round(pipeList.reduce((s, p) => s + p.score, 0) / pipeList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return {\n nomeRepositorio,\n dataAnalise: new Date().toISOString(),\n totalPipelines: pipeList.length || 1,\n scoreGeral,\n ocorrencias,\n resumoPorSeveridade: resumo,\n resumoPorTipo: resumoTipo,\n pipelines: pipeList,\n tempoAnaliseMs\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"generator-report-circleci.d.ts","sourceRoot":"","sources":["../../../../src/analysts/circleci/reports/generator-report-circleci.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEnG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAExE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAiBrI;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAItG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAIvE;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAa5G;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,sBAAsB,CAWhN"}
1
+ {"version":3,"file":"generator-report-circleci.d.ts","sourceRoot":"","sources":["../../../../src/analysts/circleci/reports/generator-report-circleci.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEnG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAExE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAiBrI;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAItG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAIvE;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAa5G;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,sBAAsB,CAWhN"}
@@ -1 +1 @@
1
- {"version":3,"file":"generator-report-circleci.js","sourceRoot":"","sources":["../../../../src/analysts/circleci/reports/generator-report-circleci.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK1C,MAAM,UAAU,kBAAkB,CAAC,KAA6B;IAC9D,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,sCAAsC,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACrJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAA6B,EAAE,MAAuD;IAC3H,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,MAAM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AU,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AACtN,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { messages } from '@core/messages';\nimport type { Ocorrencia } from '@';\n\nimport type { DadosRelatorioCircleCI, OpcoesRelatorio } from '../../../types/analysts/circleci.js';\n\nexport function gerarRelatorioJson(dados: DadosRelatorioCircleCI): string {\n return JSON.stringify({ $schema: 'tutanus://schemas/circleci-report/v1', geradoEm: new Date().toISOString(), versao: '0.7.0', ...dados }, null, 2);\n}\n\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioCircleCI, opcoes?: { titulo?: string; incluirDetalhes?: boolean }): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - CircleCI';\n linhas.push(`# ${titulo}`, '', `**Repositório:** ${dados.nomeRepositorio}`, `**Data:** ${dados.dataAnalise}`, `**Tempo:** ${dados.tempoAnaliseMs}ms`, '');\n linhas.push('## Resumo', '', '| Métrica | Valor |', '|---|---|', `| Score Geral | ${dados.scoreGeral}/100 |`, `| Total de Configs | ${dados.totalConfigs} |`, `| Total de Ocorrências | ${dados.ocorrencias.length} |`, '');\n linhas.push('## Severidade', '', '| Severidade | Quantidade |', '|---|---|');\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) linhas.push(`| ${sev} | ${count} |`);\n linhas.push('', '## Configs Analisadas', '', '| Config | Score | Ocorrências |', '|---|---|---|');\n for (const c of dados.configs) linhas.push(`| ${c.nome} | ${c.score}/100 | ${c.ocorrencias} |`);\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('', '## Ocorrências Detalhadas', '', '| Arquivo | Linha | Severidade | Tipo | Mensagem |', '|---|---|---|---|---|');\n for (const o of dados.ocorrencias.slice(0, 200)) {\n linhas.push(`| \\`${o.relPath}\\` | ${o.linha || '-'} | ${o.nivel || 'info'} | ${o.tipo || ''} | ${(o.mensagem || '').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ')} |`);\n }\n }\n linhas.push('', '*Gerado por Tutanus v0.7.0*');\n return linhas.join('\\n');\n}\n\nexport function gerarRelatorioHtml(dados: DadosRelatorioCircleCI, opcoes?: { titulo?: string }): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - CircleCI';\n const sc = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html><html lang=\"pt-BR\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"><title>${titulo}</title><style>*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0d1117;color:#c9d1d9;padding:2rem}.container{max-width:1200px;margin:0 auto}h1{color:#343434;margin-bottom:.5rem}h2{color:#343434;margin:2rem 0 1rem;border-bottom:1px solid #21262d;padding-bottom:.5rem}.meta{color:#8b949e;margin-bottom:2rem}.score-card{background:#161b22;border:1px solid #30363d;border-radius:12px;padding:2rem;text-align:center;margin-bottom:2rem}.score-value{font-size:4rem;font-weight:bold;color:${sc}}.score-label{color:#8b949e;font-size:1.2rem}table{width:100%;border-collapse:collapse;margin:1rem 0}th{background:#161b22;color:#343434;padding:.75rem 1rem;text-align:left;border-bottom:2px solid #30363d}td{padding:.75rem 1rem;border-bottom:1px solid #21262d}tr:hover{background:#161b22}.badge{padding:.25rem .5rem;border-radius:12px;font-size:.85rem;font-weight:600}.badge-erro{background:rgba(239,68,68,.2);color:#ef4444}.badge-aviso{background:rgba(245,158,11,.2);color:#f59e0b}.badge-info{background:rgba(56,139,253,.2);color:#388bfd}.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin:1rem 0}.summary-item{background:#161b22;border:1px solid #30363d;border-radius:8px;padding:1rem}.summary-item .label{color:#8b949e;font-size:.85rem}.summary-item .value{font-size:1.5rem;font-weight:bold;color:#343434}.footer{margin-top:3rem;padding-top:1rem;border-top:1px solid #21262d;color:#8b949e;font-size:.85rem;text-align:center}code{background:#161b22;padding:.2rem .4rem;border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:.9em}</style></head><body><div class=\"container\"><h1>${titulo}</h1><div class=\"meta\"><p><strong>Repositório:</strong> ${dados.nomeRepositorio} | <strong>Data:</strong> ${dados.dataAnalise} | <strong>Tempo:</strong> ${dados.tempoAnaliseMs}ms</p></div><div class=\"score-card\"><div class=\"score-value\">${dados.scoreGeral}</div><div class=\"score-label\">Score Geral (0-100)</div></div><h2>Resumo</h2><div class=\"summary-grid\"><div class=\"summary-item\"><div class=\"label\">Configs</div><div class=\"value\">${dados.totalConfigs}</div></div><div class=\"summary-item\"><div class=\"label\">Ocorrências</div><div class=\"value\">${dados.ocorrencias.length}</div></div>${Object.entries(dados.resumoPorSeveridade).map(([s, c]) => `<div class=\"summary-item\"><div class=\"label\">${s}</div><div class=\"value\">${c}</div></div>`).join('')}</div><h2>Configs</h2><table><thead><tr><th>Config</th><th>Score</th><th>Ocorrências</th></tr></thead><tbody>${dados.configs.map(p => `<tr><td>${p.nome}</td><td style=\"color:${p.score>=80?'#10b981':p.score>=50?'#f59e0b':'#ef4444'};font-weight:bold\">${p.score}/100</td><td>${p.ocorrencias}</td></tr>`).join('')}</tbody></table><h2>Ocorrências</h2><table><thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead><tbody>${dados.ocorrencias.slice(0,200).map(o => `<tr><td><code>${o.relPath}</code></td><td>${o.linha||'-'}</td><td><span class=\"badge badge-${o.nivel||'info'}\">${o.nivel||'info'}</span></td><td>${o.tipo||''}</td><td>${o.mensagem||''}</td></tr>`).join('')}</tbody></table>${dados.ocorrencias.length>200?`<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length}</p>`:''}<div class=\"footer\"><p>Gerado por Tutanus v0.7.0</p></div></div></body></html>`;\n}\n\nexport function gerarRelatorioCsv(dados: DadosRelatorioCircleCI): string {\n const linhas = ['Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao'];\n for (const o of dados.ocorrencias) linhas.push([o.relPath, String(o.linha || ''), o.nivel || 'info', o.tipo || '', `\"${(o.mensagem||'').replace(/\"/g,'\"\"')}\"`, `\"${(o.sugestao||'').replace(/\"/g,'\"\"')}\"`].join(','));\n return linhas.join('\\n');\n}\n\nexport async function gerarRelatorio(dados: DadosRelatorioCircleCI, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json': return gerarRelatorioJson(dados);\n case 'markdown': return gerarRelatorioMarkdown(dados, { titulo: opcoes.titulo, incluirDetalhes: opcoes.incluirDetalhes });\n case 'html': return gerarRelatorioHtml(dados, { titulo: opcoes.titulo });\n case 'csv': return gerarRelatorioCsv(dados);\n default: throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n fs.mkdirSync(path.dirname(opcoes.output), { recursive: true });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\n\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, configs?: Array<{ nome: string; score: number; ocorrencias: number }>): DadosRelatorioCircleCI {\n const cList = configs || [];\n const resumo: Record<string, number> = {};\n const resumoTipo: Record<string, number> = {};\n for (const o of ocorrencias) {\n const nivel = String(o.nivel || 'info');\n resumo[nivel] = (resumo[nivel] || 0) + 1;\n resumoTipo[o.tipo || 'desconhecido'] = (resumoTipo[o.tipo || 'desconhecido'] || 0) + 1;\n }\n const scoreGeral = cList.length > 0 ? Math.round(cList.reduce((s, c) => s + c.score, 0) / cList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return { nomeRepositorio, dataAnalise: new Date().toISOString(), totalConfigs: cList.length || 1, scoreGeral, ocorrencias, resumoPorSeveridade: resumo, resumoPorTipo: resumoTipo, configs: cList, tempoAnaliseMs };\n}\n"]}
1
+ {"version":3,"file":"generator-report-circleci.js","sourceRoot":"","sources":["../../../../src/analysts/circleci/reports/generator-report-circleci.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,MAAM,UAAU,kBAAkB,CAAC,KAA6B;IAC9D,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,sCAAsC,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACrJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAA6B,EAAE,MAAuD;IAC3H,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,IAAI,iCAAiC,CAAC;IACnE,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE,EAAE,EAAE,EAAE,oBAAoB,KAAK,CAAC,eAAe,EAAE,EAAE,aAAa,KAAK,CAAC,WAAW,EAAE,EAAE,cAAc,KAAK,CAAC,cAAc,IAAI,EAAE,EAAE,CAAC,CAAC;IAC1J,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,EAAE,qBAAqB,EAAE,WAAW,EAAE,mBAAmB,KAAK,CAAC,UAAU,QAAQ,EAAE,wBAAwB,KAAK,CAAC,YAAY,IAAI,EAAE,4BAA4B,KAAK,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;IAC5N,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,EAAE,6BAA6B,EAAE,WAAW,CAAC,CAAC;IAC7E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAA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AC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACzF,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpJ,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AACtN,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { messages } from '@core/messages';\n\nimport type { Ocorrencia } from '@';\n\nimport type { DadosRelatorioCircleCI, OpcoesRelatorio } from '../../../types/analysts/circleci.js';\n\nexport function gerarRelatorioJson(dados: DadosRelatorioCircleCI): string {\n return JSON.stringify({ $schema: 'tutanus://schemas/circleci-report/v1', geradoEm: new Date().toISOString(), versao: '0.7.0', ...dados }, null, 2);\n}\n\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioCircleCI, opcoes?: { titulo?: string; incluirDetalhes?: boolean }): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - CircleCI';\n linhas.push(`# ${titulo}`, '', `**Repositório:** ${dados.nomeRepositorio}`, `**Data:** ${dados.dataAnalise}`, `**Tempo:** ${dados.tempoAnaliseMs}ms`, '');\n linhas.push('## Resumo', '', '| Métrica | Valor |', '|---|---|', `| Score Geral | ${dados.scoreGeral}/100 |`, `| Total de Configs | ${dados.totalConfigs} |`, `| Total de Ocorrências | ${dados.ocorrencias.length} |`, '');\n linhas.push('## Severidade', '', '| Severidade | Quantidade |', '|---|---|');\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) linhas.push(`| ${sev} | ${count} |`);\n linhas.push('', '## Configs Analisadas', '', '| Config | Score | Ocorrências |', '|---|---|---|');\n for (const c of dados.configs) linhas.push(`| ${c.nome} | ${c.score}/100 | ${c.ocorrencias} |`);\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('', '## Ocorrências Detalhadas', '', '| Arquivo | Linha | Severidade | Tipo | Mensagem |', '|---|---|---|---|---|');\n for (const o of dados.ocorrencias.slice(0, 200)) {\n linhas.push(`| \\`${o.relPath}\\` | ${o.linha || '-'} | ${o.nivel || 'info'} | ${o.tipo || ''} | ${(o.mensagem || '').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ')} |`);\n }\n }\n linhas.push('', '*Gerado por Tutanus v0.7.0*');\n return linhas.join('\\n');\n}\n\nexport function gerarRelatorioHtml(dados: DadosRelatorioCircleCI, opcoes?: { titulo?: string }): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - CircleCI';\n const sc = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html><html lang=\"pt-BR\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"><title>${titulo}</title><style>*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0d1117;color:#c9d1d9;padding:2rem}.container{max-width:1200px;margin:0 auto}h1{color:#343434;margin-bottom:.5rem}h2{color:#343434;margin:2rem 0 1rem;border-bottom:1px solid #21262d;padding-bottom:.5rem}.meta{color:#8b949e;margin-bottom:2rem}.score-card{background:#161b22;border:1px solid #30363d;border-radius:12px;padding:2rem;text-align:center;margin-bottom:2rem}.score-value{font-size:4rem;font-weight:bold;color:${sc}}.score-label{color:#8b949e;font-size:1.2rem}table{width:100%;border-collapse:collapse;margin:1rem 0}th{background:#161b22;color:#343434;padding:.75rem 1rem;text-align:left;border-bottom:2px solid #30363d}td{padding:.75rem 1rem;border-bottom:1px solid #21262d}tr:hover{background:#161b22}.badge{padding:.25rem .5rem;border-radius:12px;font-size:.85rem;font-weight:600}.badge-erro{background:rgba(239,68,68,.2);color:#ef4444}.badge-aviso{background:rgba(245,158,11,.2);color:#f59e0b}.badge-info{background:rgba(56,139,253,.2);color:#388bfd}.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin:1rem 0}.summary-item{background:#161b22;border:1px solid #30363d;border-radius:8px;padding:1rem}.summary-item .label{color:#8b949e;font-size:.85rem}.summary-item .value{font-size:1.5rem;font-weight:bold;color:#343434}.footer{margin-top:3rem;padding-top:1rem;border-top:1px solid #21262d;color:#8b949e;font-size:.85rem;text-align:center}code{background:#161b22;padding:.2rem .4rem;border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:.9em}</style></head><body><div class=\"container\"><h1>${titulo}</h1><div class=\"meta\"><p><strong>Repositório:</strong> ${dados.nomeRepositorio} | <strong>Data:</strong> ${dados.dataAnalise} | <strong>Tempo:</strong> ${dados.tempoAnaliseMs}ms</p></div><div class=\"score-card\"><div class=\"score-value\">${dados.scoreGeral}</div><div class=\"score-label\">Score Geral (0-100)</div></div><h2>Resumo</h2><div class=\"summary-grid\"><div class=\"summary-item\"><div class=\"label\">Configs</div><div class=\"value\">${dados.totalConfigs}</div></div><div class=\"summary-item\"><div class=\"label\">Ocorrências</div><div class=\"value\">${dados.ocorrencias.length}</div></div>${Object.entries(dados.resumoPorSeveridade).map(([s, c]) => `<div class=\"summary-item\"><div class=\"label\">${s}</div><div class=\"value\">${c}</div></div>`).join('')}</div><h2>Configs</h2><table><thead><tr><th>Config</th><th>Score</th><th>Ocorrências</th></tr></thead><tbody>${dados.configs.map(p => `<tr><td>${p.nome}</td><td style=\"color:${p.score>=80?'#10b981':p.score>=50?'#f59e0b':'#ef4444'};font-weight:bold\">${p.score}/100</td><td>${p.ocorrencias}</td></tr>`).join('')}</tbody></table><h2>Ocorrências</h2><table><thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead><tbody>${dados.ocorrencias.slice(0,200).map(o => `<tr><td><code>${o.relPath}</code></td><td>${o.linha||'-'}</td><td><span class=\"badge badge-${o.nivel||'info'}\">${o.nivel||'info'}</span></td><td>${o.tipo||''}</td><td>${o.mensagem||''}</td></tr>`).join('')}</tbody></table>${dados.ocorrencias.length>200?`<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length}</p>`:''}<div class=\"footer\"><p>Gerado por Tutanus v0.7.0</p></div></div></body></html>`;\n}\n\nexport function gerarRelatorioCsv(dados: DadosRelatorioCircleCI): string {\n const linhas = ['Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao'];\n for (const o of dados.ocorrencias) linhas.push([o.relPath, String(o.linha || ''), o.nivel || 'info', o.tipo || '', `\"${(o.mensagem||'').replace(/\"/g,'\"\"')}\"`, `\"${(o.sugestao||'').replace(/\"/g,'\"\"')}\"`].join(','));\n return linhas.join('\\n');\n}\n\nexport async function gerarRelatorio(dados: DadosRelatorioCircleCI, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json': return gerarRelatorioJson(dados);\n case 'markdown': return gerarRelatorioMarkdown(dados, { titulo: opcoes.titulo, incluirDetalhes: opcoes.incluirDetalhes });\n case 'html': return gerarRelatorioHtml(dados, { titulo: opcoes.titulo });\n case 'csv': return gerarRelatorioCsv(dados);\n default: throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n fs.mkdirSync(path.dirname(opcoes.output), { recursive: true });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\n\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, configs?: Array<{ nome: string; score: number; ocorrencias: number }>): DadosRelatorioCircleCI {\n const cList = configs || [];\n const resumo: Record<string, number> = {};\n const resumoTipo: Record<string, number> = {};\n for (const o of ocorrencias) {\n const nivel = String(o.nivel || 'info');\n resumo[nivel] = (resumo[nivel] || 0) + 1;\n resumoTipo[o.tipo || 'desconhecido'] = (resumoTipo[o.tipo || 'desconhecido'] || 0) + 1;\n }\n const scoreGeral = cList.length > 0 ? Math.round(cList.reduce((s, c) => s + c.score, 0) / cList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return { nomeRepositorio, dataAnalise: new Date().toISOString(), totalConfigs: cList.length || 1, scoreGeral, ocorrencias, resumoPorSeveridade: resumo, resumoPorTipo: resumoTipo, configs: cList, tempoAnaliseMs };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"generator-report-github-actions.d.ts","sourceRoot":"","sources":["../../../../src/analysts/github-actions/reports/generator-report-github-actions.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AACpE,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,SAA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SAAS,CAAC,EAAE,KAAK,CAAC;IACnI,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,GAAG,2BAA2B,CAe/B"}
1
+ {"version":3,"file":"generator-report-github-actions.d.ts","sourceRoot":"","sources":["../../../../src/analysts/github-actions/reports/generator-report-github-actions.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AACpE,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,SAAS,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AACD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,2BAA2B,GAAG,MAAM,CAQ7E;AACD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,EAAE,MAAM,CAAC,EAAE;IAClF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,MAAM,CAyDT;AACD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,2BAA2B,EAAE,MAAM,CAAC,EAAE;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAkGT;AACD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,2BAA2B,GAAG,MAAM,CAQ5E;AAUD,wBAAsB,cAAc,CAAC,KAAK,EAAE,2BAA2B,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BjH;AACD,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO7F;AACD,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOvF;AACD,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC;IACnI,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,GAAG,2BAA2B,CAe/B"}
@@ -1,6 +1,6 @@
1
- import { messages } from '../../../core/messages/index.js';
2
1
  import fs from 'node:fs';
3
2
  import path from 'node:path';
3
+ import { messages } from '../../../core/messages/index.js';
4
4
  export function gerarRelatorioJson(dados) {
5
5
  const relatorio = {
6
6
  $schema: 'tutanus://schemas/github-actions-report/v1',
@@ -1 +1 @@
1
- {"version":3,"file":"generator-report-github-actions.js","sourceRoot":"","sources":["../../../../src/analysts/github-actions/reports/generator-report-github-actions.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,O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AW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvL,OAAO;QACL,eAAe;QACf,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,cAAc;QACd,UAAU;QACV,WAAW;QACX,mBAAmB,EAAE,2BAA2B,CAAC,WAAW,CAAC;QAC7D,aAAa,EAAE,qBAAqB,CAAC,WAAW,CAAC;QACjD,SAAS,EAAE,MAAM;QACjB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n/**\n * [GRAFICO] Gerador de Relatórios Multi-Formato para GitHub Actions\n *\n * Suporta: JSON, Markdown, HTML, CSV\n */\n\nimport { messages } from '@core/messages';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { Ocorrencia } from '@';\n\nexport type FormatoRelatorio = 'json' | 'markdown' | 'html' | 'csv';\nexport interface DadosRelatorioGithubActions {\n nomeRepositorio: string;\n dataAnalise: string;\n totalWorkflows: number;\n scoreGeral: number;\n ocorrencias: Ocorrencia[];\n resumoPorSeveridade: Record<string, number>;\n resumoPorTipo: Record<string, number>;\n workflows: Array<{\n nome: string;\n score: number;\n ocorrencias: number;\n }>;\n tempoAnaliseMs: number;\n}\nexport interface OpcoesRelatorio {\n formato: FormatoRelatorio;\n output: string;\n titulo?: string;\n incluirDetalhes?: boolean;\n filtrarSeveridade?: string[];\n}\nexport function gerarRelatorioJson(dados: DadosRelatorioGithubActions): string {\n const relatorio = {\n $schema: 'tutanus://schemas/github-actions-report/v1',\n geradoEm: new Date().toISOString(),\n versao: '0.6.0',\n ...dados\n };\n return JSON.stringify(relatorio, null, 2);\n}\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioGithubActions, opcoes?: {\n titulo?: string;\n incluirDetalhes?: boolean;\n}): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - GitHub Actions';\n linhas.push(`# ${titulo}`);\n linhas.push('');\n linhas.push(`**Repositório:** ${dados.nomeRepositorio}`);\n linhas.push(`**Data:** ${dados.dataAnalise}`);\n linhas.push(`**Tempo de Análise:** ${dados.tempoAnaliseMs}ms`);\n linhas.push('');\n linhas.push('## [GRAFICO] Resumo Geral');\n linhas.push('');\n linhas.push(`| Métrica | Valor |`);\n linhas.push(`|---|---|`);\n linhas.push(`| Score Geral | ${dados.scoreGeral}/100 |`);\n linhas.push(`| Total de Workflows | ${dados.totalWorkflows} |`);\n linhas.push(`| Total de Ocorrências | ${dados.ocorrencias.length} |`);\n linhas.push('');\n linhas.push('## 🔴 Severidade');\n linhas.push('');\n linhas.push(`| Severidade | Quantidade |`);\n linhas.push(`|---|---|`);\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) {\n const icon = sev === 'erro' ? '🔴' : sev === 'aviso' ? '🟡' : '🔵';\n linhas.push(`| ${icon} ${sev} | ${count} |`);\n }\n linhas.push('');\n linhas.push('## 📋 Workflows Analisados');\n linhas.push('');\n linhas.push(`| Workflow | Score | Ocorrências |`);\n linhas.push(`|---|---|---|`);\n for (const wf of dados.workflows) {\n const scoreIcon = wf.score >= 80 ? '[OK]' : wf.score >= 50 ? '[AVISO]' : '[ERRO]';\n linhas.push(`| ${scoreIcon} ${wf.nome} | ${wf.score}/100 | ${wf.ocorrencias} |`);\n }\n linhas.push('');\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('## [BUSCA] Ocorrências Detalhadas');\n linhas.push('');\n linhas.push(`| Arquivo | Linha | Severidade | Tipo | Mensagem |`);\n linhas.push(`|---|---|---|---|---|`);\n for (const ocorrencia of dados.ocorrencias.slice(0, 200)) {\n const nivel = ocorrencia.nivel || 'info';\n const tipo = ocorrencia.tipo || 'desconhecido';\n const msg = (ocorrencia.mensagem || '').replace(/\\\\/g, '\\\\\\\\').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ').replace(/\\r/g, ' ').replace(/\\*/g, '\\\\*').replace(/_/g, '\\\\_').replace(/\\[/g, '\\\\[').replace(/\\]/g, '\\\\]').replace(/</g, '\\\\<').replace(/>/g, '\\\\>');\n const linha = ocorrencia.linha || '-';\n linhas.push(`| \\`${ocorrencia.relPath}\\` | ${linha} | ${nivel} | ${tipo} | ${msg} |`);\n }\n if (dados.ocorrencias.length > 200) {\n linhas.push('');\n linhas.push(`> Mostrando 200 de ${dados.ocorrencias.length} ocorrências.`);\n }\n linhas.push('');\n }\n linhas.push('---');\n linhas.push('');\n linhas.push(`*Gerado por Tutanus v0.6.0 em ${new Date().toISOString()}*`);\n return linhas.join('\\n');\n}\nexport function gerarRelatorioHtml(dados: DadosRelatorioGithubActions, opcoes?: {\n titulo?: string;\n}): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - GitHub Actions';\n const scoreColor = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${escapeHtml(titulo)}</title>\n <style>\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0d1117; color: #c9d1d9; padding: 2rem; }\n .container { max-width: 1200px; margin: 0 auto; }\n h1 { color: #58a6ff; margin-bottom: 0.5rem; }\n h2 { color: #58a6ff; margin: 2rem 0 1rem; border-bottom: 1px solid #21262d; padding-bottom: 0.5rem; }\n .meta { color: #8b949e; margin-bottom: 2rem; }\n .score-card { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 2rem; text-align: center; margin-bottom: 2rem; }\n .score-value { font-size: 4rem; font-weight: bold; color: ${scoreColor}; }\n .score-label { color: #8b949e; font-size: 1.2rem; }\n table { width: 100%; border-collapse: collapse; margin: 1rem 0; }\n th { background: #161b22; color: #58a6ff; padding: 0.75rem 1rem; text-align: left; border-bottom: 2px solid #30363d; }\n td { padding: 0.75rem 1rem; border-bottom: 1px solid #21262d; }\n tr:hover { background: #161b22; }\n .badge { padding: 0.25rem 0.5rem; border-radius: 12px; font-size: 0.85rem; font-weight: 600; }\n .badge-erro { background: rgba(239,68,68,0.2); color: #ef4444; }\n .badge-aviso { background: rgba(245,158,11,0.2); color: #f59e0b; }\n .badge-info { background: rgba(56,139,253,0.2); color: #388bfd; }\n .badge-sucesso { background: rgba(16,185,129,0.2); color: #10b981; }\n .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }\n .summary-item { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 1rem; }\n .summary-item .label { color: #8b949e; font-size: 0.85rem; }\n .summary-item .value { font-size: 1.5rem; font-weight: bold; color: #58a6ff; }\n .footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #21262d; color: #8b949e; font-size: 0.85rem; text-align: center; }\n code { background: #161b22; padding: 0.2rem 0.4rem; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <h1>[FOGO] ${escapeHtml(titulo)}</h1>\n <div class=\"meta\">\n <p><strong>Repositório:</strong> ${escapeHtml(dados.nomeRepositorio)} | <strong>Data:</strong> ${escapeHtml(dados.dataAnalise)} | <strong>Tempo:</strong> ${escapeHtml(String(dados.tempoAnaliseMs))}ms</p>\n </div>\n\n <div class=\"score-card\">\n <div class=\"score-value\">${dados.scoreGeral}</div>\n <div class=\"score-label\">Score Geral (0-100)</div>\n </div>\n\n <h2>[GRAFICO] Resumo</h2>\n <div class=\"summary-grid\">\n <div class=\"summary-item\">\n <div class=\"label\">Workflows</div>\n <div class=\"value\">${dados.totalWorkflows}</div>\n </div>\n <div class=\"summary-item\">\n <div class=\"label\">Ocorrências</div>\n <div class=\"value\">${dados.ocorrencias.length}</div>\n </div>\n ${Object.entries(dados.resumoPorSeveridade).map(([sev, count]) => `\n <div class=\"summary-item\">\n <div class=\"label\">${escapeHtml(sev)}</div>\n <div class=\"value\">${count}</div>\n </div>`).join('')}\n </div>\n\n <h2>📋 Workflows</h2>\n <table>\n <thead><tr><th>Workflow</th><th>Score</th><th>Ocorrências</th></tr></thead>\n <tbody>\n ${dados.workflows.map(wf => {\n const scoreColor2 = wf.score >= 80 ? '#10b981' : wf.score >= 50 ? '#f59e0b' : '#ef4444';\n return `<tr><td>${escapeHtml(wf.nome)}</td><td style=\"color:${scoreColor2};font-weight:bold\">${wf.score}/100</td><td>${wf.ocorrencias}</td></tr>`;\n }).join('')}\n </tbody>\n </table>\n\n <h2>[BUSCA] Ocorrências</h2>\n <table>\n <thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead>\n <tbody>\n ${dados.ocorrencias.slice(0, 200).map(ocorrencia => `\n <tr>\n <td><code>${escapeHtml(ocorrencia.relPath)}</code></td>\n <td>${ocorrencia.linha || '-'}</td>\n <td><span class=\"badge badge-${ocorrencia.nivel || 'info'}\">${escapeHtml(String(ocorrencia.nivel || 'info'))}</span></td>\n <td>${escapeHtml(ocorrencia.tipo || '')}</td>\n <td>${escapeHtml(ocorrencia.mensagem || '')}</td>\n </tr>`).join('')}\n </tbody>\n </table>\n ${dados.ocorrencias.length > 200 ? `<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length} ocorrências.</p>` : ''}\n\n <div class=\"footer\">\n <p>Gerado por Tutanus v0.6.0 em ${new Date().toISOString()}</p>\n </div>\n </div>\n</body>\n</html>`;\n}\nexport function gerarRelatorioCsv(dados: DadosRelatorioGithubActions): string {\n const linhas: string[] = [];\n linhas.push('Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao');\n for (const ocorrencia of dados.ocorrencias) {\n const campos = [csvEscape(ocorrencia.relPath), csvEscape(String(ocorrencia.linha || '')), csvEscape(String(ocorrencia.nivel || 'info')), csvEscape(ocorrencia.tipo || ''), csvEscape(ocorrencia.mensagem || ''), csvEscape(ocorrencia.sugestao || '')];\n linhas.push(campos.join(','));\n }\n return linhas.join('\\n');\n}\nfunction escapeHtml(str: string): string {\n return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/'/g, '&#039;');\n}\nfunction csvEscape(str: string): string {\n if (str.includes(',') || str.includes('\"') || str.includes('\\n')) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`;\n }\n return str;\n}\nexport async function gerarRelatorio(dados: DadosRelatorioGithubActions, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json':\n return gerarRelatorioJson(dados);\n case 'markdown':\n return gerarRelatorioMarkdown(dados, {\n titulo: opcoes.titulo,\n incluirDetalhes: opcoes.incluirDetalhes\n });\n case 'html':\n return gerarRelatorioHtml(dados, {\n titulo: opcoes.titulo\n });\n case 'csv':\n return gerarRelatorioCsv(dados);\n default:\n throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n const dir = path.dirname(opcoes.output);\n fs.mkdirSync(dir, {\n recursive: true\n });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\nexport function calcularResumoPorSeveridade(ocorrencias: Ocorrencia[]): Record<string, number> {\n const resumo: Record<string, number> = {};\n for (const ocorrencia of ocorrencias) {\n const nivel = String(ocorrencia.nivel || 'info');\n resumo[nivel] = (resumo[nivel] || 0) + 1;\n }\n return resumo;\n}\nexport function calcularResumoPorTipo(ocorrencias: Ocorrencia[]): Record<string, number> {\n const resumo: Record<string, number> = {};\n for (const ocorrencia of ocorrencias) {\n const tipo = ocorrencia.tipo || 'desconhecido';\n resumo[tipo] = (resumo[tipo] || 0) + 1;\n }\n return resumo;\n}\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, workflows?: Array<{\n nome: string;\n score: number;\n ocorrencias: number;\n}>): DadosRelatorioGithubActions {\n const wfList = workflows || [];\n const totalWorkflows = wfList.length || 1;\n const scoreGeral = wfList.length > 0 ? Math.round(wfList.reduce((sum, dimensaoLargura) => sum + dimensaoLargura.score, 0) / wfList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return {\n nomeRepositorio,\n dataAnalise: new Date().toISOString(),\n totalWorkflows,\n scoreGeral,\n ocorrencias,\n resumoPorSeveridade: calcularResumoPorSeveridade(ocorrencias),\n resumoPorTipo: calcularResumoPorTipo(ocorrencias),\n workflows: wfList,\n tempoAnaliseMs\n };\n}"]}
1
+ {"version":3,"file":"generator-report-github-actions.js","sourceRoot":"","sources":["../../../../src/analysts/github-actions/reports/generator-report-github-actions.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA2B1C,MAAM,UAAU,kBAAkB,CAAC,KAAkC;IACnE,MAAM,SAAS,GAAG;QAChB,OAAO,EAAE,4CAA4C;QACrD,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAClC,MAAM,EAAE,OAAO;QACf,GAAG,KAAK;KACT,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC;AACD,MAAM,UAAU,sBAAsB,CAAC,KAAkC,EAAE,MAG1E;IACC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,IAAI,uCAAuC,CAAC;IACzE,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;IAC3B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChB,MAAM,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;IACzD,MAAM,CAAC,IAAI,CAAC,aAAa,KAAK,C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C;AACD,MAAM,UAAU,sBAAsB,CAAC,WAAyB,EAAE,eAAuB,EAAE,cAAsB,EAAE,SAIjH;IACA,MAAM,MAAM,GAAG,SAAS,IAAI,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,CAAC,GAAG,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvL,OAAO;QACL,eAAe;QACf,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,cAAc;QACd,UAAU;QACV,WAAW;QACX,mBAAmB,EAAE,2BAA2B,CAAC,WAAW,CAAC;QAC7D,aAAa,EAAE,qBAAqB,CAAC,WAAW,CAAC;QACjD,SAAS,EAAE,MAAM;QACjB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n/**\n * [GRAFICO] Gerador de Relatórios Multi-Formato para GitHub Actions\n *\n * Suporta: JSON, Markdown, HTML, CSV\n */\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { messages } from '@core/messages';\n\nimport type { Ocorrencia } from '@';\n\nexport type FormatoRelatorio = 'json' | 'markdown' | 'html' | 'csv';\nexport interface DadosRelatorioGithubActions {\n nomeRepositorio: string;\n dataAnalise: string;\n totalWorkflows: number;\n scoreGeral: number;\n ocorrencias: Ocorrencia[];\n resumoPorSeveridade: Record<string, number>;\n resumoPorTipo: Record<string, number>;\n workflows: Array<{\n nome: string;\n score: number;\n ocorrencias: number;\n }>;\n tempoAnaliseMs: number;\n}\nexport interface OpcoesRelatorio {\n formato: FormatoRelatorio;\n output: string;\n titulo?: string;\n incluirDetalhes?: boolean;\n filtrarSeveridade?: string[];\n}\nexport function gerarRelatorioJson(dados: DadosRelatorioGithubActions): string {\n const relatorio = {\n $schema: 'tutanus://schemas/github-actions-report/v1',\n geradoEm: new Date().toISOString(),\n versao: '0.6.0',\n ...dados\n };\n return JSON.stringify(relatorio, null, 2);\n}\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioGithubActions, opcoes?: {\n titulo?: string;\n incluirDetalhes?: boolean;\n}): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - GitHub Actions';\n linhas.push(`# ${titulo}`);\n linhas.push('');\n linhas.push(`**Repositório:** ${dados.nomeRepositorio}`);\n linhas.push(`**Data:** ${dados.dataAnalise}`);\n linhas.push(`**Tempo de Análise:** ${dados.tempoAnaliseMs}ms`);\n linhas.push('');\n linhas.push('## [GRAFICO] Resumo Geral');\n linhas.push('');\n linhas.push(`| Métrica | Valor |`);\n linhas.push(`|---|---|`);\n linhas.push(`| Score Geral | ${dados.scoreGeral}/100 |`);\n linhas.push(`| Total de Workflows | ${dados.totalWorkflows} |`);\n linhas.push(`| Total de Ocorrências | ${dados.ocorrencias.length} |`);\n linhas.push('');\n linhas.push('## 🔴 Severidade');\n linhas.push('');\n linhas.push(`| Severidade | Quantidade |`);\n linhas.push(`|---|---|`);\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) {\n const icon = sev === 'erro' ? '🔴' : sev === 'aviso' ? '🟡' : '🔵';\n linhas.push(`| ${icon} ${sev} | ${count} |`);\n }\n linhas.push('');\n linhas.push('## 📋 Workflows Analisados');\n linhas.push('');\n linhas.push(`| Workflow | Score | Ocorrências |`);\n linhas.push(`|---|---|---|`);\n for (const wf of dados.workflows) {\n const scoreIcon = wf.score >= 80 ? '[OK]' : wf.score >= 50 ? '[AVISO]' : '[ERRO]';\n linhas.push(`| ${scoreIcon} ${wf.nome} | ${wf.score}/100 | ${wf.ocorrencias} |`);\n }\n linhas.push('');\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('## [BUSCA] Ocorrências Detalhadas');\n linhas.push('');\n linhas.push(`| Arquivo | Linha | Severidade | Tipo | Mensagem |`);\n linhas.push(`|---|---|---|---|---|`);\n for (const ocorrencia of dados.ocorrencias.slice(0, 200)) {\n const nivel = ocorrencia.nivel || 'info';\n const tipo = ocorrencia.tipo || 'desconhecido';\n const msg = (ocorrencia.mensagem || '').replace(/\\\\/g, '\\\\\\\\').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ').replace(/\\r/g, ' ').replace(/\\*/g, '\\\\*').replace(/_/g, '\\\\_').replace(/\\[/g, '\\\\[').replace(/\\]/g, '\\\\]').replace(/</g, '\\\\<').replace(/>/g, '\\\\>');\n const linha = ocorrencia.linha || '-';\n linhas.push(`| \\`${ocorrencia.relPath}\\` | ${linha} | ${nivel} | ${tipo} | ${msg} |`);\n }\n if (dados.ocorrencias.length > 200) {\n linhas.push('');\n linhas.push(`> Mostrando 200 de ${dados.ocorrencias.length} ocorrências.`);\n }\n linhas.push('');\n }\n linhas.push('---');\n linhas.push('');\n linhas.push(`*Gerado por Tutanus v0.6.0 em ${new Date().toISOString()}*`);\n return linhas.join('\\n');\n}\nexport function gerarRelatorioHtml(dados: DadosRelatorioGithubActions, opcoes?: {\n titulo?: string;\n}): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - GitHub Actions';\n const scoreColor = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${escapeHtml(titulo)}</title>\n <style>\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0d1117; color: #c9d1d9; padding: 2rem; }\n .container { max-width: 1200px; margin: 0 auto; }\n h1 { color: #58a6ff; margin-bottom: 0.5rem; }\n h2 { color: #58a6ff; margin: 2rem 0 1rem; border-bottom: 1px solid #21262d; padding-bottom: 0.5rem; }\n .meta { color: #8b949e; margin-bottom: 2rem; }\n .score-card { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 2rem; text-align: center; margin-bottom: 2rem; }\n .score-value { font-size: 4rem; font-weight: bold; color: ${scoreColor}; }\n .score-label { color: #8b949e; font-size: 1.2rem; }\n table { width: 100%; border-collapse: collapse; margin: 1rem 0; }\n th { background: #161b22; color: #58a6ff; padding: 0.75rem 1rem; text-align: left; border-bottom: 2px solid #30363d; }\n td { padding: 0.75rem 1rem; border-bottom: 1px solid #21262d; }\n tr:hover { background: #161b22; }\n .badge { padding: 0.25rem 0.5rem; border-radius: 12px; font-size: 0.85rem; font-weight: 600; }\n .badge-erro { background: rgba(239,68,68,0.2); color: #ef4444; }\n .badge-aviso { background: rgba(245,158,11,0.2); color: #f59e0b; }\n .badge-info { background: rgba(56,139,253,0.2); color: #388bfd; }\n .badge-sucesso { background: rgba(16,185,129,0.2); color: #10b981; }\n .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }\n .summary-item { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 1rem; }\n .summary-item .label { color: #8b949e; font-size: 0.85rem; }\n .summary-item .value { font-size: 1.5rem; font-weight: bold; color: #58a6ff; }\n .footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #21262d; color: #8b949e; font-size: 0.85rem; text-align: center; }\n code { background: #161b22; padding: 0.2rem 0.4rem; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <h1>[FOGO] ${escapeHtml(titulo)}</h1>\n <div class=\"meta\">\n <p><strong>Repositório:</strong> ${escapeHtml(dados.nomeRepositorio)} | <strong>Data:</strong> ${escapeHtml(dados.dataAnalise)} | <strong>Tempo:</strong> ${escapeHtml(String(dados.tempoAnaliseMs))}ms</p>\n </div>\n\n <div class=\"score-card\">\n <div class=\"score-value\">${dados.scoreGeral}</div>\n <div class=\"score-label\">Score Geral (0-100)</div>\n </div>\n\n <h2>[GRAFICO] Resumo</h2>\n <div class=\"summary-grid\">\n <div class=\"summary-item\">\n <div class=\"label\">Workflows</div>\n <div class=\"value\">${dados.totalWorkflows}</div>\n </div>\n <div class=\"summary-item\">\n <div class=\"label\">Ocorrências</div>\n <div class=\"value\">${dados.ocorrencias.length}</div>\n </div>\n ${Object.entries(dados.resumoPorSeveridade).map(([sev, count]) => `\n <div class=\"summary-item\">\n <div class=\"label\">${escapeHtml(sev)}</div>\n <div class=\"value\">${count}</div>\n </div>`).join('')}\n </div>\n\n <h2>📋 Workflows</h2>\n <table>\n <thead><tr><th>Workflow</th><th>Score</th><th>Ocorrências</th></tr></thead>\n <tbody>\n ${dados.workflows.map(wf => {\n const scoreColor2 = wf.score >= 80 ? '#10b981' : wf.score >= 50 ? '#f59e0b' : '#ef4444';\n return `<tr><td>${escapeHtml(wf.nome)}</td><td style=\"color:${scoreColor2};font-weight:bold\">${wf.score}/100</td><td>${wf.ocorrencias}</td></tr>`;\n }).join('')}\n </tbody>\n </table>\n\n <h2>[BUSCA] Ocorrências</h2>\n <table>\n <thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead>\n <tbody>\n ${dados.ocorrencias.slice(0, 200).map(ocorrencia => `\n <tr>\n <td><code>${escapeHtml(ocorrencia.relPath)}</code></td>\n <td>${ocorrencia.linha || '-'}</td>\n <td><span class=\"badge badge-${ocorrencia.nivel || 'info'}\">${escapeHtml(String(ocorrencia.nivel || 'info'))}</span></td>\n <td>${escapeHtml(ocorrencia.tipo || '')}</td>\n <td>${escapeHtml(ocorrencia.mensagem || '')}</td>\n </tr>`).join('')}\n </tbody>\n </table>\n ${dados.ocorrencias.length > 200 ? `<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length} ocorrências.</p>` : ''}\n\n <div class=\"footer\">\n <p>Gerado por Tutanus v0.6.0 em ${new Date().toISOString()}</p>\n </div>\n </div>\n</body>\n</html>`;\n}\nexport function gerarRelatorioCsv(dados: DadosRelatorioGithubActions): string {\n const linhas: string[] = [];\n linhas.push('Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao');\n for (const ocorrencia of dados.ocorrencias) {\n const campos = [csvEscape(ocorrencia.relPath), csvEscape(String(ocorrencia.linha || '')), csvEscape(String(ocorrencia.nivel || 'info')), csvEscape(ocorrencia.tipo || ''), csvEscape(ocorrencia.mensagem || ''), csvEscape(ocorrencia.sugestao || '')];\n linhas.push(campos.join(','));\n }\n return linhas.join('\\n');\n}\nfunction escapeHtml(str: string): string {\n return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/'/g, '&#039;');\n}\nfunction csvEscape(str: string): string {\n if (str.includes(',') || str.includes('\"') || str.includes('\\n')) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`;\n }\n return str;\n}\nexport async function gerarRelatorio(dados: DadosRelatorioGithubActions, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json':\n return gerarRelatorioJson(dados);\n case 'markdown':\n return gerarRelatorioMarkdown(dados, {\n titulo: opcoes.titulo,\n incluirDetalhes: opcoes.incluirDetalhes\n });\n case 'html':\n return gerarRelatorioHtml(dados, {\n titulo: opcoes.titulo\n });\n case 'csv':\n return gerarRelatorioCsv(dados);\n default:\n throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n const dir = path.dirname(opcoes.output);\n fs.mkdirSync(dir, {\n recursive: true\n });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\nexport function calcularResumoPorSeveridade(ocorrencias: Ocorrencia[]): Record<string, number> {\n const resumo: Record<string, number> = {};\n for (const ocorrencia of ocorrencias) {\n const nivel = String(ocorrencia.nivel || 'info');\n resumo[nivel] = (resumo[nivel] || 0) + 1;\n }\n return resumo;\n}\nexport function calcularResumoPorTipo(ocorrencias: Ocorrencia[]): Record<string, number> {\n const resumo: Record<string, number> = {};\n for (const ocorrencia of ocorrencias) {\n const tipo = ocorrencia.tipo || 'desconhecido';\n resumo[tipo] = (resumo[tipo] || 0) + 1;\n }\n return resumo;\n}\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, workflows?: Array<{\n nome: string;\n score: number;\n ocorrencias: number;\n}>): DadosRelatorioGithubActions {\n const wfList = workflows || [];\n const totalWorkflows = wfList.length || 1;\n const scoreGeral = wfList.length > 0 ? Math.round(wfList.reduce((sum, dimensaoLargura) => sum + dimensaoLargura.score, 0) / wfList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return {\n nomeRepositorio,\n dataAnalise: new Date().toISOString(),\n totalWorkflows,\n scoreGeral,\n ocorrencias,\n resumoPorSeveridade: calcularResumoPorSeveridade(ocorrencias),\n resumoPorTipo: calcularResumoPorTipo(ocorrencias),\n workflows: wfList,\n tempoAnaliseMs\n };\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"generator-report-gitlab-ci.d.ts","sourceRoot":"","sources":["../../../../src/analysts/gitlab-ci/reports/generator-report-gitlab-ci.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEpG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAExE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,CAAC,EA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{ Ocorrencia } from '@';\n\nimport type { DadosRelatorioGitLabCI, OpcoesRelatorio } from '../../../types/analysts/gitlab-ci.js';\n\nexport function gerarRelatorioJson(dados: DadosRelatorioGitLabCI): string {\n return JSON.stringify({ $schema: 'tutanus://schemas/gitlab-ci-report/v1', geradoEm: new Date().toISOString(), versao: '0.7.0', ...dados }, null, 2);\n}\n\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioGitLabCI, opcoes?: { titulo?: string; incluirDetalhes?: boolean }): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - GitLab CI';\n linhas.push(`# ${titulo}`, '', `**Repositório:** ${dados.nomeRepositorio}`, `**Data:** ${dados.dataAnalise}`, `**Tempo:** ${dados.tempoAnaliseMs}ms`, '');\n linhas.push('## Resumo', '', '| Métrica | Valor |', '|---|---|', `| Score Geral | ${dados.scoreGeral}/100 |`, `| Total de Pipelines | ${dados.totalPipelines} |`, `| Total de Ocorrências | ${dados.ocorrencias.length} |`, '');\n linhas.push('## Severidade', '', '| Severidade | Quantidade |', '|---|---|');\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) linhas.push(`| ${sev} | ${count} |`);\n linhas.push('', '## Pipelines Analisados', '', '| Pipeline | Score | Ocorrências |', '|---|---|---|');\n for (const p of dados.pipelines) linhas.push(`| ${p.nome} | ${p.score}/100 | ${p.ocorrencias} |`);\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('', '## Ocorrências Detalhadas', '', '| Arquivo | Linha | Severidade | Tipo | Mensagem |', '|---|---|---|---|---|');\n for (const o of dados.ocorrencias.slice(0, 200)) linhas.push(`| \\`${o.relPath}\\` | ${o.linha || '-'} | ${o.nivel || 'info'} | ${o.tipo || ''} | ${(o.mensagem || '').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ')} |`);\n }\n linhas.push('', '*Gerado por Tutanus v0.7.0*');\n return linhas.join('\\n');\n}\n\nexport function gerarRelatorioHtml(dados: DadosRelatorioGitLabCI, opcoes?: { titulo?: string }): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - GitLab CI';\n const sc = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html><html lang=\"pt-BR\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"><title>${titulo}</title><style>*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0d1117;color:#c9d1d9;padding:2rem}.container{max-width:1200px;margin:0 auto}h1{color:#e24329;margin-bottom:.5rem}h2{color:#e24329;margin:2rem 0 1rem;border-bottom:1px solid #21262d;padding-bottom:.5rem}.meta{color:#8b949e;margin-bottom:2rem}.score-card{background:#161b22;border:1px solid #30363d;border-radius:12px;padding:2rem;text-align:center;margin-bottom:2rem}.score-value{font-size:4rem;font-weight:bold;color:${sc}}.score-label{color:#8b949e;font-size:1.2rem}table{width:100%;border-collapse:collapse;margin:1rem 0}th{background:#161b22;color:#e24329;padding:.75rem 1rem;text-align:left;border-bottom:2px solid #30363d}td{padding:.75rem 1rem;border-bottom:1px solid #21262d}tr:hover{background:#161b22}.badge{padding:.25rem .5rem;border-radius:12px;font-size:.85rem;font-weight:600}.badge-erro{background:rgba(239,68,68,.2);color:#ef4444}.badge-aviso{background:rgba(245,158,11,.2);color:#f59e0b}.badge-info{background:rgba(56,139,253,.2);color:#388bfd}.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin:1rem 0}.summary-item{background:#161b22;border:1px solid #30363d;border-radius:8px;padding:1rem}.summary-item .label{color:#8b949e;font-size:.85rem}.summary-item .value{font-size:1.5rem;font-weight:bold;color:#e24329}.footer{margin-top:3rem;padding-top:1rem;border-top:1px solid #21262d;color:#8b949e;font-size:.85rem;text-align:center}code{background:#161b22;padding:.2rem .4rem;border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:.9em}</style></head><body><div class=\"container\"><h1>${titulo}</h1><div class=\"meta\"><p><strong>Repositório:</strong> ${dados.nomeRepositorio} | <strong>Data:</strong> ${dados.dataAnalise} | <strong>Tempo:</strong> ${dados.tempoAnaliseMs}ms</p></div><div class=\"score-card\"><div class=\"score-value\">${dados.scoreGeral}</div><div class=\"score-label\">Score (0-100)</div></div><h2>Resumo</h2><div class=\"summary-grid\"><div class=\"summary-item\"><div class=\"label\">Pipelines</div><div class=\"value\">${dados.totalPipelines}</div></div><div class=\"summary-item\"><div class=\"label\">Ocorrências</div><div class=\"value\">${dados.ocorrencias.length}</div></div>${Object.entries(dados.resumoPorSeveridade).map(([s, c]) => `<div class=\"summary-item\"><div class=\"label\">${s}</div><div class=\"value\">${c}</div></div>`).join('')}</div><h2>Pipelines</h2><table><thead><tr><th>Pipeline</th><th>Score</th><th>Ocorrências</th></tr></thead><tbody>${dados.pipelines.map(p => `<tr><td>${p.nome}</td><td style=\"color:${p.score>=80?'#10b981':p.score>=50?'#f59e0b':'#ef4444'};font-weight:bold\">${p.score}/100</td><td>${p.ocorrencias}</td></tr>`).join('')}</tbody></table><h2>Ocorrências</h2><table><thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead><tbody>${dados.ocorrencias.slice(0,200).map(o => `<tr><td><code>${o.relPath}</code></td><td>${o.linha||'-'}</td><td><span class=\"badge badge-${o.nivel||'info'}\">${o.nivel||'info'}</span></td><td>${o.tipo||''}</td><td>${o.mensagem||''}</td></tr>`).join('')}</tbody></table>${dados.ocorrencias.length>200?`<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length}</p>`:''}<div class=\"footer\"><p>Gerado por Tutanus v0.7.0</p></div></div></body></html>`;\n}\n\nexport function gerarRelatorioCsv(dados: DadosRelatorioGitLabCI): string {\n const linhas = ['Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao'];\n for (const o of dados.ocorrencias) linhas.push([o.relPath, String(o.linha || ''), o.nivel || 'info', o.tipo || '', `\"${(o.mensagem||'').replace(/\"/g,'\"\"')}\"`, `\"${(o.sugestao||'').replace(/\"/g,'\"\"')}\"`].join(','));\n return linhas.join('\\n');\n}\n\nexport async function gerarRelatorio(dados: DadosRelatorioGitLabCI, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json': return gerarRelatorioJson(dados);\n case 'markdown': return gerarRelatorioMarkdown(dados, { titulo: opcoes.titulo, incluirDetalhes: opcoes.incluirDetalhes });\n case 'html': return gerarRelatorioHtml(dados, { titulo: opcoes.titulo });\n case 'csv': return gerarRelatorioCsv(dados);\n default: throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n fs.mkdirSync(path.dirname(opcoes.output), { recursive: true });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\n\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, pipelines?: Array<{ nome: string; score: number; ocorrencias: number }>): DadosRelatorioGitLabCI {\n const pList = pipelines || [];\n const resumo: Record<string, number> = {};\n const resumoTipo: Record<string, number> = {};\n for (const o of ocorrencias) {\n resumo[String(o.nivel || 'info')] = (resumo[String(o.nivel || 'info')] || 0) + 1;\n resumoTipo[o.tipo || 'desconhecido'] = (resumoTipo[o.tipo || 'desconhecido'] || 0) + 1;\n }\n const scoreGeral = pList.length > 0 ? Math.round(pList.reduce((s, p) => s + p.score, 0) / pList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return { nomeRepositorio, dataAnalise: new Date().toISOString(), totalPipelines: pList.length || 1, scoreGeral, ocorrencias, resumoPorSeveridade: resumo, resumoPorTipo: resumoTipo, pipelines: pList, tempoAnaliseMs };\n}\n"]}
1
+ {"version":3,"file":"generator-report-gitlab-ci.js","sourceRoot":"","sources":["../../../../src/analysts/gitlab-ci/reports/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GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpJ,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AAC1N,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { messages } from '@core/messages';\n\nimport type { Ocorrencia } from '@';\n\nimport type { DadosRelatorioGitLabCI, OpcoesRelatorio } from '../../../types/analysts/gitlab-ci.js';\n\nexport function gerarRelatorioJson(dados: DadosRelatorioGitLabCI): string {\n return JSON.stringify({ $schema: 'tutanus://schemas/gitlab-ci-report/v1', geradoEm: new Date().toISOString(), versao: '0.7.0', ...dados }, null, 2);\n}\n\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioGitLabCI, opcoes?: { titulo?: string; incluirDetalhes?: boolean }): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - GitLab CI';\n linhas.push(`# ${titulo}`, '', `**Repositório:** ${dados.nomeRepositorio}`, `**Data:** ${dados.dataAnalise}`, `**Tempo:** ${dados.tempoAnaliseMs}ms`, '');\n linhas.push('## Resumo', '', '| Métrica | Valor |', '|---|---|', `| Score Geral | ${dados.scoreGeral}/100 |`, `| Total de Pipelines | ${dados.totalPipelines} |`, `| Total de Ocorrências | ${dados.ocorrencias.length} |`, '');\n linhas.push('## Severidade', '', '| Severidade | Quantidade |', '|---|---|');\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) linhas.push(`| ${sev} | ${count} |`);\n linhas.push('', '## Pipelines Analisados', '', '| Pipeline | Score | Ocorrências |', '|---|---|---|');\n for (const p of dados.pipelines) linhas.push(`| ${p.nome} | ${p.score}/100 | ${p.ocorrencias} |`);\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('', '## Ocorrências Detalhadas', '', '| Arquivo | Linha | Severidade | Tipo | Mensagem |', '|---|---|---|---|---|');\n for (const o of dados.ocorrencias.slice(0, 200)) linhas.push(`| \\`${o.relPath}\\` | ${o.linha || '-'} | ${o.nivel || 'info'} | ${o.tipo || ''} | ${(o.mensagem || '').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ')} |`);\n }\n linhas.push('', '*Gerado por Tutanus v0.7.0*');\n return linhas.join('\\n');\n}\n\nexport function gerarRelatorioHtml(dados: DadosRelatorioGitLabCI, opcoes?: { titulo?: string }): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - GitLab CI';\n const sc = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html><html lang=\"pt-BR\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"><title>${titulo}</title><style>*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0d1117;color:#c9d1d9;padding:2rem}.container{max-width:1200px;margin:0 auto}h1{color:#e24329;margin-bottom:.5rem}h2{color:#e24329;margin:2rem 0 1rem;border-bottom:1px solid #21262d;padding-bottom:.5rem}.meta{color:#8b949e;margin-bottom:2rem}.score-card{background:#161b22;border:1px solid #30363d;border-radius:12px;padding:2rem;text-align:center;margin-bottom:2rem}.score-value{font-size:4rem;font-weight:bold;color:${sc}}.score-label{color:#8b949e;font-size:1.2rem}table{width:100%;border-collapse:collapse;margin:1rem 0}th{background:#161b22;color:#e24329;padding:.75rem 1rem;text-align:left;border-bottom:2px solid #30363d}td{padding:.75rem 1rem;border-bottom:1px solid #21262d}tr:hover{background:#161b22}.badge{padding:.25rem .5rem;border-radius:12px;font-size:.85rem;font-weight:600}.badge-erro{background:rgba(239,68,68,.2);color:#ef4444}.badge-aviso{background:rgba(245,158,11,.2);color:#f59e0b}.badge-info{background:rgba(56,139,253,.2);color:#388bfd}.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin:1rem 0}.summary-item{background:#161b22;border:1px solid #30363d;border-radius:8px;padding:1rem}.summary-item .label{color:#8b949e;font-size:.85rem}.summary-item .value{font-size:1.5rem;font-weight:bold;color:#e24329}.footer{margin-top:3rem;padding-top:1rem;border-top:1px solid #21262d;color:#8b949e;font-size:.85rem;text-align:center}code{background:#161b22;padding:.2rem .4rem;border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:.9em}</style></head><body><div class=\"container\"><h1>${titulo}</h1><div class=\"meta\"><p><strong>Repositório:</strong> ${dados.nomeRepositorio} | <strong>Data:</strong> ${dados.dataAnalise} | <strong>Tempo:</strong> ${dados.tempoAnaliseMs}ms</p></div><div class=\"score-card\"><div class=\"score-value\">${dados.scoreGeral}</div><div class=\"score-label\">Score (0-100)</div></div><h2>Resumo</h2><div class=\"summary-grid\"><div class=\"summary-item\"><div class=\"label\">Pipelines</div><div class=\"value\">${dados.totalPipelines}</div></div><div class=\"summary-item\"><div class=\"label\">Ocorrências</div><div class=\"value\">${dados.ocorrencias.length}</div></div>${Object.entries(dados.resumoPorSeveridade).map(([s, c]) => `<div class=\"summary-item\"><div class=\"label\">${s}</div><div class=\"value\">${c}</div></div>`).join('')}</div><h2>Pipelines</h2><table><thead><tr><th>Pipeline</th><th>Score</th><th>Ocorrências</th></tr></thead><tbody>${dados.pipelines.map(p => `<tr><td>${p.nome}</td><td style=\"color:${p.score>=80?'#10b981':p.score>=50?'#f59e0b':'#ef4444'};font-weight:bold\">${p.score}/100</td><td>${p.ocorrencias}</td></tr>`).join('')}</tbody></table><h2>Ocorrências</h2><table><thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead><tbody>${dados.ocorrencias.slice(0,200).map(o => `<tr><td><code>${o.relPath}</code></td><td>${o.linha||'-'}</td><td><span class=\"badge badge-${o.nivel||'info'}\">${o.nivel||'info'}</span></td><td>${o.tipo||''}</td><td>${o.mensagem||''}</td></tr>`).join('')}</tbody></table>${dados.ocorrencias.length>200?`<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length}</p>`:''}<div class=\"footer\"><p>Gerado por Tutanus v0.7.0</p></div></div></body></html>`;\n}\n\nexport function gerarRelatorioCsv(dados: DadosRelatorioGitLabCI): string {\n const linhas = ['Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao'];\n for (const o of dados.ocorrencias) linhas.push([o.relPath, String(o.linha || ''), o.nivel || 'info', o.tipo || '', `\"${(o.mensagem||'').replace(/\"/g,'\"\"')}\"`, `\"${(o.sugestao||'').replace(/\"/g,'\"\"')}\"`].join(','));\n return linhas.join('\\n');\n}\n\nexport async function gerarRelatorio(dados: DadosRelatorioGitLabCI, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json': return gerarRelatorioJson(dados);\n case 'markdown': return gerarRelatorioMarkdown(dados, { titulo: opcoes.titulo, incluirDetalhes: opcoes.incluirDetalhes });\n case 'html': return gerarRelatorioHtml(dados, { titulo: opcoes.titulo });\n case 'csv': return gerarRelatorioCsv(dados);\n default: throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n fs.mkdirSync(path.dirname(opcoes.output), { recursive: true });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\n\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, pipelines?: Array<{ nome: string; score: number; ocorrencias: number }>): DadosRelatorioGitLabCI {\n const pList = pipelines || [];\n const resumo: Record<string, number> = {};\n const resumoTipo: Record<string, number> = {};\n for (const o of ocorrencias) {\n resumo[String(o.nivel || 'info')] = (resumo[String(o.nivel || 'info')] || 0) + 1;\n resumoTipo[o.tipo || 'desconhecido'] = (resumoTipo[o.tipo || 'desconhecido'] || 0) + 1;\n }\n const scoreGeral = pList.length > 0 ? Math.round(pList.reduce((s, p) => s + p.score, 0) / pList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return { nomeRepositorio, dataAnalise: new Date().toISOString(), totalPipelines: pList.length || 1, scoreGeral, ocorrencias, resumoPorSeveridade: resumo, resumoPorTipo: resumoTipo, pipelines: pList, tempoAnaliseMs };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"generator-report-jenkins.d.ts","sourceRoot":"","sources":["../../../../src/analysts/jenkins/reports/generator-report-jenkins.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAEjG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAepI;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAIrG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAItE;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAa3G;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,qBAAqB,CAUpN"}
1
+ {"version":3,"file":"generator-report-jenkins.d.ts","sourceRoot":"","sources":["../../../../src/analysts/jenkins/reports/generator-report-jenkins.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAEjG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAepI;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAIrG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAItE;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAa3G;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,UAAU,EAAE,EA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AAM,CAAC,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACjF,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACzF,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpJ,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,iBAAiB,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AAChO,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { messages } from '@core/messages';\nimport type { Ocorrencia } from '@';\n\nimport type { DadosRelatorioJenkins, OpcoesRelatorio } from '../../../types/analysts/jenkins.js';\n\nexport function gerarRelatorioJson(dados: DadosRelatorioJenkins): string {\n return JSON.stringify({ $schema: 'tutanus://schemas/jenkins-report/v1', geradoEm: new Date().toISOString(), versao: '0.7.0', ...dados }, null, 2);\n}\n\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioJenkins, opcoes?: { titulo?: string; incluirDetalhes?: boolean }): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - Jenkins';\n linhas.push(`# ${titulo}`, '', `**Repositório:** ${dados.nomeRepositorio}`, `**Data:** ${dados.dataAnalise}`, `**Tempo:** ${dados.tempoAnaliseMs}ms`, '');\n linhas.push('## Resumo', '', '| Métrica | Valor |', '|---|---|', `| Score Geral | ${dados.scoreGeral}/100 |`, `| Total de Jenkinsfiles | ${dados.totalJenkinsfiles} |`, `| Total de Ocorrências | ${dados.ocorrencias.length} |`, '');\n linhas.push('## Severidade', '', '| Severidade | Quantidade |', '|---|---|');\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) linhas.push(`| ${sev} | ${count} |`);\n linhas.push('', '## Jenkinsfiles Analisados', '', '| Jenkinsfile | Score | Ocorrências |', '|---|---|---|');\n for (const j of dados.jenkinsfiles) linhas.push(`| ${j.nome} | ${j.score}/100 | ${j.ocorrencias} |`);\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('', '## Ocorrências Detalhadas', '', '| Arquivo | Linha | Severidade | Tipo | Mensagem |', '|---|---|---|---|---|');\n for (const o of dados.ocorrencias.slice(0, 200)) linhas.push(`| \\`${o.relPath}\\` | ${o.linha || '-'} | ${o.nivel || 'info'} | ${o.tipo || ''} | ${(o.mensagem || '').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ')} |`);\n }\n linhas.push('', '*Gerado por Tutanus v0.7.0*');\n return linhas.join('\\n');\n}\n\nexport function gerarRelatorioHtml(dados: DadosRelatorioJenkins, opcoes?: { titulo?: string }): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - Jenkins';\n const sc = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html><html lang=\"pt-BR\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"><title>${titulo}</title><style>*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0d1117;color:#c9d1d9;padding:2rem}.container{max-width:1200px;margin:0 auto}h1{color:#d33833;margin-bottom:.5rem}h2{color:#d33833;margin:2rem 0 1rem;border-bottom:1px solid #21262d;padding-bottom:.5rem}.meta{color:#8b949e;margin-bottom:2rem}.score-card{background:#161b22;border:1px solid #30363d;border-radius:12px;padding:2rem;text-align:center;margin-bottom:2rem}.score-value{font-size:4rem;font-weight:bold;color:${sc}}.score-label{color:#8b949e;font-size:1.2rem}table{width:100%;border-collapse:collapse;margin:1rem 0}th{background:#161b22;color:#d33833;padding:.75rem 1rem;text-align:left;border-bottom:2px solid #30363d}td{padding:.75rem 1rem;border-bottom:1px solid #21262d}tr:hover{background:#161b22}.badge{padding:.25rem .5rem;border-radius:12px;font-size:.85rem;font-weight:600}.badge-erro{background:rgba(239,68,68,.2);color:#ef4444}.badge-aviso{background:rgba(245,158,11,.2);color:#f59e0b}.badge-info{background:rgba(56,139,253,.2);color:#388bfd}.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin:1rem 0}.summary-item{background:#161b22;border:1px solid #30363d;border-radius:8px;padding:1rem}.summary-item .label{color:#8b949e;font-size:.85rem}.summary-item .value{font-size:1.5rem;font-weight:bold;color:#d33833}.footer{margin-top:3rem;padding-top:1rem;border-top:1px solid #21262d;color:#8b949e;font-size:.85rem;text-align:center}code{background:#161b22;padding:.2rem .4rem;border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:.9em}</style></head><body><div class=\"container\"><h1>${titulo}</h1><div class=\"meta\"><p><strong>Repositório:</strong> ${dados.nomeRepositorio} | <strong>Data:</strong> ${dados.dataAnalise} | <strong>Tempo:</strong> ${dados.tempoAnaliseMs}ms</p></div><div class=\"score-card\"><div class=\"score-value\">${dados.scoreGeral}</div><div class=\"score-label\">Score (0-100)</div></div><h2>Resumo</h2><div class=\"summary-grid\"><div class=\"summary-item\"><div class=\"label\">Jenkinsfiles</div><div class=\"value\">${dados.totalJenkinsfiles}</div></div><div class=\"summary-item\"><div class=\"label\">Ocorrências</div><div class=\"value\">${dados.ocorrencias.length}</div></div>${Object.entries(dados.resumoPorSeveridade).map(([s, c]) => `<div class=\"summary-item\"><div class=\"label\">${s}</div><div class=\"value\">${c}</div></div>`).join('')}</div><h2>Jenkinsfiles</h2><table><thead><tr><th>Jenkinsfile</th><th>Score</th><th>Ocorrências</th></tr></thead><tbody>${dados.jenkinsfiles.map(p => `<tr><td>${p.nome}</td><td style=\"color:${p.score>=80?'#10b981':p.score>=50?'#f59e0b':'#ef4444'};font-weight:bold\">${p.score}/100</td><td>${p.ocorrencias}</td></tr>`).join('')}</tbody></table><h2>Ocorrências</h2><table><thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead><tbody>${dados.ocorrencias.slice(0,200).map(o => `<tr><td><code>${o.relPath}</code></td><td>${o.linha||'-'}</td><td><span class=\"badge badge-${o.nivel||'info'}\">${o.nivel||'info'}</span></td><td>${o.tipo||''}</td><td>${o.mensagem||''}</td></tr>`).join('')}</tbody></table>${dados.ocorrencias.length>200?`<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length}</p>`:''}<div class=\"footer\"><p>Gerado por Tutanus v0.7.0</p></div></div></body></html>`;\n}\n\nexport function gerarRelatorioCsv(dados: DadosRelatorioJenkins): string {\n const linhas = ['Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao'];\n for (const o of dados.ocorrencias) linhas.push([o.relPath, String(o.linha || ''), o.nivel || 'info', o.tipo || '', `\"${(o.mensagem||'').replace(/\"/g,'\"\"')}\"`, `\"${(o.sugestao||'').replace(/\"/g,'\"\"')}\"`].join(','));\n return linhas.join('\\n');\n}\n\nexport async function gerarRelatorio(dados: DadosRelatorioJenkins, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json': return gerarRelatorioJson(dados);\n case 'markdown': return gerarRelatorioMarkdown(dados, { titulo: opcoes.titulo, incluirDetalhes: opcoes.incluirDetalhes });\n case 'html': return gerarRelatorioHtml(dados, { titulo: opcoes.titulo });\n case 'csv': return gerarRelatorioCsv(dados);\n default: throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n fs.mkdirSync(path.dirname(opcoes.output), { recursive: true });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\n\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, jenkinsfiles?: Array<{ nome: string; score: number; ocorrencias: number }>): DadosRelatorioJenkins {\n const jList = jenkinsfiles || [];\n const resumo: Record<string, number> = {};\n const resumoTipo: Record<string, number> = {};\n for (const o of ocorrencias) {\n resumo[String(o.nivel || 'info')] = (resumo[String(o.nivel || 'info')] || 0) + 1;\n resumoTipo[o.tipo || 'desconhecido'] = (resumoTipo[o.tipo || 'desconhecido'] || 0) + 1;\n }\n const scoreGeral = jList.length > 0 ? Math.round(jList.reduce((s, j) => s + j.score, 0) / jList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return { nomeRepositorio, dataAnalise: new Date().toISOString(), totalJenkinsfiles: jList.length || 1, scoreGeral, ocorrencias, resumoPorSeveridade: resumo, resumoPorTipo: resumoTipo, jenkinsfiles: jList, tempoAnaliseMs };\n}\n"]}
1
+ {"version":3,"file":"generator-report-jenkins.js","sourceRoot":"","sources":["../../../../src/analysts/jenkins/reports/generator-report-jenkins.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,MAAM,UAAU,kBAAkB,CAAC,KAA4B;IAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,E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C,EAAE,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpJ,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,iBAAiB,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AAChO,CAAC","sourcesContent":["// SPDX-License-Identifier: MIT\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { messages } from '@core/messages';\n\nimport type { Ocorrencia } from '@';\n\nimport type { DadosRelatorioJenkins, OpcoesRelatorio } from '../../../types/analysts/jenkins.js';\n\nexport function gerarRelatorioJson(dados: DadosRelatorioJenkins): string {\n return JSON.stringify({ $schema: 'tutanus://schemas/jenkins-report/v1', geradoEm: new Date().toISOString(), versao: '0.7.0', ...dados }, null, 2);\n}\n\nexport function gerarRelatorioMarkdown(dados: DadosRelatorioJenkins, opcoes?: { titulo?: string; incluirDetalhes?: boolean }): string {\n const linhas: string[] = [];\n const titulo = opcoes?.titulo || 'Relatório de Análise - Jenkins';\n linhas.push(`# ${titulo}`, '', `**Repositório:** ${dados.nomeRepositorio}`, `**Data:** ${dados.dataAnalise}`, `**Tempo:** ${dados.tempoAnaliseMs}ms`, '');\n linhas.push('## Resumo', '', '| Métrica | Valor |', '|---|---|', `| Score Geral | ${dados.scoreGeral}/100 |`, `| Total de Jenkinsfiles | ${dados.totalJenkinsfiles} |`, `| Total de Ocorrências | ${dados.ocorrencias.length} |`, '');\n linhas.push('## Severidade', '', '| Severidade | Quantidade |', '|---|---|');\n for (const [sev, count] of Object.entries(dados.resumoPorSeveridade)) linhas.push(`| ${sev} | ${count} |`);\n linhas.push('', '## Jenkinsfiles Analisados', '', '| Jenkinsfile | Score | Ocorrências |', '|---|---|---|');\n for (const j of dados.jenkinsfiles) linhas.push(`| ${j.nome} | ${j.score}/100 | ${j.ocorrencias} |`);\n if (opcoes?.incluirDetalhes !== false && dados.ocorrencias.length > 0) {\n linhas.push('', '## Ocorrências Detalhadas', '', '| Arquivo | Linha | Severidade | Tipo | Mensagem |', '|---|---|---|---|---|');\n for (const o of dados.ocorrencias.slice(0, 200)) linhas.push(`| \\`${o.relPath}\\` | ${o.linha || '-'} | ${o.nivel || 'info'} | ${o.tipo || ''} | ${(o.mensagem || '').replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ')} |`);\n }\n linhas.push('', '*Gerado por Tutanus v0.7.0*');\n return linhas.join('\\n');\n}\n\nexport function gerarRelatorioHtml(dados: DadosRelatorioJenkins, opcoes?: { titulo?: string }): string {\n const titulo = opcoes?.titulo || 'Relatório de Análise - Jenkins';\n const sc = dados.scoreGeral >= 80 ? '#10b981' : dados.scoreGeral >= 50 ? '#f59e0b' : '#ef4444';\n return `<!DOCTYPE html><html lang=\"pt-BR\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"><title>${titulo}</title><style>*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0d1117;color:#c9d1d9;padding:2rem}.container{max-width:1200px;margin:0 auto}h1{color:#d33833;margin-bottom:.5rem}h2{color:#d33833;margin:2rem 0 1rem;border-bottom:1px solid #21262d;padding-bottom:.5rem}.meta{color:#8b949e;margin-bottom:2rem}.score-card{background:#161b22;border:1px solid #30363d;border-radius:12px;padding:2rem;text-align:center;margin-bottom:2rem}.score-value{font-size:4rem;font-weight:bold;color:${sc}}.score-label{color:#8b949e;font-size:1.2rem}table{width:100%;border-collapse:collapse;margin:1rem 0}th{background:#161b22;color:#d33833;padding:.75rem 1rem;text-align:left;border-bottom:2px solid #30363d}td{padding:.75rem 1rem;border-bottom:1px solid #21262d}tr:hover{background:#161b22}.badge{padding:.25rem .5rem;border-radius:12px;font-size:.85rem;font-weight:600}.badge-erro{background:rgba(239,68,68,.2);color:#ef4444}.badge-aviso{background:rgba(245,158,11,.2);color:#f59e0b}.badge-info{background:rgba(56,139,253,.2);color:#388bfd}.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin:1rem 0}.summary-item{background:#161b22;border:1px solid #30363d;border-radius:8px;padding:1rem}.summary-item .label{color:#8b949e;font-size:.85rem}.summary-item .value{font-size:1.5rem;font-weight:bold;color:#d33833}.footer{margin-top:3rem;padding-top:1rem;border-top:1px solid #21262d;color:#8b949e;font-size:.85rem;text-align:center}code{background:#161b22;padding:.2rem .4rem;border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:.9em}</style></head><body><div class=\"container\"><h1>${titulo}</h1><div class=\"meta\"><p><strong>Repositório:</strong> ${dados.nomeRepositorio} | <strong>Data:</strong> ${dados.dataAnalise} | <strong>Tempo:</strong> ${dados.tempoAnaliseMs}ms</p></div><div class=\"score-card\"><div class=\"score-value\">${dados.scoreGeral}</div><div class=\"score-label\">Score (0-100)</div></div><h2>Resumo</h2><div class=\"summary-grid\"><div class=\"summary-item\"><div class=\"label\">Jenkinsfiles</div><div class=\"value\">${dados.totalJenkinsfiles}</div></div><div class=\"summary-item\"><div class=\"label\">Ocorrências</div><div class=\"value\">${dados.ocorrencias.length}</div></div>${Object.entries(dados.resumoPorSeveridade).map(([s, c]) => `<div class=\"summary-item\"><div class=\"label\">${s}</div><div class=\"value\">${c}</div></div>`).join('')}</div><h2>Jenkinsfiles</h2><table><thead><tr><th>Jenkinsfile</th><th>Score</th><th>Ocorrências</th></tr></thead><tbody>${dados.jenkinsfiles.map(p => `<tr><td>${p.nome}</td><td style=\"color:${p.score>=80?'#10b981':p.score>=50?'#f59e0b':'#ef4444'};font-weight:bold\">${p.score}/100</td><td>${p.ocorrencias}</td></tr>`).join('')}</tbody></table><h2>Ocorrências</h2><table><thead><tr><th>Arquivo</th><th>Linha</th><th>Severidade</th><th>Tipo</th><th>Mensagem</th></tr></thead><tbody>${dados.ocorrencias.slice(0,200).map(o => `<tr><td><code>${o.relPath}</code></td><td>${o.linha||'-'}</td><td><span class=\"badge badge-${o.nivel||'info'}\">${o.nivel||'info'}</span></td><td>${o.tipo||''}</td><td>${o.mensagem||''}</td></tr>`).join('')}</tbody></table>${dados.ocorrencias.length>200?`<p style=\"color:#8b949e;margin-top:1rem\">Mostrando 200 de ${dados.ocorrencias.length}</p>`:''}<div class=\"footer\"><p>Gerado por Tutanus v0.7.0</p></div></div></body></html>`;\n}\n\nexport function gerarRelatorioCsv(dados: DadosRelatorioJenkins): string {\n const linhas = ['Arquivo,Linha,Severidade,Tipo,Mensagem,Sugestao'];\n for (const o of dados.ocorrencias) linhas.push([o.relPath, String(o.linha || ''), o.nivel || 'info', o.tipo || '', `\"${(o.mensagem||'').replace(/\"/g,'\"\"')}\"`, `\"${(o.sugestao||'').replace(/\"/g,'\"\"')}\"`].join(','));\n return linhas.join('\\n');\n}\n\nexport async function gerarRelatorio(dados: DadosRelatorioJenkins, opcoes: OpcoesRelatorio): Promise<string> {\n const conteudo = (() => {\n switch (opcoes.formato) {\n case 'json': return gerarRelatorioJson(dados);\n case 'markdown': return gerarRelatorioMarkdown(dados, { titulo: opcoes.titulo, incluirDetalhes: opcoes.incluirDetalhes });\n case 'html': return gerarRelatorioHtml(dados, { titulo: opcoes.titulo });\n case 'csv': return gerarRelatorioCsv(dados);\n default: throw new Error(messages.ExcecoesMensagens.formatoNaoSuportado(opcoes.formato));\n }\n })();\n fs.mkdirSync(path.dirname(opcoes.output), { recursive: true });\n fs.writeFileSync(opcoes.output, conteudo, 'utf-8');\n return opcoes.output;\n}\n\nexport function prepararDadosRelatorio(ocorrencias: Ocorrencia[], nomeRepositorio: string, tempoAnaliseMs: number, jenkinsfiles?: Array<{ nome: string; score: number; ocorrencias: number }>): DadosRelatorioJenkins {\n const jList = jenkinsfiles || [];\n const resumo: Record<string, number> = {};\n const resumoTipo: Record<string, number> = {};\n for (const o of ocorrencias) {\n resumo[String(o.nivel || 'info')] = (resumo[String(o.nivel || 'info')] || 0) + 1;\n resumoTipo[o.tipo || 'desconhecido'] = (resumoTipo[o.tipo || 'desconhecido'] || 0) + 1;\n }\n const scoreGeral = jList.length > 0 ? Math.round(jList.reduce((s, j) => s + j.score, 0) / jList.length) : Math.max(0, 100 - ocorrencias.length * 5);\n return { nomeRepositorio, dataAnalise: new Date().toISOString(), totalJenkinsfiles: jList.length || 1, scoreGeral, ocorrencias, resumoPorSeveridade: resumo, resumoPorTipo: resumoTipo, jenkinsfiles: jList, tempoAnaliseMs };\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  import { messages } from '../../../core/messages/index.js';
2
2
  import { Router } from 'express';
3
- const { GithubDashboardMensagens } = messages;
4
3
  import { listarConfigsInstalacao, obterConfigInstalacao, salvarConfigInstalacao } from '../app/installation-store.js';
5
4
  import { buildSetupUrl, createSetupRouter } from '../app/setup-routes.js';
6
5
  import { analisarWorkflows, buscarWorkflows } from '../app/webhook-handler.js';
7
6
  import { criarJob, iniciarAnaliseCompleta, iniciarAutoFix, listarJobs, obterJob } from '../jobs/index.js';
8
7
  import { statsStore } from './stats-store.js';
8
+ const { GithubDashboardMensagens } = messages;
9
9
  const HTTP_BAD_REQUEST = 400;
10
10
  const HTTP_NOT_FOUND = 404;
11
11
  const DEFAULT_SCORE = 100;