{"record":{"id":"b4910fd230fdf1b6","repo":"badges/shields","slug":"no-analyses-found","errorCode":null,"errorMessage":"no analyses found","messagePattern":"no analyses found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"warning","filePath":"services/symfony/symfony-insight-base.js","lineNumber":86,"sourceCode":"          headers: { Accept: 'application/vnd.com.sensiolabs.insight+xml' },\n        },\n        httpErrors: {\n          401: 'not authorized to access project',\n          404: 'project not found',\n        },\n        parserOptions: {\n          attributeNamePrefix: '',\n          ignoreAttributes: false,\n        },\n      }),\n    )\n  }\n\n  transform({ data }) {\n    const lastAnalysis = data.project['last-analysis']\n\n    if (!lastAnalysis) {\n      throw new NotFound({ prettyMessage: 'no analyses found' })\n    }\n\n    let numViolations = 0\n    let numCriticalViolations = 0\n    let numMajorViolations = 0\n    let numMinorViolations = 0\n    let numInfoViolations = 0\n\n    const violationContainer = lastAnalysis.violations\n    if (violationContainer && violationContainer.violation) {\n      let violations = []\n      // See above note on schema RE: https://github.com/NaturalIntelligence/fast-xml-parser/issues/68\n      // This covers the scenario of multiple violations which are parsed as an array and single\n      // violations which is parsed as a single object.\n      if (Array.isArray(violationContainer.violation)) {\n        violations = violationContainer.violation\n      } else {\n        violations.push(violationContainer.violation)","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/symfony/symfony-insight-base.js#L68-L104","documentation":"SymfonyInsight badges call `transform({ data })` which reads `data.project['last-analysis']`. When the project has never been analyzed (or the API returns no analysis payload), a NotFound 'no analyses found' is thrown by both the grade/status badges and `lastAnalysis`.","triggerScenarios":"Requesting /symfony-insight/grade/<project_uuid> (or status/coverage variants) where the SensioLabs/Insight PHP API response has no 'last-analysis' key — typically a project UUID whose first analysis hasn't finished or never ran.","commonSituations":"Typo in the project UUID; project created but analysis still queued/running on SymfonyInsight; API token lacking access so the API returns a stub project object without analyses; project deleted.","solutions":["Verify the project UUID on the SymfonyInsight project page and confirm at least one analysis has completed","Wait for the first analysis to finish (or trigger one) before embedding the badge","Check the SYMFONY_API_TOKEN / user has access to the project so the API returns full data","Query the API manually (GET /api/projects/<uuid>) to confirm data.project['last-analysis'] exists"],"exampleFix":"// before\n/badge/symfony-insight/grade/f0f5f0c0-0000-0000-0000-000000000000  // project never analyzed\n// after: run the first analysis on insight.symfony.com, then use the same badge URL","handlingStrategy":"try-catch","validationCode":"const proj = await fetch(`https://insight.symfony.com/api/projects/${uuid}`, { headers: { Authorization: `token ${token}` } }).then(r => r.json());\nif (!proj.data?.project?.['last-analysis']) throw new Error('project has no completed analysis yet');","typeGuard":"const hasAnalysis = (apiJson) => Boolean(apiJson?.data?.project?.['last-analysis']);","tryCatchPattern":"try {\n  return await symfonyInsightGrade({ uuid });\n} catch (err) {\n  if (err prettyMessage === 'no analyses found') {\n    // render 'no analysis' badge or trigger an analysis and retry later\n  } else throw err;\n}","preventionTips":["Only embed badges for projects with at least one completed analysis","Verify the project UUID on the SymfonyInsight dashboard","Ensure the API token grants access to the project so full data is returned"],"tags":["symfony-insight","not-found","analysis","third-party-api"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}