diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php
index ff82940e58aecd75c722ea2a7d926bf76b50c46f..7a986a3c7ee0ef6b1f83cb0eda77002ae027ea4c 100644
--- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php
+++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/DependenciesShowFrameworkCommandTest.php
@@ -21,7 +21,9 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase
 
     public function setUp()
     {
-        $this->command = new DependenciesShowFrameworkCommand();
+        $directoryList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+            ->create('Magento\Framework\App\Filesystem\DirectoryList', ['root' => BP]);
+        $this->command = new DependenciesShowFrameworkCommand($directoryList);
         $this->commandTester = new CommandTester($this->command);
     }
 
diff --git a/setup/src/Magento/Setup/Console/Command/AbstractDependenciesCommand.php b/setup/src/Magento/Setup/Console/Command/AbstractDependenciesCommand.php
index ab64345470ab8e8e1912855699f3bbb6ba76e0eb..5a604c2e8eb9a6a94a246d63f5dfb7ce47bbabfb 100644
--- a/setup/src/Magento/Setup/Console/Command/AbstractDependenciesCommand.php
+++ b/setup/src/Magento/Setup/Console/Command/AbstractDependenciesCommand.php
@@ -11,6 +11,9 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
+/**
+ * Abstract class for dependency report commands
+ */
 abstract class AbstractDependenciesCommand extends Command
 {
     /**
diff --git a/setup/src/Magento/Setup/Console/Command/DependenciesShowFrameworkCommand.php b/setup/src/Magento/Setup/Console/Command/DependenciesShowFrameworkCommand.php
index af16b59bc9b2f45d383cbec1f355312b3cd9a04f..c665ff7f3edcc419ddba64600a0cb8c58b73b67e 100644
--- a/setup/src/Magento/Setup/Console/Command/DependenciesShowFrameworkCommand.php
+++ b/setup/src/Magento/Setup/Console/Command/DependenciesShowFrameworkCommand.php
@@ -5,6 +5,7 @@
  */
 namespace Magento\Setup\Console\Command;
 
+use Magento\Framework\App\Filesystem\DirectoryList;
 use Magento\Framework\App\Utility\Files;
 use Magento\Setup\Module\Dependency\ServiceLocator;
 
@@ -13,6 +14,22 @@ use Magento\Setup\Module\Dependency\ServiceLocator;
  */
 class DependenciesShowFrameworkCommand extends AbstractDependenciesCommand
 {
+    /**
+     * @var DirectoryList
+     */
+    private $directoryList;
+
+    /**
+     * Constructor
+     *
+     * @param DirectoryList $directoryList
+     */
+    public function __construct(DirectoryList $directoryList)
+    {
+        $this->directoryList = $directoryList;
+        parent::__construct();
+    }
+
     /**
      * {@inheritdoc}
      */
@@ -41,7 +58,13 @@ class DependenciesShowFrameworkCommand extends AbstractDependenciesCommand
      */
     protected function buildReport($outputPath)
     {
-        $filesForParse = Files::init()->getFiles([Files::init()->getPathToSource() . '/app/code/Magento'], '*');
+        $root = $this->directoryList->getRoot();
+        $filePath = str_replace(
+            $root,
+            Files::init()->getPathToSource(),
+            $this->directoryList->getPath(DirectoryList::MODULES) . '/Magento'
+        );
+        $filesForParse = Files::init()->getFiles([$filePath], '*');
         $configFiles = Files::init()->getConfigFiles('module.xml', [], false);
 
         ServiceLocator::getFrameworkDependenciesReportBuilder()->build(