yiicod/yii2-jobqueue

View on GitHub

Showing 5 of 7 total issues

MongoThreadQueue has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class MongoThreadQueue extends Queue implements QueueContract
{
    /**
     * @var int
     */
Severity: Minor
Found in queues/MongoThreadQueue.php - About 2 hrs to fix

    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function __construct(Connection $database, $table, $default = 'default', $expire = 60, $limit = 15)
    Severity: Minor
    Found in queues/MongoThreadQueue.php - About 35 mins to fix

      Method later has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function later($delay, $job, $data = '', $queue = null, $connection = null)
      Severity: Minor
      Found in JobQueue.php - About 35 mins to fix

        Method laterUnique has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function laterUnique($delay, $job, $data = '', $queue = null, $connection = null)
        Severity: Minor
        Found in JobQueue.php - About 35 mins to fix

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

              public function daemon($connectionName, $queue, WorkerOptions $options)
              {
                  while (true) {
                      if ($this->shouldQuit) {
                          $this->kill();
          Severity: Minor
          Found in Worker.php - About 35 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language