badges/shields · warning · NotFound

no analyses found

Error message

no analyses found

What it means

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`.

Source

Thrown at services/symfony/symfony-insight-base.js:86

          headers: { Accept: 'application/vnd.com.sensiolabs.insight+xml' },
        },
        httpErrors: {
          401: 'not authorized to access project',
          404: 'project not found',
        },
        parserOptions: {
          attributeNamePrefix: '',
          ignoreAttributes: false,
        },
      }),
    )
  }

  transform({ data }) {
    const lastAnalysis = data.project['last-analysis']

    if (!lastAnalysis) {
      throw new NotFound({ prettyMessage: 'no analyses found' })
    }

    let numViolations = 0
    let numCriticalViolations = 0
    let numMajorViolations = 0
    let numMinorViolations = 0
    let numInfoViolations = 0

    const violationContainer = lastAnalysis.violations
    if (violationContainer && violationContainer.violation) {
      let violations = []
      // See above note on schema RE: https://github.com/NaturalIntelligence/fast-xml-parser/issues/68
      // This covers the scenario of multiple violations which are parsed as an array and single
      // violations which is parsed as a single object.
      if (Array.isArray(violationContainer.violation)) {
        violations = violationContainer.violation
      } else {
        violations.push(violationContainer.violation)

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Verify the project UUID on the SymfonyInsight project page and confirm at least one analysis has completed
  2. Wait for the first analysis to finish (or trigger one) before embedding the badge
  3. Check the SYMFONY_API_TOKEN / user has access to the project so the API returns full data
  4. Query the API manually (GET /api/projects/<uuid>) to confirm data.project['last-analysis'] exists

Example fix

// before
/badge/symfony-insight/grade/f0f5f0c0-0000-0000-0000-000000000000  // project never analyzed
// after: run the first analysis on insight.symfony.com, then use the same badge URL
Defensive patterns

Strategy: try-catch

Validate before calling

const proj = await fetch(`https://insight.symfony.com/api/projects/${uuid}`, { headers: { Authorization: `token ${token}` } }).then(r => r.json());
if (!proj.data?.project?.['last-analysis']) throw new Error('project has no completed analysis yet');

Type guard

const hasAnalysis = (apiJson) => Boolean(apiJson?.data?.project?.['last-analysis']);

Try / catch

try {
  return await symfonyInsightGrade({ uuid });
} catch (err) {
  if (err prettyMessage === 'no analyses found') {
    // render 'no analysis' badge or trigger an analysis and retry later
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/b4910fd230fdf1b6. Report an issue: GitHub.