Method transactionalUp
has 82 lines of code (exceeds 25 allowed). Consider refactoring. protected function transactionalUp ( YoPdo $yo_pdo )
{
$sql = << < SQL
CREATE SEQUENCE buffered_jobs_buffered_job_id_seq;
CREATE SEQUENCE failed_jobs_failed_job_id_seq;
Method transactionalUp
has 55 lines of code (exceeds 25 allowed). Consider refactoring. protected function transactionalUp ( YoPdo $yo_pdo )
{
$sql = << < SQL
CREATE TABLE scheduled_jobs
(
Method addDefaultServices
has 44 lines of code (exceeds 25 allowed). Consider refactoring. public function addDefaultServices ( $config_file = null )
{
$this -> addConfigFileService ( $config_file ) ;
$this [ 'hodor.config.factory' ] = $this -> share (
Avoid excessively long variable names like $job_options_validator. Keep variable name length under 20. private $job_options_validator ;
Avoid excessively long variable names like $config_loader_factory. Keep variable name length under 20. $config_loader_factory = new LoaderFactory ( ) ;
Avoid excessively long variable names like $adapter_factory_config. Keep variable name length under 20. private $adapter_factory_config ;
Avoid excessively long variable names like $adapter_factory_config. Keep variable name length under 20. public function __construct ( QueueConfig $queue_config , array $adapter_factory_config = [ ] )
Method processScheduledJobs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. private function processScheduledJobs ( )
{
$sql = << < SQL
INSERT INTO buffered_jobs
(
Avoid using short method names like Migration::up(). The configured minimum method name length is 3. public function up ( )
{
* @var $container Container
*/
Avoid using short method names like PgsqlPhpmigAdapter::up(). The configured minimum method name length is 3. public function up ( Migration $migration )
{
$migration_reflection = new ReflectionClass ( get_class ( $migration ) ) ;
$this -> yo_pdo -> insert ( 'migrations.migrations' , [
Method configure
has 32 lines of code (exceeds 25 allowed). Consider refactoring. protected function configure ( )
{
$this
-> setName ( 'test:generate-config' )
-> setDescription ( 'Generate a config file for tests' )
Method markJobAsFinished
has 28 lines of code (exceeds 25 allowed). Consider refactoring. private function markJobAsFinished ( $status , array $meta )
{
$sql = << < SQL
SELECT *
FROM queued_jobs
Method getJobsToRunGenerator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. public function getJobsToRunGenerator ( )
{
$this -> processScheduledJobs ( ) ;
$sql = << < SQL
Method transactionalUp
has 27 lines of code (exceeds 25 allowed). Consider refactoring. protected function transactionalUp ( YoPdo $yo_pdo )
{
$sql = << < SQL
ALTER TABLE buffered_jobs
ADD COLUMN mutex_id VARCHAR DEFAULT 'hodor:' || currval ( 'buffered_jobs_buffered_job_id_seq' :: regclass ) ;
Method bufferJob
has 26 lines of code (exceeds 25 allowed). Consider refactoring. public function bufferJob ( $queue_name , array $job )
{
$table_name = 'buffered_jobs' ;
$status_column = 'inserted' ;
if ( isset ( $job [ 'options' ] [ 'run_after' ] ) ) {
Method down
has 26 lines of code (exceeds 25 allowed). Consider refactoring. public function down ( Migration $migration )
{
$version = $migration -> getVersion ( ) ;
$sql = << < SQL
SELECT *
Avoid variables with short names like $db. Configured minimum length is 3. $db = $this -> database ;
The class QueueManager has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13. class QueueManager
{
* @param Config
*/
Function getJobsToRunGenerator
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. public function getJobsToRunGenerator ( )
{
$buffered_jobs = $this -> sortBufferedJobs (
$this -> filterFutureJobs ( $this -> database -> getAll ( 'buffered_jobs' ) )
) ;
Avoid too many return
statements within this method. return $container [ 'phpmig.adapter' ] -> getMigrationsPath ( ) ;