cosmocode/dokuwiki-plugin-issuelinks

View on GitHub
helper/db.php

Summary

Maintainability
B
6 hrs
Test Coverage

The method helper_plugin_issuelinks_db::saveEntity() calls the typical debug function print_r() which is mostly only used during development.
Open

            msg(print_r($entity, true), -1);
Severity: Minor
Found in helper/db.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

The class helper_plugin_issuelinks_db has an overall complexity of 59 which is very high. The configured complexity threshold is 50.
Open

class helper_plugin_issuelinks_db extends DokuWiki_Plugin
{
    private $db = null;

    /**
Severity: Minor
Found in helper/db.php by phpmd

The class helper_plugin_issuelinks_db has 11 public methods. Consider refactoring helper_plugin_issuelinks_db to keep number of public methods under 10.
Open

class helper_plugin_issuelinks_db extends DokuWiki_Plugin
{
    private $db = null;

    /**
Severity: Minor
Found in helper/db.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

File db.php has 297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * DokuWiki Plugin issuelinks (Helper Component)
 *
 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
Severity: Minor
Found in helper/db.php - About 3 hrs to fix

    Function getDB has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getDB()
        {
            if (null === $this->db) {
                /** @var helper_plugin_sqlite $sqlite */
                $sqlite = plugin_load('helper', 'sqlite');
    Severity: Minor
    Found in helper/db.php - About 1 hr to fix

    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

    Method savePageRevIssues has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
    Severity: Major
    Found in helper/db.php - About 50 mins to fix

      Method deleteAllIssuePageRevisions has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function deleteAllIssuePageRevisions($page, $serviceName, $projectKey, $issueId, $isMergeRequest, $type)
      Severity: Minor
      Found in helper/db.php - About 45 mins to fix

        Method removeOldLinks has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function removeOldLinks($serviceName, $projectKey, $issue_id, $isMergeRequest, $pages)
        Severity: Minor
        Found in helper/db.php - About 35 mins to fix

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

              public function getDB()
          Severity: Major
          Found in helper/db.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;
          }
          

          Missing class import via use statement (line '182', column '23').
          Open

                      throw new InvalidArgumentException("SQL-Statement must be a SELECT statement! \n" . $sql);
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '54', column '31').
          Open

                              throw new \Exception('Couldn\'t load PDO sqlite.');
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '185', column '23').
          Open

                      throw new InvalidArgumentException("SQL-Statement must be one single statement! \n" . $sql);
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '368', column '30').
          Open

                      $changelog = new PageChangelog($linkingPage['page']);
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '406', column '23').
          Open

                      throw new InvalidArgumentException("Second parameter must be a valid timestamp!");
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '450', column '23').
          Open

                      throw new InvalidArgumentException("Second parameter must be a valid timestamp!");
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '417', column '23').
          Open

                      throw new InvalidArgumentException("IssueId must be an integer!");
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '445', column '23').
          Open

                      throw new InvalidArgumentException("No empty values allowed!");
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '410', column '30').
          Open

                      $changelog = new PageChangelog($page);
          Severity: Minor
          Found in helper/db.php by phpmd

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          The method removeOldLinks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                      } else {
                          $activeLinks[] = $linkingPage;
                      }
          Severity: Minor
          Found in helper/db.php by phpmd

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Rename "$db" which has the same name as the field declared at line 14.
          Open

                  $db = $this->getDB();
          Severity: Major
          Found in helper/db.php by sonar-php

          Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

          Noncompliant Code Example

          class Foo {
            public $myField;
          
            public function doSomething() {
              $myField = 0;
              ...
            }
          }
          

          See

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

                      $sqlite = plugin_load('helper', 'sqlite');
          Severity: Critical
          Found in helper/db.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.

          Rename "$db" which has the same name as the field declared at line 14.
          Open

                  $db = $this->getDB();
          Severity: Major
          Found in helper/db.php by sonar-php

          Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

          Noncompliant Code Example

          class Foo {
            public $myField;
          
            public function doSomething() {
              $myField = 0;
              ...
            }
          }
          

          See

          Rename "$db" which has the same name as the field declared at line 14.
          Open

                  $db = $this->getDB();
          Severity: Major
          Found in helper/db.php by sonar-php

          Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

          Noncompliant Code Example

          class Foo {
            public $myField;
          
            public function doSomething() {
              $myField = 0;
              ...
            }
          }
          

          See

          Define a constant instead of duplicating this literal "project" 4 times.
          Open

                      'project' => $issue->getProject(),
          Severity: Critical
          Found in helper/db.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.

          Rename "$db" which has the same name as the field declared at line 14.
          Open

                  $db = $this->getDB();
          Severity: Major
          Found in helper/db.php by sonar-php

          Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

          Noncompliant Code Example

          class Foo {
            public $myField;
          
            public function doSomething() {
              $myField = 0;
              ...
            }
          }
          

          See

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

                              'project_id' => $projectKey,
          Severity: Critical
          Found in helper/db.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.

          Add curly braces around the nested statement(s).
          Open

                  if (!$db) return;
          Severity: Critical
          Found in helper/db.php by sonar-php

          While not technically incorrect, the omission of curly braces can be misleading, and may lead to the introduction of errors during maintenance.

          Noncompliant Code Example

          if (condition)  // Noncompliant
            executeSomething();
          

          Compliant Solution

          if (condition) {
            executeSomething();
          }
          

          See

          • MISRA C:2004, 14.8 - The statement forming the body of a switch, while, do ... while or for statement shall be a compound statement
          • MISRA C:2004, 14.9 - An if (expression) construct shall be followed by a compound statement. The else keyword shall be followed by either a compound statement, or another if statement
          • MISRA C++:2008, 6-3-1 - The statement forming the body of a switch, while, do ... while or for statement shall be a compound statement
          • MISRA C++:2008, 6-4-1 - An if (condition) construct shall be followed by a compound statement. The else keyword shall be followed by either a compound statement, or another if statement
          • MISRA C:2012, 15.6 - The body of an iteration-statement or a selection-statement shall be a compound-statement
          • CERT, EXP19-C. - Use braces for the body of an if, for, or while statement
          • CERT, EXP52-J. - Use braces for the body of an if, for, or while statement

          Define a constant instead of duplicating this literal "is_mergerequest" 6 times.
          Open

                      'is_mergerequest' => $issue->isMergeRequest() ? '1' : '0',
          Severity: Critical
          Found in helper/db.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.

          Rename "$db" which has the same name as the field declared at line 14.
          Open

                  $db = $this->getDB();
          Severity: Major
          Found in helper/db.php by sonar-php

          Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

          Noncompliant Code Example

          class Foo {
            public $myField;
          
            public function doSomething() {
              $myField = 0;
              ...
            }
          }
          

          See

          Define a constant instead of duplicating this literal "service" 9 times.
          Open

                      'service' => $service,
          Severity: Critical
          Found in helper/db.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.

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

                              'issue_id' => $issue_id,
          Severity: Critical
          Found in helper/db.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.

          Define and throw a dedicated exception instead of using a generic one.
          Open

                              throw new \Exception('Couldn\'t load PDO sqlite.');
          Severity: Major
          Found in helper/db.php by sonar-php

          If you throw a general exception type, such as ErrorException, RuntimeException, or Exception in a library or framework, it forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle.

          Instead, either throw a subtype that already exists in the Standard PHP Library, or create your own type that derives from Exception.

          Noncompliant Code Example

          throw new Exception();  // Noncompliant
          

          Compliant Solution

          throw new InvalidArgumentException();
          // or
          throw new UnexpectedValueException();
          

          See

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

                          $this->deleteEntity('pagerev_issues', $entity);
          Severity: Critical
          Found in helper/db.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.

          Rename "$db" which has the same name as the field declared at line 14.
          Open

                  $db = $this->getDB();
          Severity: Major
          Found in helper/db.php by sonar-php

          Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

          Noncompliant Code Example

          class Foo {
            public $myField;
          
            public function doSomething() {
              $myField = 0;
              ...
            }
          }
          

          See

          Reference to undeclared constant \DOKU_EXT_PDO
          Open

                      if ($sqlite->getAdapter()->getName() !== DOKU_EXT_PDO) {
          Severity: Minor
          Found in helper/db.php by phan

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $db->query('DELETE FROM issue_issues');
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \plugin_load()
          Open

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

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $res = $db->query($sql, [$key]);
          Severity: Critical
          Found in helper/db.php by phan

          Call to method res2single from undeclared class \helper_plugin_sqlite
          Open

                  $value = $db->res2single($res);
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \blank()
          Open

                  return blank($issues[0]) ? false : $issues[0];
          Severity: Critical
          Found in helper/db.php by phan

          Call to method __construct from undeclared class \PageChangelog
          Open

                      $changelog = new PageChangelog($page);
          Severity: Critical
          Found in helper/db.php by phan

          Call to method res_close from undeclared class \helper_plugin_sqlite
          Open

                  $db->res_close($res);
          Severity: Critical
          Found in helper/db.php by phan

          Call to method getRevisionInfo from undeclared class \PageChangelog
          Open

                      $rev_info = $changelog->getRevisionInfo($rev);
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \msg()
          Open

                      msg("Saving into table $table failed!", -1);
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \dbg_backtrace() (Did you mean \debug_backtrace())
          Open

                          msg(dbg_backtrace(), -1);
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \msg()
          Open

                      msg(print_r($entity, true), -1);
          Severity: Critical
          Found in helper/db.php by phan

          Call to method res_close from undeclared class \helper_plugin_sqlite
          Open

                  $db->res_close($res);
          Severity: Critical
          Found in helper/db.php by phan

          Call to method res2arr from undeclared class \helper_plugin_sqlite
          Open

                  $result = $db->res2arr($res);
          Severity: Critical
          Found in helper/db.php by phan

          Return type of getDB() is undeclared type \helper_plugin_sqlite
          Open

              public function getDB()
          Severity: Minor
          Found in helper/db.php by phan

          Call to undeclared function \plugin_load()
          Open

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

          Call to undeclared function \msg()
          Open

                          msg(dbg_backtrace(), -1);
          Severity: Critical
          Found in helper/db.php by phan

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $db->query($sql, [$key, $value]);
          Severity: Critical
          Found in helper/db.php by phan

          Reference to undeclared constant \DOKU_PLUGIN
          Open

                      if (!$sqlite->init('issuelinks', DOKU_PLUGIN . 'issuelinks/db/')) {
          Severity: Minor
          Found in helper/db.php by phan

          Return type of saveEntity() is undeclared type \SQLiteResult (Did you mean class \SQLite3Result)
          Open

              private function saveEntity($table, $entity)
          Severity: Minor
          Found in helper/db.php by phan

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $res = $db->query($sql, $conditional);
          Severity: Critical
          Found in helper/db.php by phan

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $db->query('DELETE FROM pagerev_issues');
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \plugin_load()
          Open

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

          Call to method getRelativeRevision from undeclared class \PageChangelog
          Open

                      $currentRev = $changelog->getRelativeRevision(time(), -1);
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \msg()
          Open

                          msg('This plugin requires the sqlite plugin. Please install it', -1);
          Severity: Critical
          Found in helper/db.php by phan

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $ok = $db->query($sql, $vals);
          Severity: Critical
          Found in helper/db.php by phan

          Saw an @param annotation for rmservice, but it was not found in the param list of function getWebhookSecrets($service, string $repo) : array
          Open

               * @param string $rmservice
          Severity: Info
          Found in helper/db.php by phan

          Call to method __construct from undeclared class \PageChangelog
          Open

                      $changelog = new PageChangelog($linkingPage['page']);
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \wikiFN()
          Open

                      $rev = filemtime(wikiFN($page));
          Severity: Critical
          Found in helper/db.php by phan

          Class extends undeclared class \DokuWiki_Plugin
          Open

          class helper_plugin_issuelinks_db extends DokuWiki_Plugin
          Severity: Critical
          Found in helper/db.php by phan

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $db->query('DELETE FROM issues');
          Severity: Critical
          Found in helper/db.php by phan

          Call to undeclared function \blank()
          Open

                  if (blank($page) || blank($rev) || blank($user)) {
          Severity: Critical
          Found in helper/db.php by phan

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $db->query('VACUUM');
          Severity: Critical
          Found in helper/db.php by phan

          Call to method query from undeclared class \helper_plugin_sqlite
          Open

                  $db->query($sql, $vals);
          Severity: Critical
          Found in helper/db.php by phan

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

          class helper_plugin_issuelinks_db extends DokuWiki_Plugin
          Severity: Minor
          Found in helper/db.php by phpcodesniffer

          Avoid variables with short names like $ok. Configured minimum length is 3.
          Open

                  $ok = $this->saveEntity('issues', [
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $db. Configured minimum length is 3.
          Open

                  $db = $this->getDB();
          Severity: Minor
          Found in helper/db.php by phpmd

          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

              public function deleteWebhook($service, $repo, $id)
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $db. Configured minimum length is 3.
          Open

              private $db = null;
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $db. Configured minimum length is 3.
          Open

                  $db = $this->getDB();
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $ok. Configured minimum length is 3.
          Open

                  $ok = $db->query($sql, $vals);
          Severity: Minor
          Found in helper/db.php by phpmd

          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

          The class helper_plugin_issuelinks_db is not named in CamelCase.
          Open

          class helper_plugin_issuelinks_db extends DokuWiki_Plugin
          {
              private $db = null;
          
              /**
          Severity: Minor
          Found in helper/db.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

          Avoid variables with short names like $id. Configured minimum length is 3.
          Open

              public function getWebhooks($service, $repo = null, $id = null)
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $db. Configured minimum length is 3.
          Open

                  $db = $this->getDB();
          Severity: Minor
          Found in helper/db.php by phpmd

          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

          The parameter $issue_id is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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

          Avoid variables with short names like $id. Configured minimum length is 3.
          Open

              public function saveWebhook($service, $repo, $id, $secret)
          Severity: Minor
          Found in helper/db.php by phpmd

          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

          The parameter $issue_id is not named in camelCase.
          Open

              public function getAllPageLinkingToIssue($serviceName, $projectKey, $issue_id, $isMergeRequest)
              {
                  $sql = "SELECT page, rev
                          FROM pagerev_issues
                          WHERE service = ?
          Severity: Minor
          Found in helper/db.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

          The parameter $issue_id is not named in camelCase.
          Open

              public function removeOldLinks($serviceName, $projectKey, $issue_id, $isMergeRequest, $pages)
              {
                  $activeLinks = [];
          
                  foreach ($pages as $linkingPage) {
          Severity: Minor
          Found in helper/db.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

          Avoid variables with short names like $db. Configured minimum length is 3.
          Open

                  $db = $this->getDB();
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $db. Configured minimum length is 3.
          Open

                  $db = $this->getDB();
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $db. Configured minimum length is 3.
          Open

                  $db = $this->getDB();
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $ok. Configured minimum length is 3.
          Open

                  $ok = $this->saveEntity('pagerevs', [
          Severity: Minor
          Found in helper/db.php by phpmd

          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 $ok. Configured minimum length is 3.
          Open

                  $ok = $this->saveEntity('pagerev_issues', [
          Severity: Minor
          Found in helper/db.php by phpmd

          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

          Inline control structures are not allowed
          Open

                  if (!$db) return;
          Severity: Minor
          Found in helper/db.php by phpcodesniffer

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

          class helper_plugin_issuelinks_db extends DokuWiki_Plugin
          Severity: Minor
          Found in helper/db.php by phpcodesniffer

          The variable $rev_info is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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 $issue_id is not named in camelCase.
          Open

              public function getAllPageLinkingToIssue($serviceName, $projectKey, $issue_id, $isMergeRequest)
              {
                  $sql = "SELECT page, rev
                          FROM pagerev_issues
                          WHERE service = ?
          Severity: Minor
          Found in helper/db.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 $issue_id is not named in camelCase.
          Open

              public function removeOldLinks($serviceName, $projectKey, $issue_id, $isMergeRequest, $pages)
              {
                  $activeLinks = [];
          
                  foreach ($pages as $linkingPage) {
          Severity: Minor
          Found in helper/db.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 $issue_id is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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 $rev_info is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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 $rev_info is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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 $rev_info is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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 $rev_info is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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 $issue_id is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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 $issue_id is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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 $issue_id is not named in camelCase.
          Open

              public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
              {
                  /** @var helper_plugin_issuelinks_util $util */
                  $util = plugin_load('helper', 'issuelinks_util');
                  if (!$util->isValidTimeStamp($rev)) {
          Severity: Minor
          Found in helper/db.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

          There are no issues that match your filters.

          Category
          Status