herroffizier/yiiq

View on GitHub

Showing 9 of 9 total issues

Function loop has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    protected function loop()
    {
        $count  = count($this->queues);
        $queue  = null;
        $job    = null;
Severity: Minor
Found in src/commands/Worker.php - About 2 hrs 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

Function actionStatus has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function actionStatus()
    {
        $status = 0;
        $pids = \Yii::app()->yiiq->pools->pids->getData();
        if ($pids) {
Severity: Minor
Found in src/commands/Main.php - About 1 hr 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

Method run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        $job = $this->job;

        // Try to fork process.
Severity: Minor
Found in src/jobs/Runner.php - About 1 hr to fix

    Method actionStatus has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function actionStatus()
        {
            $status = 0;
            $pids = \Yii::app()->yiiq->pools->pids->getData();
            if ($pids) {
    Severity: Minor
    Found in src/commands/Main.php - About 1 hr to fix

      Function checkForStoppedJobs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function checkForStoppedJobs($log)
          {
              if ($log) {
                  echo "Checking for stopped jobs... ";
              }
      Severity: Minor
      Found in src/util/Health.php - About 45 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

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

          public function enqueueAt($timestamp, $class, array $args = [], $queue = self::DEFAULT_QUEUE, $id = null)
      Severity: Minor
      Found in src/Yiiq.php - About 35 mins to fix

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

            public function enqueueAfter($interval, $class, array $args = [], $queue = self::DEFAULT_QUEUE, $id = null)
        Severity: Minor
        Found in src/Yiiq.php - About 35 mins to fix

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

              public function enqueueEach($interval, $class, array $args = [], $queue = self::DEFAULT_QUEUE, $id = null)
          Severity: Minor
          Found in src/Yiiq.php - About 35 mins to fix

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

                public function actionStop()
                {
                    \Yii::app()->yiiq->health->check();
                    $pids = \Yii::app()->yiiq->pools->pids->getData();
                    if ($pids) {
            Severity: Minor
            Found in src/commands/Main.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