Yii2 provides very nice debug tool. It shows all calls to database and also links to files where the database is being accessed. These link have a form of:
ide://open?url=file:///var/www/yii2-advanced/common/models/User.php&line=121
Firefox is unfortunately not able to open them by default. Do you how to open the link by single click? It would be much better to search the code in browser and once you know where is the problem, switch back to normal IDE.
I think that it needs to be configured in Firefox and is therefore more software not code related, but it is also very specific problem with Yii2 and the Yii2 community is mainly / only code related.