Hi,
here https://github.com/magento/magento2/blob/develop/app/code/Magento/SampleData/Model/Dependency.php#L89, you assume that the composer.json file for every module must be at the same level of the module itself. Even if in core modules this is always true it might not be true for third party modules.
A well known best practice is to have source code in the src
folder so it could be the root path of a module (look at https://github.com/aleron75/mage2hints or https://github.com/webgriffe/module-config-override).
Can you fix this wrong assumption?