e107inc/e107

View on GitHub
e107_handlers/cron_class.php

Summary

Maintainability
A
30 mins
Test Coverage
F
20%

Avoid too many return statements within this method.
Open

        return $status;
Severity: Major
Found in e107_handlers/cron_class.php - About 30 mins to fix

    Argument 1 (string) is null but \strlen() takes string
    Open

                $lastDue = $this->year.'-'.(strlen($this->month) === 1 ? '0'.$this->month : $this->month).'-'.(strlen($this->day) === 1 ? '0'.$this->day : $this->day).'T'.(strlen($this->hour) === 1 ? '0'.$this->hour : $this->hour) . ":" . (strlen($this->minute) === 1 ? '0'.$this->minute : $this->minute);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                $lastDue = $this->year.'-'.(strlen($this->month) === 1 ? '0'.$this->month : $this->month).'-'.(strlen($this->day) === 1 ? '0'.$this->day : $this->day).'T'.(strlen($this->hour) === 1 ? '0'.$this->hour : $this->hour) . ":" . (strlen($this->minute) === 1 ? '0'.$this->minute : $this->minute);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

            $this->debug("Days array matching weekdays for $year-$month");
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Call with 2 arg(s) to \CronParser::debug() which only takes 1 arg(s) defined at /code/e107_handlers/cron_class.php:464
    Open

                $this->cron->debug('e107: Cron is running: '.print_r($job,true), E_NOTICE);
    Severity: Info
    Found in e107_handlers/cron_class.php by phan

    Argument 4 (mon) is null but \mktime() takes int
    Open

                $this->lastRan = mktime($this->hour, $this->minute, 0, $this->month, $this->day, $this->year);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Argument 4 (mon) is null but \mktime() takes int
    Open

                    $wkday = date('w', mktime(0, 0, 0, $month, $day, $year));
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Argument 1 (hour) is null but \mktime() takes int
    Open

                $this->lastRan = mktime($this->hour, $this->minute, 0, $this->month, $this->day, $this->year);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                    $this->debug("Have to go for previous year " . $this->year);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Call with 2 arg(s) to \CronParser::debug() which only takes 1 arg(s) defined at /code/e107_handlers/cron_class.php:464
    Open

                $this->cron->debug('e107: Cron file not readable: '.e_PLUGIN . $job['path'] . "/e_cron.php", E_ERROR);
    Severity: Info
    Found in e107_handlers/cron_class.php by phan

    Call with 2 arg(s) to \CronParser::debug() which only takes 1 arg(s) defined at /code/e107_handlers/cron_class.php:464
    Open

                    $this->cron->debug('e107: Cron could not find class: '.$class, E_ERROR);
    Severity: Info
    Found in e107_handlers/cron_class.php by phan

    Argument 2 (min) is null but \mktime() takes int
    Open

                $this->lastRan = mktime($this->hour, $this->minute, 0, $this->month, $this->day, $this->year);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                $this->debug("Getting the last day for previous month: " . $this->year . '-' . $this->month);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Returning type null but run() is declared to return bool
    Open

            return null;
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Argument 2 (type) is 'theme' but \e_file::gitPull() takes null defined at /code/e107_handlers/file_class.php:1591
    Open

                $return = $fl->gitPull($theme, 'theme');
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                $this->debug("Cron was due before this month. Previous month is: " . $this->year . '-' . $this->month);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Variable $arWeekdays was undeclared, but array fields are being added to it.
    Open

                        $arWeekdays[] = $i;
    Severity: Info
    Found in e107_handlers/cron_class.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

            $this->debug("Number of days in $year-$month : $daysinmonth");
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Argument 6 (year) is null but \mktime() takes int
    Open

                $this->lastRan = mktime($this->hour, $this->minute, 0, $this->month, $this->day, $this->year);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Variable $tmp was undeclared, but array fields are being added to it.
    Open

                            $tmp[] = 0;
    Severity: Info
    Found in e107_handlers/cron_class.php by phan

    Argument 4 (mon) is null but \mktime() takes int
    Open

            return date('t', mktime(0, 0, 0, $month, 1, $year));
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Assigning float|int to property but \CronParser->year is null
    Open

                $this->year = $this->year - 1;
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                    $this->debug("Cron was due on " . $this->day . " of this month");
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Argument 5 (day) is null but \mktime() takes int
    Open

                $this->lastRan = mktime($this->hour, $this->minute, 0, $this->month, $this->day, $this->year);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Assigning float|int to property but \CronParser->year is null
    Open

                $this->year = $this->year -1;
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Assigning string to property but \CronParser->year is null
    Open

            $this->year = $this->now[5];
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Invalid operator: left operand of - is null (expected number)
    Open

                $this->year = $this->year - 1;
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Call with 2 arg(s) to \CronParser::debug() which only takes 1 arg(s) defined at /code/e107_handlers/cron_class.php:464
    Open

                    $this->cron->debug('Cron could not find method: '.$job['function'], E_ERROR);
    Severity: Info
    Found in e107_handlers/cron_class.php by phan

    Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                $this->debug("Not due within this year. So checking the previous year " . $this->year);
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    Invalid operator: left operand of - is null (expected number)
    Open

                $this->year = $this->year -1;
    Severity: Minor
    Found in e107_handlers/cron_class.php by phan

    There are no issues that match your filters.

    Category
    Status