Skip to content

Why aren't duplication metrics being calculated?#

For performance reasons, Codacy skips the calculation of code duplication for programming languages that have more than 5000 source code files in a 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 doesn't 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.

    Duplication in the Files page

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

    New duplication for a commit

  • The analysis logs for commits won't display a duplication analysis task for the tool corresponding to the affected language.

    Analysis logs for a commit

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

  1. 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 aren't 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 wasn't calculated, follow the next steps:

  • If you're using Codacy Self-hosted, open the Admin panel, Repositories, select the repository, tab Settings, 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.

    Resetting the failed duplication analysis

  • If you're analyzing your repository locally with the Codacy Analysis CLI, consider using the flag --tool-timeout to specify a larger timeout for the execution of the tool.

  • If you're using Codacy Cloud or if the steps above didn't solve the issue, please contact us at 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.

Edit this page on GitHub if you notice something wrong or missing.

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

Last modified March 7, 2023