cosmocode/dokuwiki-plugin-issuelinks

View on GitHub
_test/util.test.php

Summary

Maintainability
A
0 mins
Test Coverage

Class extends undeclared class \DokuWikiTest
Open

class util_plugin_issuelinks_test extends DokuWikiTest {
Severity: Critical
Found in _test/util.test.php by phan

Reference to undeclared class \DokuWikiTest
Open

        parent::setUpBeforeClass();
Severity: Critical
Found in _test/util.test.php by phan

Call to undeclared method \util_plugin_issuelinks_test::assertSame
Open

        $this->assertSame($expected_links, $actual_links, $msg);
Severity: Critical
Found in _test/util.test.php by phan

Call to undeclared function \plugin_load()
Open

        $helper = plugin_load('helper', 'issuelinks_util');
Severity: Critical
Found in _test/util.test.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class util_plugin_issuelinks_test extends DokuWikiTest {
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

The class util_plugin_issuelinks_test is not named in CamelCase.
Open

class util_plugin_issuelinks_test extends DokuWikiTest {

    protected $pluginsEnabled = array('issuelinks');


Severity: Minor
Found in _test/util.test.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 $expected_links is not named in camelCase.
Open

    public function test_parseHTTPLinkHeaders($linkHeader, $expected_links, $msg) {
        /** @var helper_plugin_issuelinks_util $helper*/
        $helper = plugin_load('helper', 'issuelinks_util');

        $actual_links = $helper->parseHTTPLinkHeaders($linkHeader);
Severity: Minor
Found in _test/util.test.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

Opening brace of a class must be on the line after the definition
Open

class util_plugin_issuelinks_test extends DokuWikiTest {
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Method name "util_plugin_issuelinks_test::parseHTTPLinkHeaders_testdata" is not in camel caps format
Open

    public static function parseHTTPLinkHeaders_testdata() {
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Method name "util_plugin_issuelinks_test::test_parseHTTPLinkHeaders" is not in camel caps format
Open

    public function test_parseHTTPLinkHeaders($linkHeader, $expected_links, $msg) {
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Line exceeds 120 characters; contains 158 characters
Open

                    'next' => 'https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=2&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc',
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Line exceeds 120 characters; contains 441 characters
Open

                '<https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=2&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc>; rel="next", <https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=1&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc>; rel="first", <https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=2&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc>; rel="last"',
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Line exceeds 120 characters; contains 168 characters
Open

                '<https://api.github.com/repositories/48178744/commits?page=2>; rel="next", <https://api.github.com/repositories/48178744/commits?page=23>; rel="last"',
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Line exceeds 120 characters; contains 159 characters
Open

                    'first' => 'https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=1&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc',
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Line exceeds 120 characters; contains 157 characters
Open

                    'last' => 'https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=2&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc'
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Opening brace should be on a new line
Open

    public static function parseHTTPLinkHeaders_testdata() {
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Opening brace should be on a new line
Open

    public static function setUpBeforeClass() {
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Class name "util_plugin_issuelinks_test" is not in camel caps format
Open

class util_plugin_issuelinks_test extends DokuWikiTest {
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

Opening brace should be on a new line
Open

    public function test_parseHTTPLinkHeaders($linkHeader, $expected_links, $msg) {
Severity: Minor
Found in _test/util.test.php by phpcodesniffer

The variable $actual_links is not named in camelCase.
Open

    public function test_parseHTTPLinkHeaders($linkHeader, $expected_links, $msg) {
        /** @var helper_plugin_issuelinks_util $helper*/
        $helper = plugin_load('helper', 'issuelinks_util');

        $actual_links = $helper->parseHTTPLinkHeaders($linkHeader);
Severity: Minor
Found in _test/util.test.php by phpmd

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

    public function test_parseHTTPLinkHeaders($linkHeader, $expected_links, $msg) {
        /** @var helper_plugin_issuelinks_util $helper*/
        $helper = plugin_load('helper', 'issuelinks_util');

        $actual_links = $helper->parseHTTPLinkHeaders($linkHeader);
Severity: Minor
Found in _test/util.test.php by phpmd

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

    public function test_parseHTTPLinkHeaders($linkHeader, $expected_links, $msg) {
        /** @var helper_plugin_issuelinks_util $helper*/
        $helper = plugin_load('helper', 'issuelinks_util');

        $actual_links = $helper->parseHTTPLinkHeaders($linkHeader);
Severity: Minor
Found in _test/util.test.php by phpmd

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 method test_parseHTTPLinkHeaders is not named in camelCase.
Open

    public function test_parseHTTPLinkHeaders($linkHeader, $expected_links, $msg) {
        /** @var helper_plugin_issuelinks_util $helper*/
        $helper = plugin_load('helper', 'issuelinks_util');

        $actual_links = $helper->parseHTTPLinkHeaders($linkHeader);
Severity: Minor
Found in _test/util.test.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method parseHTTPLinkHeaders_testdata is not named in camelCase.
Open

    public static function parseHTTPLinkHeaders_testdata() {
        return array(
            array(
                '<https://api.github.com/repositories/48178744/commits?page=2>; rel="next", <https://api.github.com/repositories/48178744/commits?page=23>; rel="last"',
                array(
Severity: Minor
Found in _test/util.test.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status