Showing 105 of 970 total issues
Method normalize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function normalize($target, $label, array $data, array $ownerConfig)
{
$depends = isset($data[PatchDefinition::DEPENDS])
? $data[PatchDefinition::DEPENDS]
: array();
Method process
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(array $patches, array $packagesByName)
{
$rootPackages = array_filter(
$packagesByName,
function ($package) {
Method composeRegex
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function composeRegex(array $filters, $delimiter)
{
$semanticGroups = array_fill_keys(array(0, 1), array());
$escapeChar = chr('27');
Method compose
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compose($template, array $arguments, array $variableFormats)
{
$updateGroups = array();
foreach ($variableFormats as $format => $escapers) {
Method prioritizeContentErrors
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function prioritizeContentErrors(array $errors)
{
$filters = array(
'can\'t find file',
'unable to find file',
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
\Composer\Composer $composer,
\Vaimo\ComposerPatches\Package\Collector $packageCollector,
\Vaimo\ComposerPatches\Managers\RepositoryManager $repositoryManager,
\Vaimo\ComposerPatches\Package\PatchApplier $patchApplier,
\Vaimo\ComposerPatches\Repository\PatchesApplier\QueueGenerator $queueGenerator,
Method resolveOperationOutput
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function resolveOperationOutput($applierOperations, $args, $operationFailures)
{
$variableFormats = array(
'{{%s}}' => array('escapeshellarg'),
'[[%s]]' => array()
Method applyPatches
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function applyPatches(PackageInterface $package, array $patchesQueue)
{
$appliedPatches = array();
foreach ($patchesQueue as $source => $info) {
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 getRelatedPatches
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getRelatedPatches(array $patchesList, array $targets)
{
$scanTargets = $targets;
$targetsStack = array();
- 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 normalize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function normalize($target, $label, array $data, array $ownerConfig)
{
$depends = isset($data[PatchDefinition::DEPENDS])
? $data[PatchDefinition::DEPENDS]
: array();
- 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 resolveOperationOutput
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function resolveOperationOutput($applierOperations, $args, $operationFailures)
{
$variableFormats = array(
'{{%s}}' => array('escapeshellarg'),
'[[%s]]' => array()
- 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 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 createOriginList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function createOriginList(array $patchesList)
{
$result = array();
foreach ($patchesList as $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
Function resolveInitialState
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function resolveInitialState(array $patches, array $state)
{
$unpackedState = $this->patchListTransformer->createDetailedList($state);
$patchesByTarget = $this->patchListTransformer->groupItemsByTarget($patches);
- 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 resolveInitialState
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function resolveInitialState(array $patches, array $state)
{
$patchesByTarget = $this->patchListTransformer->groupItemsByTarget($patches);
$unpackedState = $this->patchListTransformer->createDetailedList($state);
- 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 resolveComparisonResults
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function resolveComparisonResults(array $patchConstraints, array $packages)
{
$comparisonResults = array();
foreach ($patchConstraints as $constraintTarget => &$version) {
- 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 postInstall
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postInstall(\Composer\Script\Event $event)
{
if (!$this->bootstrap) {
$this->lockSanitizer->sanitize();
Method getInstallPath
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInstallPath(PackageInterface $package, $resolveMode)
{
$key = $package->getName() . '|' . $resolveMode;
if (!isset($this->installPathCache[$key])) {
Method process
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(array $patches, array $packagesByName)
{
$excludedPatches = array();
foreach ($this->config as $patchOwner => $patchPaths) {