Next.js + Azure Pipelines – Missing coverage & PR analysis

Hi SonarCloud Team :waving_hand:

We’re using SonarCloud with a Next.js (TypeScript) application and Azure Pipelines. The analysis runs successfully, but we’re missing some important metrics and have a few questions.

Setup (brief)

  • Framework: Next.js

  • CI: Azure Pipelines (manual trigger)

  • Config: sonar-project.properties (file mode)

  • Main branch: master (long-lived branch)

    SonarCloud configuration

    sonar.projectKey=sample_org_nextjs_webapp
    sonar.organization=sample-org

    sonar.projectName=NextJS Web Application
    sonar.sourceEncoding=UTF-8

    Source and test configuration

    sonar.sources=.
    sonar.tests=src/tests
    sonar.test.inclusions=/*.test.ts,/*.test.tsx

    JavaScript / TypeScript coverage report

    sonar.javascript.lcov.reportPaths=coverage/lcov.info

    What we’re seeing

    • Coverage:
      “There are not enough lines to compute coverage”, even though tests run and coverage/lcov.info exists.

    • New Code / Quality Gate:
      Message says “No conditions set for New issues, duplications, security hotspots.”

    • Branches & PRs:
      master is shown as a long-lived branch.
      When we raise a PR, we’re unsure:

      • Which branch gets analyzed?

      • Is the PR compared against master automatically?

    Questions

    1. Which branch does SonarCloud analyze when a PR is created?

    2. Are there common reasons coverage is not picked up in Next.js projects?

    3. Is extra configuration needed for New Code conditions or PR analysis in Azure Pipelines?

      Any guidance or best practices would be really appreciated.
      Thanks a lot for your help!

Hi,

Welcome to the community!

We try to keep it to one topic per thread. Otherwise it can get messy, fast. You’ve got a lot going on here. What question would you like to pursue in this thread?

 
Ann