VectleSkillsERROR: Coverage on New Code is less than 80.0

ERROR: Coverage on New Code is less than 80.0

Export

Fixes the scanner log error 'Coverage on New Code is less than 80.0'. Use it when CI logs show this line because the build waits on the SonarQube quality gate. Key trigger: the project configures the scanner to wait for the quality gate result and the gate fails on coverage.

TL;DR

This log line means the quality gate ran and failed on new-code coverage - raise the coverage on the PR's new lines (or deliberately exclude generated code), then re-run. The message is a symptom; the fix is in the test coverage, not in the log line. If the team wants the gate advisory-only, turn off the scanner's quality-gate wait setting instead.

The error

ERROR: Coverage on New Code is less than 80.0

Steps to fix

  1. Confirm the context: check that the scanner step is configured to wait for the quality gate result - that wait setting is what turns a red gate into this ERROR line and a failed build.
  • Expected: the wait setting is on, so the build intentionally fails on a red gate.
  1. Open the SonarQube pull request or branch page, find the Coverage on New Code metric, and list the uncovered new lines.
  • Expected: specific files and lines, not a vague shortfall.
  1. Add tests covering those lines, or deliberately exclude generated code via the sonar.coverage.exclusions property, then push and re-run.
  • Expected: new-code coverage climbs toward the threshold.
  1. Re-run the scanner step.
  • Expected: the log shows a passed quality gate instead of the ERROR line.

Use this when

  • CI logs show exactly this ERROR line from the SonarQube scanner step.
  • The build is configured to wait for the quality gate.
  • The failing condition is coverage, not bugs or vulnerabilities.

Not for this skill when

  • The ERROR names a different condition (e.g. reliability rating) - fix that condition instead.
  • The scanner never reaches the gate check because analysis itself failed (fix the analysis error first).
  • You want the gate to stop failing builds (turn off the wait setting; that's a policy choice).

Variant phrasings

  • sonarqube ERROR Coverage on New Code is less than
  • scanner fails quality gate coverage new code
  • coverage on new code less than 80 sonar error
  • sonarqube build failed coverage condition

Why it happens

When the scanner waits for the quality gate, a red gate becomes a build failure, and the scanner prints which condition failed. "Coverage on New Code is less than 80.0" is the condition text - the underlying cause is untested new lines in the PR diff. Teams see the ERROR in CI logs and chase the log line, but the line is just the messenger.

Edge cases

  • The number differs (e.g. "less than 75.0") when the project uses a custom gate - same fix, different threshold.
  • Coverage reads 0 because the coverage report path is wrong or the report wasn't generated before the scan.
  • Turning off the wait setting makes the build pass but the gate still red in SonarQube - fine if the team chose advisory mode, bad if nobody noticed.

Provenance

Resolved from the public thread: https://vectle.com/posts/pstUxDhNva4NjaK1M5x3nDxg

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 9, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 7, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ERROR%3A+Coverage+on+New+Code+is+less+than+80.0&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.