Showing 899 of 899 total issues
Method retrieveAllIssues
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function retrieveAllIssues($projectKey, &$startat = 0)
{
$perPage = 30;
$page = ceil(($startat + 1) / $perPage);
// FIXME: implent `since` parameter?
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');
- 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
Method getListOfAllReposAndHooks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getListOfAllReposAndHooks($organisation)
{
$endpoint = "/orgs/$organisation/repos";
try {
$repos = $this->makeGitHubGETRequest($endpoint);
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class linksyntax_plugin_issuelinks_test extends DokuWikiTest {
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class action_plugin_issuelinks_ajax extends DokuWiki_Action_Plugin
- 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
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class admin_plugin_issuelinks_repoadmin extends DokuWiki_Admin_Plugin
- 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
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class util_plugin_issuelinks_test extends DokuWikiTest {
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class helper_plugin_issuelinks_util extends DokuWiki_Plugin
- Exclude checks
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
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class helper_plugin_issuelinks_data extends DokuWiki_Plugin
- Exclude checks
Function run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
/** @var \helper_plugin_issuelinks_util $util */
$util = plugin_load('helper', 'issuelinks_util');
if (!$util) {
- 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
Method savePageRevIssues
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function savePageRevIssues($page, $rev, $serviceName, $project, $issue_id, $isMergeRequest, $type)
Avoid variables with short names like $r. Configured minimum length is 3. Open
list($r, $g, $b) = array_map(function ($color8bit) {
- 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
Avoid variables with short names like $ua. Configured minimum length is 3. Open
$ua = $className::WEBHOOK_UA;
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 5 and the first side effect is on line 9. Open
<?php
- Exclude checks
The class linksyntax_plugin_issuelinks_test is not named in CamelCase. Open
class linksyntax_plugin_issuelinks_test extends DokuWikiTest {
protected $pluginsEnabled = array('issuelinks', 'sqlite',);
public function setUp() {
- 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 class admin_plugin_issuelinks_repoadmin is not named in CamelCase. Open
class admin_plugin_issuelinks_repoadmin extends DokuWiki_Admin_Plugin
{
private $orgs = [];
private $configNeeded = [];
- 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 {
}