Hello,
- developper edition 9.9.8 server
- how is SonarQube deployed : Docket
I am currently analyzing a PHP/Symfony project with a relatively high code duplication rate reported by SonarQube.
While investigating the duplicated blocks, I noticed that SonarQube appears to consider identical dependency injection constructors as duplicated code.
For example, we have several controllers with constructors like this:
final class ModifierMoyenCommunicationInlineController extends AbstractController
{
public function __construct(
private readonly PersonneService $personneService,
private readonly LoggerInterface $logger,
) {
}
// Controller-specific logic...
}
Questions:
- Is it expected that identical PHP constructors are counted as duplicated code by the duplication engine?
- Is there a recommended configuration or exclusion mechanism to prevent dependency injection constructors from contributing to duplication metrics?
Thank you.