cosmocode/dokuwiki-plugin-issuelinks

View on GitHub

Showing 899 of 899 total issues

Reference to instance property resp_headers from undeclared class \DokuHTTPClient
Open

            if (empty($this->dokuHTTPClient->resp_headers['link'])) {
Severity: Minor
Found in services/GitHub.service.php by phan

Call to undeclared function \blank()
Open

        $valid &= !blank($status);
Severity: Critical
Found in services/Jira.service.php by phan

Call to undeclared method \syntax_plugin_issuelinks::loadHelper
Open

        $db_helper = $this->loadHelper('issuelinks_db');
Severity: Critical
Found in syntax.php by phan

Call to undeclared function \plugin_load()
Open

        $db = plugin_load('helper', 'issuelinks_db');
Severity: Critical
Found in services/Jira.service.php by phan

Call to undeclared function \plugin_load()
Open

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

Reference to undeclared property \syntax_plugin_issuelinks->Lexer
Open

            $this->Lexer->addSpecialPattern("\[\[$pattern>.*?\]\]", $mode, 'plugin_issuelinks');
Severity: Minor
Found in syntax.php by phan

Call to undeclared function \plugin_load()
Open

        $db = plugin_load('helper', 'issuelinks_db');
Severity: Critical
Found in services/GitLab.service.php by phan

Call to undeclared function \dbglog()
Open

            dbglog($e->getMessage());
Severity: Critical
Found in services/GitLab.service.php by phan

Call to method __construct from undeclared class \DokuHTTPClient
Open

        $this->dokuHTTPClient = new \DokuHTTPClient();
Severity: Critical
Found in services/Jira.service.php by phan

Call to method addTextInput from undeclared class \dokuwiki\Form\Form
Open

        $configForm->addTextInput('jira_url', 'Jira Url')->val($this->jiraUrl);
Severity: Critical
Found in services/Jira.service.php by phan

Call to method addTextInput from undeclared class \dokuwiki\Form\Form
Open

        $configForm->addTextInput('jira_user', 'Jira User')
Severity: Critical
Found in services/Jira.service.php by phan

Call to undeclared function \blank()
Open

        $valid &= !blank($type);
Severity: Critical
Found in services/GitHub.service.php by phan

Call to undeclared function \plugin_load()
Open

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

Call to undeclared function \msg()
Open

            msg($e->getMessage() . ' ' . $e->getCode(), -1);
Severity: Critical
Found in services/GitHub.service.php by phan

Call to undeclared function \plugin_load()
Open

        $db = plugin_load('helper', 'issuelinks_db');
Severity: Critical
Found in services/Jira.service.php by phan

Call to undeclared function \plugin_load()
Open

        $db = plugin_load('helper', 'issuelinks_db');
Severity: Critical
Found in services/Jira.service.php by phan

Parameter $renderer has undeclared type \Doku_Renderer
Open

    public function render($mode, Doku_Renderer $renderer, $data)
Severity: Minor
Found in syntax.php by phan

Define a constant instead of duplicating this literal "authorize" 3 times.
Open

        if ($INPUT->has('authorize')) {
Severity: Critical
Found in admin/repoadmin.php by sonar-php

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:
Severity: Major
Found in services/Jira.service.php by sonar-php

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

Reduce the number of returns of this function 5, down to the maximum allowed 3.
Open

    public function isConfigured()
Severity: Major
Found in services/Jira.service.php by sonar-php

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;
}
Severity
Category
Status
Source
Language