src/Package/InfoResolver.php
Method getInstallPath
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getInstallPath(PackageInterface $package, $resolveMode)
{
$key = $package->getName() . '|' . $resolveMode;
if (!isset($this->installPathCache[$key])) {
Function resolveNamesFromPaths
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function resolveNamesFromPaths(array $packagesByName, array $paths)
{
$paths = array_unique(
array_map('dirname', $paths)
);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getInstallPath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getInstallPath(PackageInterface $package, $resolveMode)
{
$key = $package->getName() . '|' . $resolveMode;
if (!isset($this->installPathCache[$key])) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Parameter $package
has undeclared type \Composer\Package\PackageInterface
Open
Open
public function getAutoLoadPaths(PackageInterface $package)
- Exclude checks
Call to method getInstallPath
from undeclared class \Composer\Installer\InstallationManager
Open
Open
? $this->installationManager->getInstallPath($package)
- Exclude checks
Call to method getComposerFile
from undeclared class \Composer\Factory
Open
Open
: realpath(dirname(\Composer\Factory::getComposerFile()));
- Exclude checks
Call to method getAutoload
from undeclared class \Composer\Package\PackageInterface
Open
Open
$autoloadConfig = $package->getAutoload();
- Exclude checks
Call to method getAutoload
from undeclared class \Composer\Package\PackageInterface
Open
Open
$autoloadConfig = $package->getAutoload();
- Exclude checks
Property \Vaimo\ComposerPatches\Package\InfoResolver->installationManager
has undeclared type \Composer\Installer\InstallationManager
Open
Open
private $installationManager;
- Exclude checks
Parameter $package
has undeclared type \Composer\Package\PackageInterface
Open
Open
public function getSourcePath(PackageInterface $package)
- Exclude checks
Parameter $installationManager
has undeclared type \Composer\Installer\InstallationManager
Open
Open
public function __construct(
- Exclude checks
Checking instanceof against undeclared class \Composer\Package\RootPackageInterface
Open
Open
return !$package instanceof \Composer\Package\RootPackageInterface
- Exclude checks
Parameter $package
has undeclared type \Composer\Package\PackageInterface
Open
Open
public function getInstallPath(PackageInterface $package, $resolveMode)
- Exclude checks
Checking instanceof against undeclared class \Composer\Package\RootPackageInterface
Open
Open
$this->installPathCache[$key] = $package instanceof \Composer\Package\RootPackageInterface
- Exclude checks
Call to method getName
from undeclared class \Composer\Package\PackageInterface
Open
Open
$key = $package->getName() . '|' . $resolveMode;
- Exclude checks