Thank you for reaching out, I was checking what changes may have caused such a performance penalty, and there is a commit that may have added computational complexity: Avoid nested paths in sonar.sources/sonar.tests.
In order to speed up the investigation it would be of help to have the logs and, more importantly, a reproducer. Could you provide such info? It would be great to have a zip file with a small project on which the scanner command takes longer than expected.
Based on the logs you provided, there seem to be a couple of unexpected behaviors playing together to create this long scan time. I have created two tickets to track these bugs here and here. We are planning to work on some related work soon anyway, during which we may well be able to address this issue.
Until this is fixed, I would suggest not upgrading to the latest plugin version in this particular case.
We have implemented several improvements for the Gradle scanner recently, including some targeting performance. We also made some other changes, such as removing the dependency on the compile task.
It is worth a try to see if it fixes your issue. Don’t hesitate to let us know if you see any unexpected results or behavior.