Showing 899 of 899 total issues
Reference to instance property resp_headers
from undeclared class \DokuHTTPClient
Open
if (empty($this->dokuHTTPClient->resp_headers['link'])) {
- Exclude checks
Call to undeclared function \blank()
Open
$valid &= !blank($status);
- Exclude checks
Call to undeclared method \syntax_plugin_issuelinks::loadHelper
Open
$db_helper = $this->loadHelper('issuelinks_db');
- Exclude checks
Call to undeclared function \plugin_load()
Open
$db = plugin_load('helper', 'issuelinks_db');
- Exclude checks
Call to undeclared function \plugin_load()
Open
$db = plugin_load('helper', 'issuelinks_db');
- Exclude checks
Reference to undeclared property \syntax_plugin_issuelinks->Lexer
Open
$this->Lexer->addSpecialPattern("\[\[$pattern>.*?\]\]", $mode, 'plugin_issuelinks');
- Exclude checks
Call to undeclared function \plugin_load()
Open
$db = plugin_load('helper', 'issuelinks_db');
- Exclude checks
Call to undeclared function \dbglog()
Open
dbglog($e->getMessage());
- Exclude checks
Call to method __construct
from undeclared class \DokuHTTPClient
Open
$this->dokuHTTPClient = new \DokuHTTPClient();
- Exclude checks
Call to method addTextInput
from undeclared class \dokuwiki\Form\Form
Open
$configForm->addTextInput('jira_url', 'Jira Url')->val($this->jiraUrl);
- Exclude checks
Call to method addTextInput
from undeclared class \dokuwiki\Form\Form
Open
$configForm->addTextInput('jira_user', 'Jira User')
- Exclude checks
Call to undeclared function \blank()
Open
$valid &= !blank($type);
- Exclude checks
Call to undeclared function \plugin_load()
Open
$db = plugin_load('helper', 'issuelinks_db');
- Exclude checks
Call to undeclared function \msg()
Open
msg($e->getMessage() . ' ' . $e->getCode(), -1);
- Exclude checks
Call to undeclared function \plugin_load()
Open
$db = plugin_load('helper', 'issuelinks_db');
- Exclude checks
Call to undeclared function \plugin_load()
Open
$db = plugin_load('helper', 'issuelinks_db');
- Exclude checks
Parameter $renderer
has undeclared type \Doku_Renderer
Open
public function render($mode, Doku_Renderer $renderer, $data)
- Exclude checks
Define a constant instead of duplicating this literal "authorize" 3 times. Open
if ($INPUT->has('authorize')) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Take the required action to fix the issue indicated by this "FIXME" comment. Open
// FIXME: check and handle these fields:
- Read upRead up
- Exclude checks
FIXME
tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.
Sometimes the developer will not have the time or will simply forget to get back to that tag.
This rule is meant to track those tags and to ensure that they do not go unnoticed.
Noncompliant Code Example
function divide($numerator, $denominator) { return $numerator / $denominator; // FIXME denominator value might be 0 }
See
- MITRE, CWE-546 - Suspicious Comment
Reduce the number of returns of this function 5, down to the maximum allowed 3. Open
public function isConfigured()
- Read upRead up
- Exclude checks
Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.
Noncompliant Code Example
With the default threshold of 3:
function myFunction(){ // Noncompliant as there are 4 return statements if (condition1) { return true; } else { if (condition2) { return false; } else { return true; } } return false; }