Showing 46 of 899 total issues
Method handleAjax
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleAjax(Doku_Event $event, $param)
{
if ($event->data !== 'plugin_issuelinks') {
return;
}
Method deleteWebhook
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteWebhook($project, $hookid)
{
// get old webhook id
/** @var \helper_plugin_issuelinks_db $db */
$db = plugin_load('helper', 'issuelinks_db');
Method createWebhook
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createWebhook($project)
{
// get old webhook id
/** @var \helper_plugin_issuelinks_db $db */
$db = plugin_load('helper', 'issuelinks_db');
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);
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)
Method deleteAllIssuePageRevisions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function deleteAllIssuePageRevisions($page, $serviceName, $projectKey, $issueId, $isMergeRequest, $type)
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function __construct()
{
$serviceDir = __DIR__ . '/../services';
$filenames = scandir($serviceDir, SCANDIR_SORT_ASCENDING);
foreach ($filenames as $filename) {
- 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
Function test_plugin_conf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function test_plugin_conf()
{
$conf_file = __DIR__ . '/../conf/default.php';
if (file_exists($conf_file)) {
include($conf_file);
- 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 removeOldLinks
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function removeOldLinks($serviceName, $projectKey, $issue_id, $isMergeRequest, $pages)
Method makeHTTPRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function makeHTTPRequest(\DokuHTTPClient $dokuHTTPClient, $url, $headers, array $data, $method)
Method getInstance
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$serviceName,
$projectKey,
$issueId,
$isMergeRequest = false,
$forcereload = false
Function getAdditionalDataHTML
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getAdditionalDataHTML()
{
$this->getFromService();
$data = [];
if (!empty($this->assignee)) {
- 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;