Showing 15 of 17 total issues
JobContract
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class JobContract implements JobContractInterface
{
use InteractWithTimeTrait;
/**
MongoQueue
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class MongoQueue extends Queue
{
/**
* Job resolver
*
Method addConnections
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addConnections(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('namespaces')
Function execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$jobsCount = 0;
- Read upRead up
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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
JobResolverInterface $resolver,
MongoDriver $mongo,
string $collection,
string $queue = 'default',
int $expire = 60,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
JobResolverInterface $resolver,
RedisDriver $redis,
string $collection = 'queue_jobs',
string $queue = 'default',
int $expire = 60,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
int $delay = 0,
int $memory = 128,
int $timeout = 60,
int $sleep = 3,
int $maxTries = 0,
Method later
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function later($delay, string $job, array $data = [], string $queue = 'default', string $connection = 'default');
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct(QueueManager $queueManager,
JobProcess $process,
FailedJobProviderInterface $failer,
ExceptionHandlerInterface $exceptions,
EventDispatcherInterface $dispatcher)
Method laterUnique
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function laterUnique($delay, string $job, array $data = [], string $queue = 'default', string $connection = 'default');
Method later
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function later($delay, string $job, array $data = [], string $queue = 'default', string $connection = 'default')
Method buildJob
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function buildJob(string $id, string $queue, int $attempts, array $payload, ?int $reservedAt = null): Job
Method laterUnique
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function laterUnique($delay, string $job, array $data = [], string $queue = 'default', string $connection = 'default')
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
string $scriptName,
string $binPath,
string $environment = 'prod',
string $binary = 'php',
string $binaryArgs = '')
Function grabJobs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private function grabJobs(array $config, ContainerBuilder $container): array
{
$jobs = [];
foreach ($config['namespaces'] as $key => $namespace) {
$alias = $container->getParameter('kernel.project_dir') . '/../' . str_replace('\\', DIRECTORY_SEPARATOR, trim($namespace, '\\'));
- Read upRead up
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"