lightster/hodor

View on GitHub
src/Hodor/Database/Adapter/Testing/Superqueuer.php

Summary

Maintainability
A
1 hr
Test Coverage

Showing 3 of 3 total issues

Function getJobsToRunGenerator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public function getJobsToRunGenerator()
{
$buffered_jobs = $this->sortBufferedJobs(
$this->filterFutureJobs($this->database->getAll('buffered_jobs'))
);
Severity: Minor
Found in src/Hodor/Database/Adapter/Testing/Superqueuer.php - About 35 mins to fix

Avoid too many return statements within this method.
Open

return $buffered_jobs;
Severity: Major
Found in src/Hodor/Database/Adapter/Testing/Superqueuer.php - About 30 mins to fix

Avoid assigning values to variables in if clauses and the like (line '139', column '17').
Open

private function sortBufferedJobs(array $buffered_jobs)
{
$compare_jobs = function ($field, array $job_a, array $job_b) {
if ($job_a[$field] == $job_b[$field]) {
return 0;
Category
Status