Showing 105 of 970 total issues
Method processPatchesForPackage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processPatchesForPackage(Repository $repository, Package $package, array $patchesQueue)
{
$processIndentation = $this->logger->push('~');
try {
Method validateOutput
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validateOutput($output, $operationFailures)
{
$pathMarker = '\|\+\+\+\s(?P<match>.*?)(\t|$)';
$pathMatcher = sprintf('/^%s/', $pathMarker);
Method collectTargets
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function collectTargets($packagesByName, $packagePatches)
{
$result = array();
foreach ($packagePatches as $index => $info) {
Function getNodeReferencesByPaths
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getNodeReferencesByPaths(array &$data, array $paths)
{
$stack = array();
foreach ($paths as $path) {
- 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 processOperationItems
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function processOperationItems($patcher, $operations, $args, $failures)
{
$operationResults = array_fill_keys(array_keys($operations), '');
$result = true;
- 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
Method downloadPackage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function downloadPackage($downloader, $package, $source, $destDir, $errorHandler, &$patchData, &$errors)
Function validateOutput
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function validateOutput($output, $operationFailures)
{
$pathMarker = '\|\+\+\+\s(?P<match>.*?)(\t|$)';
$pathMatcher = sprintf('/^%s/', $pathMarker);
- 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 resolveNamesFromPaths
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. 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
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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\Composer\Composer $composer,
\Composer\Package\PackageInterface $ownerPackage,
\Composer\Downloader\FileDownloader $downloadManager,
\Vaimo\ComposerPatches\Console\Silencer $consoleSilencer,
$vendorDir,
Function create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function create(array $configSources = array())
{
$defaults = array_replace(
$this->defaultsProvider->getPatcherConfig(),
$this->defaults,
- 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 parseContents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function parseContents($header)
{
$lines = explode(PHP_EOL, $header);
$key = 'label';
- 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 sanitize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function sanitize()
{
$lockData = $this->lockerManager->readLockData();
if (!$lockData) {
- 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 groupItemsByTarget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function groupItemsByTarget(array $patchesList)
{
$result = array();
foreach ($patchesList as $origin => $group) {
- 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
Method composerFilteredPatchesList
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function composerFilteredPatchesList($patches, $additions, $removals, $withAffected, $filters, $statuses)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
\Composer\EventDispatcher\EventDispatcher $eventDispatcher,
\Vaimo\ComposerPatches\Package\InfoResolver $packageInfoResolver,
\Vaimo\ComposerPatches\Interfaces\PatchFailureHandlerInterface $failureHandler,
\Vaimo\ComposerPatches\Patch\File\Applier $fileApplier,
\Vaimo\ComposerPatches\Logger $logger
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
\Vaimo\ComposerPatches\Composer\Context $composerContext,
\Composer\IO\IOInterface $appIO,
\Vaimo\ComposerPatches\Factories\ConfigFactory $configFactory,
\Vaimo\ComposerPatches\Interfaces\ListResolverInterface $listResolver = null,
\Vaimo\ComposerPatches\Strategies\OutputStrategy $outputStrategy = null
Function process
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function process($label, $data)
{
foreach ($this->components as $processor) {
if (!$processor->shouldProcess($label, $data)) {
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 getClosestDirForFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getClosestDirForFile($path, $fileName)
{
while (true) {
if (\is_dir($path) && \file_exists(PathUtils::composePath($path, $fileName))) {
return $path;
- 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 resolveSourceConfig
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function resolveSourceConfig($patcherConfig)
{
$sourceConfig = $patcherConfig[PluginConfig::PATCHER_SOURCES];
if (isset($sourceConfig['packages'], $sourceConfig['vendors'])) {
- 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"