Method createDefinitionItem
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createDefinitionItem($contents, array $values = array())
{
$header = $this->fileAnalyser->getHeader($contents);
$data = $this->applyAliases(
Method resolveBaseInfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function resolveBaseInfo(array $data)
{
$target = false;
list($package, $version, $depends) = $this->resolveBaseData($data);
Function applyAliases
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function applyAliases(array $data, array $aliases)
{
foreach ($aliases as $target => $origins) {
if (isset($data[$target])) {
continue;
- 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 createPatchDefinitions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function createPatchDefinitions($basePath, array $paths)
{
$groups = array();
$basePathLength = strlen($basePath);
- 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
Missing class import via use statement (line '80', column '38'). Open
$this->fileSystemUtils = new \Vaimo\ComposerPatches\Utils\FileSystemUtils();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '76', column '38'). Open
$this->patchFileLoader = new \Vaimo\ComposerPatches\Patch\File\Loader();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '79', column '40'). Open
$this->patchHeaderParser = new \Vaimo\ComposerPatches\Patch\File\Header\Parser();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '77', column '35'). Open
$this->fileAnalyser = new \Vaimo\ComposerPatches\Patch\File\Analyser();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Parameter $package
has undeclared type \Composer\Package\PackageInterface
Open
public function load(\Composer\Package\PackageInterface $package, $source)
- Exclude checks
Parameter $package
has undeclared type \Composer\Package\PackageInterface
Open
private function getInstallPath(\Composer\Package\PackageInterface $package)
- Exclude checks
Checking instanceof against undeclared class \Composer\Package\RootPackageInterface
Open
if ($package instanceof \Composer\Package\RootPackageInterface) {
- Exclude checks
Call to method getInstallPath
from undeclared class \Composer\Installer\InstallationManager
Open
return $this->installationManager->getInstallPath($package);
- Exclude checks
Property \Vaimo\ComposerPatches\Patch\SourceLoaders\PatchesSearch->installationManager
has undeclared type \Composer\Installer\InstallationManager
Open
private $installationManager;
- Exclude checks
Parameter $installationManager
has undeclared type \Composer\Installer\InstallationManager
Open
public function __construct(
- Exclude checks