YetiForceCompany/YetiForceCRM

View on GitHub
app/Integrations/Dav/Backend/Calendar.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Missing class import via use statement (line '78', column '14').
Open

            throw new \InvalidArgumentException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Class extends undeclared class \Sabre\CalDAV\backend\pdo (Did you mean class \PDO)
Open

class Calendar extends CalDAV\Backend\PDO
Severity: Critical
Found in app/Integrations/Dav/Backend/Calendar.php by phan

Reference to undeclared property \App\Integrations\Dav\Backend\Calendar->pdo
Open

        $stmt = $this->pdo->prepare(sprintf('DELETE FROM %s WHERE calendarid = ? && uri = ?', $this->calendarObjectTableName));

Call to undeclared method \App\Integrations\Dav\Backend\Calendar::addChange
Open

        $this->addChange($calendarId, $objectUri, 3);
Severity: Critical
Found in app/Integrations/Dav/Backend/Calendar.php by phan

Reference to undeclared property \App\Integrations\Dav\Backend\Calendar->pdo
Open

        $stmt = $this->pdo->prepare(sprintf('UPDATE vtiger_crmentity SET deleted = ? WHERE crmid IN (SELECT crmid FROM %s WHERE calendarid = ? && uri = ?);', $this->calendarObjectTableName));

Avoid excessively long variable names like $calendarInstancesTableName. Keep variable name length under 20.
Open

    public $calendarInstancesTableName = 'dav_calendarinstances';

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $calendarChangesTableName. Keep variable name length under 20.
Open

    public $calendarChangesTableName = 'dav_calendarchanges';

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $schedulingObjectTableName. Keep variable name length under 20.
Open

    public $schedulingObjectTableName = 'dav_schedulingobjects';

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $calendarObjectTableName. Keep variable name length under 20.
Open

    public $calendarObjectTableName = 'dav_calendarobjects';

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $calendarSubscriptionsTableName. Keep variable name length under 20.
Open

    public $calendarSubscriptionsTableName = 'dav_calendarsubscriptions';

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

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

    /**

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

     * The table name that will be used for calendar subscriptions.

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

    public $calendarSubscriptionsTableName = 'dav_calendarsubscriptions';

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

        $stmt->execute([1, $calendarId, $objectUri]);

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

     */

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

     *

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

     */

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

    public $calendarObjectTableName = 'dav_calendarobjects';

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

     * The table name that will be used for tracking changes in calendars.

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

    /**

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

    /**

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

     * The table name that will be used for calendars.

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

     * shared.

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

     *

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

     * The table name that will be used inbox items.

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

        $stmt->execute([$calendarId, $objectUri]);

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

    public $calendarChangesTableName = 'dav_calendarchanges';

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

     *

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

     */

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

     * The table name that will be used for calendars instances.

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

     */

Line exceeds 120 characters; contains 127 characters
Open

        $stmt = $this->pdo->prepare(sprintf('DELETE FROM %s WHERE calendarid = ? && uri = ?', $this->calendarObjectTableName));

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

     * A single calendar can have multiple instances, if the calendar is

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

     */

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

     * @var string

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

     * @param string $objectUri

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

    {

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

     * The object uri is only the basename, or filename and not a full path.

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

        $this->addChange($calendarId, $objectUri, 3);

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

    /**

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

     *

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

        [$calendarId] = $calendarId;

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

     *

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

    public $calendarInstancesTableName = 'dav_calendarinstances';

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

        if (!\is_array($calendarId)) {

Line exceeds 120 characters; contains 146 characters
Open

            throw new \InvalidArgumentException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');

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

     *

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

    public $schedulingObjectTableName = 'dav_schedulingobjects';

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

        $stmt = $this->pdo->prepare(sprintf('UPDATE vtiger_crmentity SET deleted = ? WHERE crmid IN (SELECT crmid FROM %s WHERE calendarid = ? && uri = ?);', $this->calendarObjectTableName));

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

     * @var string

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

     * Deletes an existing calendar object.

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

        $stmt = $this->pdo->prepare(sprintf('DELETE FROM %s WHERE calendarid = ? && uri = ?', $this->calendarObjectTableName));

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

     * @var string

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

     * @var string

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

    /**

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

    public function deleteCalendarObject($calendarId, $objectUri)

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

            throw new \InvalidArgumentException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');

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

     *

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

    public $calendarTableName = 'dav_calendars';

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

    /**

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

     */

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

     *

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

     * The table name that will be used for calendar objects.

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

     * @var string

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

     *

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

     * @var string

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

     * @param mixed  $calendarId

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

        }

Line exceeds 120 characters; contains 191 characters
Open

        $stmt = $this->pdo->prepare(sprintf('UPDATE vtiger_crmentity SET deleted = ? WHERE crmid IN (SELECT crmid FROM %s WHERE calendarid = ? && uri = ?);', $this->calendarObjectTableName));

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

    /**

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

     */

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

    }

There are no issues that match your filters.

Category
Status