AOEpeople/StackFormation

View on GitHub
src/StackFormation/Command/Blueprint/DeployCommand.php

Summary

Maintainability
D
2 days
Test Coverage

Showing 6 of 6 total issues

Function executeWithBlueprint has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

protected function executeWithBlueprint(Blueprint $blueprint, InputInterface $input, OutputInterface $output)
{
$dryRun = $input->getOption('dryrun');
if ($dryRun) {
$formatter = new \Symfony\Component\Console\Helper\FormatterHelper();
Severity: Minor
Found in src/StackFormation/Command/Blueprint/DeployCommand.php - About 7 hrs to fix

Method executeWithBlueprint has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

protected function executeWithBlueprint(Blueprint $blueprint, InputInterface $input, OutputInterface $output)
{
$dryRun = $input->getOption('dryrun');
if ($dryRun) {
$formatter = new \Symfony\Component\Console\Helper\FormatterHelper();
Severity: Major
Found in src/StackFormation/Command/Blueprint/DeployCommand.php - About 4 hrs to fix

    Method configure has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    protected function configure()
    {
    $this
    ->setName('blueprint:deploy')
    ->setAliases(['deploy'])
    Severity: Minor
    Found in src/StackFormation/Command/Blueprint/DeployCommand.php - About 1 hr to fix

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      case 'CREATE_FAILED':
      if ($questionHelper->ask($input, $output, new ConfirmationQuestion('Stack is in CREATE_FAILED state. Do you want to delete it first? [Y/n]'))) {
      $output->writeln('Deleting failed stack ' . $stackName);
      $stack->delete();
      $observer = new Observer($stack, $stackFactory, $output);
      Severity: Major
      Found in src/StackFormation/Command/Blueprint/DeployCommand.php and 2 other locations - About 1 hr to fix
      src/StackFormation/Command/Blueprint/DeployCommand.php on lines 174..184
      src/StackFormation/Command/Blueprint/DeployCommand.php on lines 185..195

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      case 'UPDATE_ROLLBACK_FAILED':
      if ($questionHelper->ask($input, $output, new ConfirmationQuestion('Stack is in UPDATE_ROLLBACK_FAILED state. Do you want to continue the update rollback and deploy then? [Y/n]'))) {
      $output->writeln('Continuing update rollback for ' . $stackName);
      $stack->continueUpdateRollback();
      $observer = new Observer($stack, $stackFactory, $output);
      Severity: Major
      Found in src/StackFormation/Command/Blueprint/DeployCommand.php and 2 other locations - About 1 hr to fix
      src/StackFormation/Command/Blueprint/DeployCommand.php on lines 153..163
      src/StackFormation/Command/Blueprint/DeployCommand.php on lines 174..184

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      case 'UPDATE_IN_PROGRESS':
      if ($questionHelper->ask($input, $output, new ConfirmationQuestion('Stack is in UPDATE_IN_PROGRESS state. Do you want to cancel the current update and deploy then? [Y/n]'))) {
      $output->writeln('Cancelling update for ' . $stackName);
      $stack->cancelUpdate();
      $observer = new Observer($stack, $stackFactory, $output);
      Severity: Major
      Found in src/StackFormation/Command/Blueprint/DeployCommand.php and 2 other locations - About 1 hr to fix
      src/StackFormation/Command/Blueprint/DeployCommand.php on lines 153..163
      src/StackFormation/Command/Blueprint/DeployCommand.php on lines 185..195

      There are no issues that match your filters.

      Category
      Status