vaimo/composer-patches

View on GitHub

Showing 105 of 970 total issues

Function updateStatusMarkers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateStatusMarkers($patches, $repositoryState)
    {
        $patchesByTarget = $this->patchListTransformer->createTargetsList(array_map('array_filter', $patches));
        $patchFootprints = $this->patchListTransformer->createSimplifiedList($patchesByTarget);

Severity: Minor
Found in src/Repository/PatchesApplier/QueueGenerator.php - About 35 mins to fix

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 createDetailedList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function createDetailedList(array $patches)
    {
        $result = array();

        $labelInfoMatcher = sprintf('/%s:(?P<hash>.*)/', Patch::HASH);
Severity: Minor
Found in src/Patch/DefinitionList/Transformer.php - About 35 mins to fix

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 mirrorConfigValues has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function mirrorConfigValues(array $config, array $keyMap)
    {
        if (isset($config[Keys::PATCHER_CONFIG_ROOT])) {
            $patcherConfig = (array)$config[Keys::PATCHER_CONFIG_ROOT];

Severity: Minor
Found in src/Patcher/ConfigReader.php - About 35 mins to fix

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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $composer = $this->getComposer();

        $isDevMode = !$input->getOption('no-dev');
Severity: Minor
Found in src/Composer/Commands/ListCommand.php - About 35 mins to fix

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 updateStatusLabels has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateStatusLabels(array $queue, array $labels)
    {
        foreach ($queue as $target => $group) {
            foreach ($group as $path => $item) {
                $status = isset($item[Patch::STATUS])
Severity: Minor
Found in src/Repository/PatchesApplier.php - About 35 mins to fix

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 applyDefinitionFilter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function applyDefinitionFilter(array $patches, \Closure $logicProvider)
    {
        foreach ($patches as &$packagePatches) {
            foreach ($packagePatches as &$patchData) {
                $result = $logicProvider($patchData);
Severity: Minor
Found in src/Utils/PatchListUtils.php - About 35 mins to fix

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 filterListByTargets has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterListByTargets(array $patches, array $targets)
    {
        foreach ($patches as $target => $group) {
            foreach ($group as $path => $patch) {
                if (array_intersect($patch[Patch::TARGETS], $targets)) {
Severity: Minor
Found in src/Utils/PatchListUtils.php - About 35 mins to fix

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 collectValueMutationRules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function collectValueMutationRules($template, array $patterns)
    {
        $result = array();

        foreach ($patterns as $pattern) {
Severity: Minor
Found in src/Utils/TemplateUtils.php - About 35 mins to fix

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 resolveForNamespace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function resolveForNamespace(array $packages, $namespace)
    {
        $packages = array_merge($this->additionalPackages, $packages);

        foreach ($packages as $package) {
Severity: Minor
Found in src/Composer/Plugin/PackageResolver.php - About 35 mins to fix

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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(array $patches, array $packagesByName)
    {
        foreach ($patches as &$packagePatches) {
            foreach ($packagePatches as &$patchData) {
                if (!$patchData[PatchDefinition::SKIP]) {
Severity: Minor
Found in src/Patch/DefinitionList/LoaderComponents/LocalExcludeComponent.php - About 35 mins to fix

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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(array $patches, array $packagesByName)
    {
        $excludedPatches = array();

        foreach ($this->config as $patchOwner => $patchPaths) {
Severity: Minor
Found in src/Patch/DefinitionList/LoaderComponents/GlobalExcludeComponent.php - About 35 mins to fix

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

Avoid too many return statements within this method.
Open

        return $templates;
Severity: Major
Found in src/Patch/Definition/NormalizerComponents/BasePathComponent.php - About 30 mins to fix

    Function getValueByPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getValueByPath(array $data, $path, $default = null)
        {
            if (!is_array($path)) {
                $path = explode('/', $path);
            }
    Severity: Minor
    Found in src/Utils/DataUtils.php - About 25 mins to fix

    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 compose has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function compose($template, array $arguments, array $variableFormats)
        {
            $updateGroups = array();
    
            foreach ($variableFormats as $format => $escapers) {
    Severity: Minor
    Found in src/Utils/TemplateUtils.php - About 25 mins to fix

    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 executeOperations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        private function executeOperations(
            array $patchers,
            array $operations,
            array $args = array(),
            array $failures = array()
    Severity: Minor
    Found in src/Patch/File/Applier.php - About 25 mins to fix

    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 listToGroups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function listToGroups(array $items, $keyMatcher)
        {
            $result = array();
    
            $key = '';
    Severity: Minor
    Found in src/Utils/DataUtils.php - About 25 mins to fix

    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 prioritizeContentErrors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        private function prioritizeContentErrors(array $errors)
        {
            $filters = array(
                'can\'t find file',
                'unable to find file',
    Severity: Minor
    Found in src/Console/OutputGenerator.php - About 25 mins to fix

    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 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function process(array $patches, array $packagesByName)
        {
            $validatedPatches = array();
    
            foreach ($patches as $patchTarget => $packagePatches) {
    Severity: Minor
    Found in src/Patch/DefinitionList/LoaderComponents/ValidatorComponent.php - About 25 mins to fix

    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 applyFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function applyFile($filename, $cwd, array $config = array())
        {
            $applierConfig = $this->applierUtils->mergeApplierConfig($this->config, array_filter($config));
            $applierConfig = $this->applierUtils->sortApplierConfig($applierConfig);
            $patchers = $this->extractArrayValue($applierConfig, PluginConfig::PATCHER_APPLIERS);
    Severity: Minor
    Found in src/Patch/File/Applier.php - About 25 mins to fix

    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 resolvePatcherConfigBase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        private function resolvePatcherConfigBase(array $extra, $rootKey)
        {
            $patcherConfig = isset($extra[$rootKey]) ? $extra[$rootKey] : array();
    
            if ($patcherConfig === false) {
    Severity: Minor
    Found in src/Factories/ConfigFactory.php - About 25 mins to fix

    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

    Severity
    Category
    Status
    Source
    Language