Skip to content
This documentation applies to Codacy Self-hosted v5.0.0

For the latest updates and improvements, see the latest Cloud documentation instead.

Troubleshooting common issues#

The sections below provide instructions or workarounds to overcome common issues while using Codacy Coverage Reporter.

No coverage data is visible on the Codacy UI#

If the Codacy Coverage Reporter correctly uploaded your coverage report but the coverage data doesn't show up on the Codacy UI, please validate the following:

  • Make sure that the file paths included in your coverage reports are relative to the root directory of your repository. For example, src/index.js.
  • Verify that the Codacy Coverage Reporter is uploading the coverage data for the correct commit in the correct branch.

Commit SHA hash detection#

The Codacy Coverage Reporter automatically detects the commit SHA hash to associate with the coverage data from the following CI/CD platforms:

  • Appveyor
  • Azure Pipelines
  • Bitrise
  • Buildkite
  • Circle CI
  • Codefresh
  • Codeship
  • Docker
  • GitLab
  • Greenhouse CI
  • Heroku CI
  • Jenkins
  • Magnum CI
  • Semaphore CI
  • Shippable CI
  • Solano CI
  • TeamCity CI
  • Travis CI
  • Wercker CI

If the Codacy Coverage Reporter fails to detect the current commit from the CI workflow context, it will use the current commit from the local Git repository instead.

However, you can also force using a specific commit SHA hash with the flag --commit-uuid. For example:

bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
    -r report.xml \
    --commit-uuid cd4d000083a744cf1617d46af4ec108b79e06bed

Can't guess any report due to no matching#

Codacy Coverage Reporter automatically searches for coverage reports matching the file name conventions for supported formats.

However, if Codacy Coverage Reporter does not find your coverage report, you can explicitly define the report file name with the flag -r. For example:

bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r <coverage report file name>

Report generated an empty result while uploading C# coverage data#

If you're using dotCover to generate coverage reports for your C# projects, you must use the dotCover detailedXML report format as follows:

dotCover.exe cover ... --reportType=DetailedXml

JsonParseException while uploading coverage data#

If you're getting a com.fasterxml.jackson.core.JsonParseException error while uploading your coverage data to Codacy it means that your coverage report is too big and that Codacy Coverage Reporter hit a limit of 10 MB when uploading the coverage data to Codacy.

There are some ways you can solve this:

  • Split your coverage reports into smaller files and upload them to Codacy one at a time.

  • If you're using dotCover to generate coverage reports for your C# projects, you should exclude xUnit files from the coverage analysis as follows:

    dotCover.exe cover ... /Filters=-:xunit*
    

    By default, dotCover includes xUnit files in the coverage analysis and this results in larger coverage reports. This filter helps ensure that the resulting coverage data does not exceed the size limit accepted by the Codacy API when uploading the results.

MalformedInputException while parsing report#

If you get a java.nio.charset.MalformedInputException when running the Codacy Coverage Reporter it means that the coverage report includes an unsupported character, perhaps on one of your source code file names.

For maximum compatibility of your coverage reports with the Codacy Coverage Reporter, make sure that your coverage reports use UTF-8 encoding or remove any special characters from the reports.

SubstrateSegfaultHandler caught signal 11#

If you're experiencing segmentation faults when uploading the coverage results due to oracle/graal#624, execute the following command before running the reporter, as a workaround:

echo "$(dig +short api.codacy.com | tail -n1) api.codacy.com" >> /etc/hosts

coverage-xml/index.xml generated an empty result#

If you're using PHPUnit version 5 or above to generate your coverage report, you must output the report using the Clover format. Codacy Coverage Reporter supports the PHPUnit XML format only for versions 4 and older.

To change the output format replace the flag --coverage-xml <dir> with --coverage-clover <file> when executing phpunit.

See PHPUnit command-line documentation for more information.

Can't validate checksum#

Starting on version 13.0.0 the get.sh script automatically validates the checksum of the downloaded Codacy Coverage Reporter binary. This requires having either the sha512sum or shasum command on the operating system where you're running the script.

If you're getting this error while uploading your coverage data to Codacy, install the correct version of sha512sum or shasum for the operating system that you're using.

You can also skip validating the checksum of the binary by defining the following environment variable, however, Codacy doesn't recommend this:

export CODACY_REPORTER_SKIP_CHECKSUM=true

Share your feedback 📢

Did this page help you?

Thanks for the feedback! Is there anything else you'd like to tell us about this page?

We're sorry to hear that. Please let us know what we can improve:

Alternatively, you can create a more detailed issue on our GitHub repository.

Thanks for helping improve the Codacy documentation.

If you have a question or need help please contact support@codacy.com.

Last modified October 13, 2021