YetiForceCompany/YetiForceCRM

View on GitHub
cron.php

Summary

Maintainability
A
0 mins
Test Coverage
F
58%

Cannot access self when not in object context
Open

            $cronTask->setCronInstance($cronInstance);
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            $cronInstance->log('Task start: ' . $cronTask->getName(), 'info', false);
Severity: Critical
Found in cron.php by phan

Call to method trace from undeclared class \App\Log
Open

            \App\Log::trace($cronTask->getName() . ' - Start', 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                $response .= sprintf('%s | %s - Cron task had timedout as it was not completed last time it run' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            if (!$cronTask->isRunnable()) {
Severity: Critical
Found in cron.php by phan

Reference to static property sapi from undeclared class \App\Utils\ConfReport
Open

\App\Utils\ConfReport::$sapi = 'cron';
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            $response .= sprintf('%s | %s - End task (%s s) | %s', date('Y-m-d H:i:s'), $cronTask->getName(), $taskTime, $cronHandler->getTaskLog()) . PHP_EOL;
Severity: Critical
Found in cron.php by phan

Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
Open

    App\User::setCurrentUserId(Users::getActiveAdminId());
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                $response .= sprintf("%s | %s - skipped \nCron execution time exceeded" . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                $response .= sprintf('%s | %s - Not ready to run as the time to run again is not completed' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            \App\Log::trace($cronTask->getName() . ' - End', 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            \App\Log::trace($cronTask->getName() . ' - Start', 'Cron');
Severity: Critical
Found in cron.php by phan

Call to method error from undeclared class \App\Log
Open

            \App\Log::error("Cron task '{$cronTask->getName()}' throwed exception: " . PHP_EOL . $e->__toString() . PHP_EOL, 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            echo sprintf('%s | ERROR: %s - Cron task throwed exception.', date('Y-m-d H:i:s'), $cronTask->getName()) . PHP_EOL;
Severity: Critical
Found in cron.php by phan

Call to method warning from undeclared class \App\Log
Open

                \App\Log::warning($cronTask->getName() . ' - The task returned a message:' . PHP_EOL . $taskResponse, 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            $cronTask->setError($response . PHP_EOL . $e->getMessage());
Severity: Critical
Found in cron.php by phan

Call to method trace from undeclared class \App\Log
Open

                \App\Log::trace($cronTask->getName() . ' - Task omitted, it has not been finished during the last scanning', 'Cron');
Severity: Critical
Found in cron.php by phan

Call to method trace from undeclared class \App\Log
Open

            \App\Log::trace($cronTask->getName() . ' - End', 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            $cronTask->markRunning();
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                \App\Log::warning($cronTask->getName() . ' - The task returned a message:' . PHP_EOL . $taskResponse, 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                    $cronTask->unlockTask();
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                \App\Log::trace($cronTask->getName() . ' - Task omitted, it has not been finished during the last scanning', 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                \App\Log::trace($cronTask->getName() . ' - Not ready to run as the time to run again is not completed', 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            \App\Log::error("Cron task '{$cronTask->getName()}' throwed exception: " . PHP_EOL . $e->__toString() . PHP_EOL, 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            $cronTask->refreshData();
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            if ($cronTask->hadTimeout()) {
Severity: Critical
Found in cron.php by phan

Assigning float to property but \App\Cron::$cronTimeStart is int|null
Open

    $cronInstance::$cronTimeStart = microtime(true);
Severity: Minor
Found in cron.php by phan

Cannot access self when not in object context
Open

            if ($cronTask->isRunning()) {
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                $response .= sprintf('%s | %s - Task omitted, it has not been finished during the last scanning' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Critical
Found in cron.php by phan

Call to method trace from undeclared class \App\Log
Open

                \App\Log::trace($cronTask->getName() . ' - Not ready to run as the time to run again is not completed', 'Cron');
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            $response .= sprintf('%s | %s - Start task' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            $cronTask->markFinished();
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            if ($cronTask->isDisabled()) {
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

                $response .= sprintf('%s | %s - Cron task had been disabled' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Critical
Found in cron.php by phan

Cannot access self when not in object context
Open

            $className = $cronTask->getHandlerClass();
Severity: Critical
Found in cron.php by phan

Define a constant instead of duplicating this literal "Y-m-d H:i:s" 11 times.
Open

    file_put_contents(__DIR__ . '/cache/logs/cron_error.log', date('Y-m-d H:i:s', (int) $init) . ' - ' . $e->getMessage() . PHP_EOL, LOCK_EX);
Severity: Critical
Found in cron.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Spaces must be used to indent lines; tabs are not allowed
Open

    App\User::setCurrentUserId(Users::getActiveAdminId());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $cronTask = vtlib\Cron::getInstance(\App\Request::_get('service'));
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $response .= sprintf('---------------  %s (init: %s) | Start CRON  ----------', date('Y-m-d H:i:s'), date('H:i:s', (int) $init)) . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    file_put_contents(__DIR__ . '/cache/logs/cron_error.log', date('Y-m-d H:i:s', (int) $init) . ' - ' . $e->getMessage() . PHP_EOL, LOCK_EX);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            throw new \App\Exceptions\AppException('ERR_SERVICE_NOT_FOUND');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    } else {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        try {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $startTaskTime = microtime(true);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    require_once __DIR__ . '/include/RequirementsValidation.php';
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $response .= sprintf('%s | %s - Cron task had been disabled' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $cronInstance->log('Cron start', 'info', false);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $checkLibrary = true;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    foreach ($cronTasks as $cronTask) {
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 131 characters
Open

                $response .= sprintf('%s | %s - Cron task had been disabled' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 143 characters
Open

    $response .= sprintf('---------------  %s (init: %s) | Start CRON  ----------', date('Y-m-d H:i:s'), date('H:i:s', (int) $init)) . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    if ($user) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                break;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($cronTask->isDisabled()) {
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 167 characters
Open

                $response .= sprintf('%s | %s - Task omitted, it has not been finished during the last scanning' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 162 characters
Open

                $response .= sprintf('%s | %s - Not ready to run as the time to run again is not completed' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    throw new \App\Exceptions\AppException('ERR_CLASS_MUST_BE||' . \App\CronHandler::class);
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 159 characters
Open

            $response .= sprintf('%s | %s - End task (%s s) | %s', date('Y-m-d H:i:s'), $cronTask->getName(), $taskTime, $cronHandler->getTaskLog()) . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $cronInstance::$cronTimeStart = microtime(true);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            \App\Log::trace($cronTask->getName() . ' - Start', 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

                \App\Log::trace($cronTask->getName() . ' - Task omitted, it has not been finished during the last scanning', 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            ob_start();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $cronHandler = new $className($cronTask);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                } else {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $cronInstance->log('The task returned a message: ' . PHP_EOL . $taskResponse, 'error');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            \App\Log::error("Cron task '{$cronTask->getName()}' throwed exception: " . PHP_EOL . $e->__toString() . PHP_EOL, 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                throw $e;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $cronTasks = false;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $response .= '<pre>';
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            } else {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ('' !== $taskResponse) {
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 134 characters
Open

            $cronInstance->log('Cron task execution throwed exception: ' . PHP_EOL . $response . PHP_EOL . $e->__toString(), 'error');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $response .= sprintf('===============  %s (Tasks: ' . $cronInstance->getCronExecutionTime() . ') (Script: %s) | End CRON  ==========', date('Y-m-d H:i:s'), round(microtime(true) - $init, 2)) . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 142 characters
Open

    file_put_contents(__DIR__ . '/cache/logs/cron_error.log', date('Y-m-d H:i:s', (int) $init) . ' - ' . $e->getMessage() . PHP_EOL, LOCK_EX);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    throw $e;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $cronTasks = [$cronTask];
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $cronTask->setCronInstance($cronInstance);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $cronTask->refreshData();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $response .= sprintf('%s | %s - Task omitted, it has not been finished during the last scanning' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                continue;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            // Not ready to run yet?
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if (!$cronTask->isRunnable()) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $cronInstance->log('Not ready to run as the time to run again is not completed');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                \App\Log::warning($cronTask->getName() . ' - The task returned a message:' . PHP_EOL . $taskResponse, 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $cronInstance = new \App\Cron();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$cronTask) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $cronTasks = vtlib\Cron::listAllActiveInstances();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $response .= sprintf("%s | %s - skipped \nCron execution time exceeded" . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $cronInstance->log('Cron task had timedout as it was not completed last time it run');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $cronInstance->log('Cron execution time exceeded');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $cronInstance->log('Cron task had been disabled');
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 128 characters
Open

                \App\Log::trace($cronTask->getName() . ' - Not ready to run as the time to run again is not completed', 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $taskResponse = ob_get_contents();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $taskTime = round(microtime(true) - $startTaskTime, 2);
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

            \App\Log::error("Cron task '{$cronTask->getName()}' throwed exception: " . PHP_EOL . $e->__toString() . PHP_EOL, 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 127 characters
Open

            echo sprintf('%s | ERROR: %s - Cron task throwed exception.', date('Y-m-d H:i:s'), $cronTask->getName()) . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                continue;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            // Mark the status - running
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if (class_exists($className)) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $cronInstance->log('End task, time: ' . $taskTime);
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 128 characters
Open

$user = (!empty($authenticatedUserId) && !empty($appUniqueKey) && $appUniqueKey === App\Config::main('application_unique_key'));
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    vtlib\Cron::setCronAction(true);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    if (\App\Request::_has('service')) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 142 characters
Open

                $response .= sprintf("%s | %s - skipped \nCron execution time exceeded" . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $cronInstance->log('SAPI: ' . PHP_SAPI . ', User: ' . Users::getActiveAdminId(), 'info', false);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($cronInstance->checkCronTimeout()) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    $cronTask->unlockTask();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            echo $e->__toString() . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $cronInstance->log('Task start: ' . $cronTask->getName(), 'info', false);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                \App\Log::trace($cronTask->getName() . ' - Not ready to run as the time to run again is not completed', 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                throw new \App\Exceptions\AppException('ERR_CLASS_NOT_FOUND||' . $className);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $cronTask->markFinished();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            echo $response;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $cronInstance->log('End CRON (' . $cronInstance->getCronExecutionTime() . ')', 'info', false);
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($cronTask->isRunning()) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    $cronHandler->process();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            echo sprintf('%s | ERROR: %s - Cron task throwed exception.', date('Y-m-d H:i:s'), $cronTask->getName()) . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $response .= sprintf('%s | %s - Start task' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                if ($cronHandler instanceof \App\CronHandler) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $cronInstance->log('Cron task execution throwed exception: ' . PHP_EOL . $response . PHP_EOL . $e->__toString(), 'error');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $cronTask->setError($response . PHP_EOL . $e->getMessage());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ('test' === App\Config::main('systemMode')) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($cronTask->hadTimeout()) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $cronInstance->log('Task omitted, it has not been finished during the last scanning', 'warning');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $response .= sprintf('%s | %s - Not ready to run as the time to run again is not completed' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $className = $cronTask->getHandlerClass();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            ob_end_clean();
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $response .= 'Task response:' . PHP_EOL . $taskResponse . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            // Mark the status - finished
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            \App\Log::trace($cronTask->getName() . ' - End', 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    echo $response;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $response .= sprintf('%s | %s - Cron task had timedout as it was not completed last time it run' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            // Not ready to run yet?
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                continue;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            // Timeout could happen if intermediate cron-tasks fails
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 167 characters
Open

                $response .= sprintf('%s | %s - Cron task had timedout as it was not completed last time it run' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName());
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $cronTask->markRunning();
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 126 characters
Open

                \App\Log::warning($cronTask->getName() . ' - The task returned a message:' . PHP_EOL . $taskResponse, 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Line exceeds 120 characters; contains 205 characters
Open

    $response .= sprintf('===============  %s (Tasks: ' . $cronInstance->getCronExecutionTime() . ') (Script: %s) | End CRON  ==========', date('Y-m-d H:i:s'), round(microtime(true) - $init, 2)) . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            // and affect the next task. Which need to be handled in this cycle.
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                if (App\Config::main('unblockedTimeoutCronTasks')) {
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                \App\Log::trace($cronTask->getName() . ' - Task omitted, it has not been finished during the last scanning', 'Cron');
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $response .= sprintf('%s | %s - End task (%s s) | %s', date('Y-m-d H:i:s'), $cronTask->getName(), $taskTime, $cronHandler->getTaskLog()) . PHP_EOL;
Severity: Minor
Found in cron.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } catch (\Throwable $e) {
Severity: Minor
Found in cron.php by phpcodesniffer

There are no issues that match your filters.

Category
Status