vaimo/composer-patches

View on GitHub

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();
Severity: Minor
Found in src/Patch/Definition/NormalizerComponents/DependencyComponent.php - About 1 hr to fix

    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) {
    Severity: Minor
    Found in src/Patch/DefinitionList/LoaderComponents/ConstraintsComponent.php - About 1 hr to fix

      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');
      Severity: Minor
      Found in src/Utils/FilterUtils.php - About 1 hr to fix

        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) {
        Severity: Minor
        Found in src/Utils/TemplateUtils.php - About 1 hr to fix

          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',
          Severity: Minor
          Found in src/Console/OutputGenerator.php - About 1 hr to fix

            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,
            Severity: Major
            Found in src/Repository/PatchesApplier.php - About 1 hr to fix

              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()
              Severity: Minor
              Found in src/Patch/File/Applier.php - About 1 hr to fix

                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) {
                Severity: Minor
                Found in src/Package/PatchApplier.php - About 1 hr to fix

                  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);
                  Severity: Minor
                  Found in src/Patch/SourceLoaders/PatchesSearch.php - About 1 hr to fix

                    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();
                    Severity: Minor
                    Found in src/Patch/DefinitionList/Analyser.php - About 1 hr 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 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();
                    Severity: Minor
                    Found in src/Patch/Definition/NormalizerComponents/DependencyComponent.php - About 1 hr 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 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()
                    Severity: Minor
                    Found in src/Patch/File/Applier.php - About 1 hr 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 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;
                    Severity: Minor
                    Found in src/Patch/SourceLoaders/PatchesSearch.php - About 1 hr 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 createOriginList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function createOriginList(array $patchesList)
                        {
                            $result = array();
                    
                            foreach ($patchesList as $group) {
                    Severity: Minor
                    Found in src/Patch/DefinitionList/Transformer.php - About 1 hr 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 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);

                    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);

                    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) {
                    Severity: Minor
                    Found in src/Patch/DefinitionList/LoaderComponents/PlatformComponent.php - About 1 hr 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

                    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();
                    
                    
                    Severity: Minor
                    Found in src/Plugin.php - About 1 hr to fix

                      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])) {
                      Severity: Minor
                      Found in src/Package/InfoResolver.php - About 1 hr to fix

                        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) {
                          Severity
                          Category
                          Status
                          Source
                          Language