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);
- Read upRead up
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
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey('email', $info);
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertRegExp
Open
$this->assertRegExp('/^https?:\/\//', $info['url']);
- Exclude checks
Reference to undeclared constant \DOKU_PLUGIN
Open
'Key $meta[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php');
- Exclude checks
Variable $conf
is undeclared Open
foreach ($conf as $key => $value) {
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertTrue
Open
$this->assertTrue(false !== strtotime($info['date']));
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey($key, $conf,
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey('date', $info);
- Exclude checks
Call to undeclared function \mail_isvalid()
Open
$this->assertTrue(mail_isvalid($info['email']));
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertTrue
Open
$this->assertTrue(mail_isvalid($info['email']));
- Exclude checks
Variable $conf
is undeclared Open
if (gettype($conf) != 'NULL' && gettype($meta) != 'NULL') {
- Exclude checks
Reference to undeclared constant \DOKU_PLUGIN
Open
'Key $conf[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'issuelinks/conf/default.php');
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey('base', $info);
- Exclude checks
Class extends undeclared class \DokuWikiTest
Open
class general_plugin_issuelinks_test extends DokuWikiTest
- Exclude checks
Call to undeclared function \confToHash()
Open
$info = confToHash($file);
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey($key, $meta,
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey('name', $info);
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey('desc', $info);
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertRegExp
Open
$this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
- Exclude checks
Variable $conf
is undeclared Open
$this->assertEquals(gettype($conf), gettype($meta),
- Exclude checks
Reference to undeclared constant \DOKU_PLUGIN
Open
'Both ' . DOKU_PLUGIN . 'issuelinks/conf/default.php and ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php have to exist and contain the same keys.');
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertEquals
Open
$this->assertEquals(gettype($conf), gettype($meta),
- Exclude checks
Variable $meta
is undeclared Open
if (gettype($conf) != 'NULL' && gettype($meta) != 'NULL') {
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey('author', $info);
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertArrayHasKey
Open
$this->assertArrayHasKey('url', $info);
- Exclude checks
Variable $meta
is undeclared Open
$this->assertEquals(gettype($conf), gettype($meta),
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertFileExists
Open
$this->assertFileExists($file);
- Exclude checks
Call to undeclared method \general_plugin_issuelinks_test::assertEquals
Open
$this->assertEquals('issuelinks', $info['base']);
- Exclude checks
Variable $meta
is undeclared Open
foreach ($meta as $key => $value) {
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class general_plugin_issuelinks_test extends DokuWikiTest
- Exclude checks
The class general_plugin_issuelinks_test is not named in CamelCase. Open
class general_plugin_issuelinks_test extends DokuWikiTest
{
/**
* Simple test to make sure the plugin.info.txt is in correct format
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Method name "general_plugin_issuelinks_test::test_plugin_conf" is not in camel caps format Open
public function test_plugin_conf()
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
}
- Exclude checks
Method name "general_plugin_issuelinks_test::test_plugininfo" is not in camel caps format Open
public function test_plugininfo()
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
$this->assertArrayHasKey($key, $conf,
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
$this->assertEquals(gettype($conf), gettype($meta),
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
$this->assertArrayHasKey($key, $meta,
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
'Both ' . DOKU_PLUGIN . 'issuelinks/conf/default.php and ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php have to exist and contain the same keys.');
- Exclude checks
Class name "general_plugin_issuelinks_test" is not in camel caps format Open
class general_plugin_issuelinks_test extends DokuWikiTest
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$this->assertArrayHasKey($key, $conf,
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Key $meta[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php');
- Exclude checks
Multi-line function call not indented correctly; expected 16 spaces but found 20 Open
'Key $conf[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'issuelinks/conf/default.php');
- Exclude checks
Multi-line function call not indented correctly; expected 16 spaces but found 20 Open
'Key $meta[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php');
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$this->assertArrayHasKey($key, $meta,
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Both ' . DOKU_PLUGIN . 'issuelinks/conf/default.php and ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php have to exist and contain the same keys.');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Key $conf[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'issuelinks/conf/default.php');
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$this->assertEquals(gettype($conf), gettype($meta),
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Both ' . DOKU_PLUGIN . 'issuelinks/conf/default.php and ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php have to exist and contain the same keys.');
- Exclude checks
The variable $meta_file is not named in camelCase. Open
public function test_plugin_conf()
{
$conf_file = __DIR__ . '/../conf/default.php';
if (file_exists($conf_file)) {
include($conf_file);
- Read upRead up
- Exclude checks
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 $meta_file is not named in camelCase. Open
public function test_plugin_conf()
{
$conf_file = __DIR__ . '/../conf/default.php';
if (file_exists($conf_file)) {
include($conf_file);
- Read upRead up
- Exclude checks
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 $conf_file is not named in camelCase. Open
public function test_plugin_conf()
{
$conf_file = __DIR__ . '/../conf/default.php';
if (file_exists($conf_file)) {
include($conf_file);
- Read upRead up
- Exclude checks
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 $conf_file is not named in camelCase. Open
public function test_plugin_conf()
{
$conf_file = __DIR__ . '/../conf/default.php';
if (file_exists($conf_file)) {
include($conf_file);
- Read upRead up
- Exclude checks
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 $meta_file is not named in camelCase. Open
public function test_plugin_conf()
{
$conf_file = __DIR__ . '/../conf/default.php';
if (file_exists($conf_file)) {
include($conf_file);
- Read upRead up
- Exclude checks
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 $conf_file is not named in camelCase. Open
public function test_plugin_conf()
{
$conf_file = __DIR__ . '/../conf/default.php';
if (file_exists($conf_file)) {
include($conf_file);
- Read upRead up
- Exclude checks
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_plugininfo is not named in camelCase. Open
public function test_plugininfo()
{
$file = __DIR__ . '/../plugin.info.txt';
$this->assertFileExists($file);
- Read upRead up
- Exclude checks
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 test_plugin_conf is not named in camelCase. Open
public function test_plugin_conf()
{
$conf_file = __DIR__ . '/../conf/default.php';
if (file_exists($conf_file)) {
include($conf_file);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}