cosmocode/dokuwiki-plugin-issuelinks

View on GitHub

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;

/**
Severity: Minor
Found in classes/Issue.php - About 7 hrs to fix

    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;
    Severity: Minor
    Found in services/GitHub.service.php - About 6 hrs to fix

      Issue has 45 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Issue extends \DokuWiki_Plugin implements \JsonSerializable
      {
      
          /** @var Issue[] */
          private static $instances = [];
      Severity: Minor
      Found in classes/Issue.php - About 6 hrs to fix

        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;
        Severity: Minor
        Found in services/GitLab.service.php - About 5 hrs to fix

          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
          Severity: Minor
          Found in services/Jira.service.php - About 3 hrs to fix

            GitHub has 28 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class GitHub extends AbstractService
            {
            
            
                const SYNTAX = 'gh';
            Severity: Minor
            Found in services/GitHub.service.php - About 3 hrs to fix

              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

                GitLab has 26 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class GitLab extends AbstractService
                {
                
                    const SYNTAX = 'gl';
                    const DISPLAY_NAME = 'GitLab';
                Severity: Minor
                Found in services/GitLab.service.php - About 3 hrs to fix

                  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>";
                  Severity: Major
                  Found in classes/Issue.php - About 2 hrs to fix

                    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>";
                    Severity: Minor
                    Found in classes/Issue.php - About 2 hrs 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

                    Jira has 22 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Jira extends AbstractService
                    {
                    
                        const SYNTAX = 'jira';
                        const DISPLAY_NAME = 'Jira';
                    Severity: Minor
                    Found in services/Jira.service.php - About 2 hrs to fix

                      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!');
                      Severity: Major
                      Found in helper/data.php - About 2 hrs to fix

                        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();
                        Severity: Minor
                        Found in action/ajax.php - About 1 hr to fix

                          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) {
                          Severity: Minor
                          Found in Webhook.php - About 1 hr to fix

                            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();
                            Severity: Minor
                            Found in admin/repoadmin.php - About 1 hr to fix

                              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');
                              Severity: Minor
                              Found in _test/handleIssueLinkSyntax.test.php - About 1 hr to fix

                                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";
                                Severity: Minor
                                Found in services/GitLab.service.php - About 1 hr to fix

                                  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 */
                                  Severity: Minor
                                  Found in services/GitHub.service.php - About 1 hr to fix

                                    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 */
                                    Severity: Minor
                                    Found in services/GitHub.service.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

                                    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!');
                                    Severity: Minor
                                    Found in helper/data.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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language