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

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

Why aren't duplication metrics being calculated?

For performance reasons, Codacy limits the analysis of code duplication to 5000 files of the same programming language in each repository.

Besides this, if Codacy fails to calculate code duplication for a specific programming language in a repository three times in a row (for example, because the tool calculating the analysis runs out of memory or times out), Codacy stops trying to analyze the metric for that language and repository.

When this happens, Codacy does not display code duplication metrics for the affected language:

  • The Files page on your repository displays a blank duplication value for files of the affected language.

  • The Commits and Pull Request pages display an empty New Duplication tab.

  • The analysis logs for commits will not display a duplication analysis task for the tool corresponding to the affected language.

As a workaround, if you are exceeding the maximum number of source code files:

  1. We recommend that you use a Codacy configuration file to exclude source code files of the affected language from your project to decrease the number of files to be analyzed.

    For example, you may be able to exclude files that are automatically generated from your test suite or files belonging to dependencies that are not maintained by your team, such as the node_modules folder for JavaScript projects.

  2. Reanalyze the last commit in the repository so that Codacy runs the code duplication analysis.

If the analysis finishes but the code duplication metric was not calculated, follow the next steps:

  • If you are using Codacy Self-hosted, open the Admin panel, Repositories, select the repository, and reset the code duplication analysis in Duplication settings. Then, reanalyze the last commit in the repository so that Codacy runs the code duplication analysis.

  • If you are analyzing your repository locally with codacy-analysis-cli, consider using the flag --tool-timeout to specify a larger timeout for the execution of the tool.

  • If you are using Codacy Cloud or if the steps above did not solve the issue, contact support@codacy.com.

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 November 17, 2020