sebastianmonzel/webfiles-framework-php

View on GitHub
source/core/datastore/types/googlecalendar/MGoogleCalendarDatastore.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid unused parameters such as '$template'.
Open

    public function searchByTemplate(MWebfile $template)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$count'.
Open

    public function getLatestWebfiles($count = 5)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

TODO found
Open

        // TODO: Implement searchByTemplate() method.

TODO found
Open

        // TODO: Implement tryConnect() method.

TODO found
Open

        // TODO: Implement getLatestWebfiles() method.

The method getClientWithToken uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            throw new MDatastoreException("No credentials set. Please request new Credentials.");
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

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

    private $authConfigAsJsonString;

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 $authConfigAsJsonString. Keep variable name length under 20.
Open

    public function __construct($calendarId, $authConfigAsJsonString, $redirectUrl, MISecretStore $secretStore)

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

The property $m_sCalendarId is not named in camelCase.
Open

class MGoogleCalendarDatastore extends MAbstractCachableDatastore
    implements MISingleDatasourceDatastore
{
    // https://developers.google.com/google-apps/calendar/quickstart/php#step_2_install_the_google_client_library
    /** @var string */

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

There are no issues that match your filters.

Category
Status