Code should not be duplicated

More information: https://insight.symfony.com/what-we-analyse/php.duplicated_code

  1. {
  2. parent::configure();
  3. $this
  4. ->setName('doctrine:migrations:execute')
  5. ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')

    The next 19 lines appear in src/Tomahawk/Bundle/DoctrineBundle/Command/Migrations/DoctrineExecuteCommand.php:42, src/Tomahawk/Bundle/DoctrineBundle/Command/Migrations/DoctrineGenerateCommand.php:42, src/Tomahawk/Bundle/DoctrineBundle/Command/Migrations/DoctrineLatestCommand.php:42, src/Tomahawk/Bundle/DoctrineBundle/Command/Migrations/DoctrineMigrateCommand.php:42, src/Tomahawk/Bundle/DoctrineBundle/Command/Migrations/DoctrineStatusCommand.php:42 and src/Tomahawk/Bundle/DoctrineBundle/Command/Migrations/DoctrineVersionCommand.php:42.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tom Ellis
  6. ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
  7. ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.')
  8. ;
  9. }
  10. public function execute(InputInterface $input, OutputInterface $output)
  • tomgrohl

    Ignored on Wed, 14 Sep 2016 08:17:13 GMT

Unused method, property, variable or parameter

More information: https://insight.symfony.com/what-we-analyse/php.unused_local_variable_or_private_member

  1. * Convert level to mongo constant
  2. *
  3. * @param $level
  4. * @return int|mixed
  5. */
  6. private function levelToMonologConst($level)

    This levelToMonologConst method is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tom Ellis
  7. {
  8. return is_int($level) ? $level : constant('Monolog\Logger::' . strtoupper($level));
  9. }
  10. }
  • tomgrohl

    Ignored on Wed, 14 Sep 2016 08:16:39 GMT