Remove error control operator '@' on line 102. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Avoid using static access to class '\dokuwiki\plugin\issuelinks\classes\Issue' in method 'render'. Open
$issue = Issue::getInstance($data['service'], $data['project'], $data['issueId'], $data['isMergeRequest']);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'dokuwiki\plugin\issuelinks\classes\ServiceProvider' in method 'connectTo'. Open
$serviceProvider = dokuwiki\plugin\issuelinks\classes\ServiceProvider::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid unused parameters such as '$pos'. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
- Read upRead up
- Exclude checks
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 '$handler'. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
- Read upRead up
- Exclude checks
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 local variables such as '$class'. Open
foreach ($this->syntaxPatterns as $pattern => $class) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused parameters such as '$state'. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
- Read upRead up
- Exclude checks
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
Call to undeclared function \act_clean()
Open
if (act_clean($ACT) === 'show' && $isLatest && page_exists($ID)) {
- Exclude checks
Call to undeclared function \wikiFN()
Open
$currentRev = @filemtime(wikiFN($ID));
- Exclude checks
Call to undeclared function \page_exists()
Open
if (act_clean($ACT) === 'show' && $isLatest && page_exists($ID)) {
- Exclude checks
Call to method interwikilink
from undeclared class \Doku_Renderer
Open
$renderer->interwikilink(null, null, 'google.com', implode(' ', $data));
- Exclude checks
Reference to instance property doc
from undeclared class \Doku_Renderer
Open
$renderer->doc .= $issue->getIssueLinkHTML();
- Exclude checks
Class extends undeclared class \DokuWiki_Syntax_Plugin
Open
class syntax_plugin_issuelinks extends DokuWiki_Syntax_Plugin
- Exclude checks
Parameter $handler
has undeclared type \Doku_Handler
Open
public function handle($match, $state, $pos, Doku_Handler $handler)
- Exclude checks
Possibly zero references to use statement for classlike/namespace ServiceInterface
(\dokuwiki\plugin\issuelinks\services\ServiceInterface)
Open
use dokuwiki\plugin\issuelinks\services\ServiceInterface;
- Exclude checks
Call to undeclared method \syntax_plugin_issuelinks::loadHelper
Open
$db_helper = $this->loadHelper('issuelinks_db');
- Exclude checks
Reference to undeclared property \syntax_plugin_issuelinks->Lexer
Open
$this->Lexer->addSpecialPattern("\[\[$pattern>.*?\]\]", $mode, 'plugin_issuelinks');
- Exclude checks
Parameter $renderer
has undeclared type \Doku_Renderer
Open
public function render($mode, Doku_Renderer $renderer, $data)
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class syntax_plugin_issuelinks extends DokuWiki_Syntax_Plugin
- Exclude checks
The class syntax_plugin_issuelinks is not named in CamelCase. Open
class syntax_plugin_issuelinks extends DokuWiki_Syntax_Plugin
{
protected $syntaxPatterns = [];
- 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
The parameter $issue_id is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- Read upRead up
- Exclude checks
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 $ID. Configured minimum length is 3. Open
global $ID, $REV, $ACT;
- Read upRead up
- Exclude checks
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
global $ID;
- Read upRead up
- Exclude checks
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
Class name "syntax_plugin_issuelinks" is not in camel caps format Open
class syntax_plugin_issuelinks extends DokuWiki_Syntax_Plugin
- Exclude checks
The variable $ID is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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 $ID is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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 $db_helper is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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 $ACT is not named in camelCase. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
{
list($pmServiceKey, $issueSyntax) = explode('>', trim($match, '[]'));
$serviceClassName = $this->syntaxPatterns[$pmServiceKey];
- 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 $db_helper is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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 $REV is not named in camelCase. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
{
list($pmServiceKey, $issueSyntax) = explode('>', trim($match, '[]'));
$serviceClassName = $this->syntaxPatterns[$pmServiceKey];
- 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 $issue_id is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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 $ID is not named in camelCase. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
{
list($pmServiceKey, $issueSyntax) = explode('>', trim($match, '[]'));
$serviceClassName = $this->syntaxPatterns[$pmServiceKey];
- 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 $ACT is not named in camelCase. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
{
list($pmServiceKey, $issueSyntax) = explode('>', trim($match, '[]'));
$serviceClassName = $this->syntaxPatterns[$pmServiceKey];
- 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 $ID is not named in camelCase. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
{
list($pmServiceKey, $issueSyntax) = explode('>', trim($match, '[]'));
$serviceClassName = $this->syntaxPatterns[$pmServiceKey];
- 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 $ID is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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 $REV is not named in camelCase. Open
public function handle($match, $state, $pos, Doku_Handler $handler)
{
list($pmServiceKey, $issueSyntax) = explode('>', trim($match, '[]'));
$serviceClassName = $this->syntaxPatterns[$pmServiceKey];
- 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 $issue_id is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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 $ID is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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 $db_helper is not named in camelCase. Open
private function saveLinkToDatabase($pmServiceName, $project, $issue_id, $isMergeRequest)
{
global $ID;
$currentRev = @filemtime(wikiFN($ID));
- 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();
}
}