sebastianmonzel/webfiles-framework-php

View on GitHub
source/core/datasystem/file/system/dropbox/MDropboxAccount.php

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

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

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;
Severity: Minor
Found in source/core/datasystem/file/system/dropbox/MDropboxAccount.php - About 1 hr to fix

Missing class import via use statement (line '55', column '32').
Open

            $this->OAuth = new \Dropbox\OAuth\Consumer\Curl(

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

Missing class import via use statement (line '44', column '32').
Open

            $this->OAuth = new \Dropbox\OAuth\Consumer\Curl(

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

Missing class import via use statement (line '26', column '30').
Open

        $this->storage = new \Dropbox\OAuth\Storage\Session;

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

Missing class import via use statement (line '49', column '37').
Open

            $this->dropboxApi = new \Dropbox\API($this->OAuth, 'dropbox');

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

Missing class import via use statement (line '60', column '37').
Open

            $this->dropboxApi = new \Dropbox\API($this->OAuth, 'dropbox');

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

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

        } else {

            //TOKENS ARE NOT AVAILABLE

            $this->OAuth = new \Dropbox\OAuth\Consumer\Curl(

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

        $oauthRequestTokenFile = "tmp/dropbox-oauth-request.token";

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 variable $req_token is not named in camelCase.
Open

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $acc_token is not named in camelCase.
Open

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $acc_token is not named in camelCase.
Open

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $req_token is not named in camelCase.
Open

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $acc_token is not named in camelCase.
Open

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $req_token is not named in camelCase.
Open

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $req_token is not named in camelCase.
Open

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $acc_token is not named in camelCase.
Open

    public function __construct($consumerKey, $consumerSecret, $callback)
    {

        $this->storage = new \Dropbox\OAuth\Storage\Session;

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status