cosmocode/dokuwiki-plugin-issuelinks

View on GitHub

Showing 899 of 899 total issues

The class helper_plugin_issuelinks_data is not named in CamelCase.
Open

class helper_plugin_issuelinks_data extends DokuWiki_Plugin
{

    /** @var helper_plugin_issuelinks_db */
    private $db = null;
Severity: Minor
Found in helper/data.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class helper_plugin_issuelinks_db is not named in CamelCase.
Open

class helper_plugin_issuelinks_db extends DokuWiki_Plugin
{
    private $db = null;

    /**
Severity: Minor
Found in helper/db.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = $this->getDB();
Severity: Minor
Found in helper/db.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public function deleteWebhook($service, $repo, $id)
Severity: Minor
Found in helper/db.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = $this->getDB();
Severity: Minor
Found in helper/db.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

Avoid variables with short names like $ok. Configured minimum length is 3.
Open

        $ok = $this->saveEntity('issues', [
Severity: Minor
Found in helper/db.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

The parameter $issue_id is not named in camelCase.
Open

    public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
    {
        /** @var helper_plugin_issuelinks_util $util */
        $util = plugin_load('helper', 'issuelinks_util');
        if (!$util->isValidTimeStamp($rev)) {
Severity: Minor
Found in helper/db.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = plugin_load('helper', 'issuelinks_db');
Severity: Minor
Found in services/GitHub.service.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

Avoid variables with short names like $db. Configured minimum length is 3.
Open

    private $db = null;
Severity: Minor
Found in helper/db.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

Avoid variables with short names like $e. Configured minimum length is 3.
Open

    public function reportException(Exception $e)
Severity: Minor
Found in helper/util.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

The class helper_plugin_issuelinks_util is not named in CamelCase.
Open

class helper_plugin_issuelinks_util extends DokuWiki_Plugin
{

    /**
     * Parse the link header received by DokuHTTPClient
Severity: Minor
Found in helper/util.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The parameter $page_id is not named in camelCase.
Open

    public function getDiffUrl($page_id, $revision = 0)
    {
        if (empty($revision)) {
            $currentRevision = filemtime(wikiFN($page_id));
            $url = wl(
Severity: Minor
Found in helper/util.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Avoid variables with short names like $ok. Configured minimum length is 3.
Open

        $ok = $this->saveEntity('pagerev_issues', [
Severity: Minor
Found in helper/db.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

Avoid variables with short names like $ok. Configured minimum length is 3.
Open

        $ok = $this->saveEntity('pagerevs', [
Severity: Minor
Found in helper/db.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

Method deleteAllIssuePageRevisions has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function deleteAllIssuePageRevisions($page, $serviceName, $projectKey, $issueId, $isMergeRequest, $type)
Severity: Minor
Found in helper/db.php - About 45 mins to fix

    Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function __construct()
        {
            $serviceDir = __DIR__ . '/../services';
            $filenames = scandir($serviceDir, SCANDIR_SORT_ASCENDING);
            foreach ($filenames as $filename) {
    Severity: Minor
    Found in classes/ServiceProvider.php - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function test_plugin_conf has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function test_plugin_conf()
        {
            $conf_file = __DIR__ . '/../conf/default.php';
            if (file_exists($conf_file)) {
                include($conf_file);
    Severity: Minor
    Found in _test/general.test.php - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method removeOldLinks has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function removeOldLinks($serviceName, $projectKey, $issue_id, $isMergeRequest, $pages)
    Severity: Minor
    Found in helper/db.php - About 35 mins to fix

      Method makeHTTPRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          protected function makeHTTPRequest(\DokuHTTPClient $dokuHTTPClient, $url, $headers, array $data, $method)
      Severity: Minor
      Found in services/AbstractService.php - About 35 mins to fix

        Method getInstance has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $serviceName,
                $projectKey,
                $issueId,
                $isMergeRequest = false,
                $forcereload = false
        Severity: Minor
        Found in classes/Issue.php - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language