Showing 46 of 899 total issues
File Issue.php
has 467 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace dokuwiki\plugin\issuelinks\classes;
/**
File GitHub.service.php
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace dokuwiki\plugin\issuelinks\services;
use dokuwiki\Form\Form;
Issue
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
class Issue extends \DokuWiki_Plugin implements \JsonSerializable
{
/** @var Issue[] */
private static $instances = [];
File GitLab.service.php
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace dokuwiki\plugin\issuelinks\services;
use dokuwiki\Form\Form;
File Jira.service.php
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by IntelliJ IDEA.
* User: michael
* Date: 4/16/18
GitHub
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class GitHub extends AbstractService
{
const SYNTAX = 'gh';
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
GitLab
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class GitLab extends AbstractService
{
const SYNTAX = 'gl';
const DISPLAY_NAME = 'GitLab';
Method buildTooltipHTML
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildTooltipHTML()
{
$html = '<aside class="issueTooltip">';
$html .= "<h1 class=\"issueTitle\">{$this->getSummary()}</h1>";
$html .= "<div class='assigneeAvatar waiting'></div>";
Function buildTooltipHTML
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function buildTooltipHTML()
{
$html = '<aside class="issueTooltip">';
$html .= "<h1 class=\"issueTitle\">{$this->getSummary()}</h1>";
$html .= "<div class='assigneeAvatar waiting'></div>";
- 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
Jira
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Jira extends AbstractService
{
const SYNTAX = 'jira';
const DISPLAY_NAME = 'Jira';
Method importAllIssues
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importAllIssues($serviceName, $projectKey)
{
$lockfileKey = $this->getImportLockID($serviceName, $projectKey);
if ($this->isImportLocked($lockfileKey)) {
throw new RuntimeException('Import of Issues is already locked!');
Method createOrgRepoHTML
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createOrgRepoHTML($serviceId, $org)
{
$serviceProvider = ServiceProvider::getInstance();
$services = $serviceProvider->getServices();
$service = $services[$serviceId]::getInstance();
Method run
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
/** @var \helper_plugin_issuelinks_util $util */
$util = plugin_load('helper', 'issuelinks_util');
if (!$util) {
Method appendServicePage
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function appendServicePage($html, $serviceID)
{
$serviceProvider = ServiceProvider::getInstance();
$services = $serviceProvider->getServices();
$service = $services[$serviceID]::getInstance();
Method test_jiralink_moresyntax
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function test_jiralink_moresyntax() {
// arrange
global $ID;
$ID = 'testpage2';
saveWikiText($ID,'page must exist for m_filetime','test summary');
Method retrieveAllIssues
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function retrieveAllIssues($projectKey, &$startat = 0)
{
$perPage = 100;
$page = ceil(($startat + 1) / $perPage);
$endpoint = '/projects/' . urlencode($projectKey) . "/issues?page=$page&per_page=$perPage";
Method makeGitHubGETRequest
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function makeGitHubGETRequest($endpoint, $max = null)
{
$results = [];
$waittime = 0;
/** @var \helper_plugin_issuelinks_util $utils */
Function importAllIssues
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function importAllIssues($serviceName, $projectKey)
{
$lockfileKey = $this->getImportLockID($serviceName, $projectKey);
if ($this->isImportLocked($lockfileKey)) {
throw new RuntimeException('Import of Issues is already locked!');
- 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 makeGitHubGETRequest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function makeGitHubGETRequest($endpoint, $max = null)
{
$results = [];
$waittime = 0;
/** @var \helper_plugin_issuelinks_util $utils */
- 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"