Showing 105 of 970 total issues
Function apply
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function apply(Repository $repository, array $patches)
{
$packages = $this->packageCollector->collect($repository);
$packagesUpdated = false;
$repositoryState = $this->repoStateGenerator->generate($repository);
- 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 14 (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 getPackageMap
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getPackageMap()
{
if ($this->packages === null) {
$result = 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 scanOutputForFailures
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function scanOutputForFailures($output, $separatorMatcher, array $failureMessages)
{
$patternsWithResults = array_filter($failureMessages, function ($pattern) use ($output) {
return $pattern && preg_match($pattern, $output);
});
- 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 collectPatchFilesFromPackages
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function collectPatchFilesFromPackages(array $matches, Config $pluginConfig)
{
$composer = $this->getComposer();
$composerConfig = $composer->getConfig();
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 execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('<info>Scanning packages for orphan patches</info>');
$composer = $this->getComposer();
Method resolveComparisonResults
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function resolveComparisonResults(array $patchConstraints, array $packages, array $rootRequires)
{
$comparisonResults = array();
foreach ($patchConstraints as $constraintTarget => $version) {
Function mergeAppliers
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function mergeAppliers(array $config, array $updates)
{
foreach ($config[Config::PATCHER_APPLIERS] as $code => $operations) {
if (!isset($updates[Config::PATCHER_APPLIERS][$code])) {
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 collectTargets
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function collectTargets($packagesByName, $packagePatches)
{
$result = array();
foreach ($packagePatches as $index => $info) {
- 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 createOutputRows
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function createOutputRows(array $errors)
{
$lines = array();
foreach ($errors as $type => $groups) {
- 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 create
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create(array $configSources = array())
{
$defaults = array_replace(
$this->defaultsProvider->getPatcherConfig(),
$this->defaults,
Method composerFilteredPatchesList
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function composerFilteredPatchesList($patches, $additions, $removals, $withAffected, $filters, $statuses)
{
$hasFilers = (bool)array_filter($filters);
$listResolver = new ListResolvers\FilteredListResolver($filters);
Function process
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function process(array $patches, array $packagesByName)
{
$rootPackages = array_filter(
$packagesByName,
function ($package) {
- 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 applyPatches
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function applyPatches(PackageInterface $package, array $patchesQueue)
{
$appliedPatches = array();
foreach ($patchesQueue as $source => $info) {
- 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 applyDefinitionKeyValueFilter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function applyDefinitionKeyValueFilter(array $patches, $filter, $key)
{
foreach ($patches as &$packagePatches) {
foreach ($packagePatches as &$patchInfo) {
if (!isset($patchInfo[$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
Function process
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function process(array $patches, array $packagesByName)
{
/** @var \Composer\Package\CompletePackageInterface $rootPackage */
$packages = $this->constraintPackages;
- 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 process
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function process(array $patches, array $packagesByName)
{
foreach ($patches as &$packagePatches) {
foreach ($packagePatches as &$data) {
if ($data[PatchDefinition::URL]) {
- 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 process
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function process(array $patches, array $packagesByName)
{
$ownerName = $this->ownerPackage->getName();
$relativePath = PathUtils::composePath($ownerName, 'downloads');
$absolutePath = PathUtils::composePath($this->vendorDir, $relativePath);
- 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 updateStatusMarkers
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function updateStatusMarkers($patches, $repositoryState)
{
$patchesByTarget = $this->patchListTransformer->createTargetsList(array_map('array_filter', $patches));
$patchFootprints = $this->patchListTransformer->createSimplifiedList($patchesByTarget);