How to ignore duplicate code in certain directories/extensions?

We are using SonarCloud and we would like to disable duplicate code detection on our translation files, ie. we want to ignore certain directories. Is there a way to configure this?

Take a look at these docs.

I should have clarified: I do not want to exclude these files from other checks (they might contain PHP syntax errors f.e.). I only want to exclude them from duplicate code checks. In the docs I didn’t find how to do this, in case it is possible at all.

Double-check the section called Restrict the scope duplication detection

doh … sorry and thank you for your patience.
I was searching for “duplicate code”.

I am unable to get this to work.

I have sonar.cpd.exclusions=./resources/lang/*/* in my sonar-project.properties file in the root of my project. I also set the same setting in → Administration → General Settings → Analysis Scope → Duplication Exclusions

But I am still getting duplications shown for a file under ./resources/lang/en/content.php

A glob pattern that excludes all files in all folders under resources/lang would be resources/lang/**/*

awesome that worked. which setting has preferences btw (from the Administration or config file)?

Any setting made in a configuration file will override settings made in the UI.