cosmocode/dokuwiki-plugin-issuelinks

View on GitHub
action/ajax.php

Summary

Maintainability
B
6 hrs
Test Coverage

repoAdminOrg accesses the super-global variable $_SERVER.
Open

    public function repoAdminOrg(Doku_Event $event, $param)
    {
        if ($event->data !== 'issuelinks_repo_admin_getorg') {
            return;
        }
Severity: Minor
Found in action/ajax.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

handleAjax accesses the super-global variable $_SERVER.
Open

    public function handleAjax(Doku_Event $event, $param)
    {
        if ($event->data !== 'plugin_issuelinks') {
            return;
        }
Severity: Minor
Found in action/ajax.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

repoAdminToggle accesses the super-global variable $_SERVER.
Open

    public function repoAdminToggle(Doku_Event $event, $param)
    {
        if ($event->data !== 'issuelinks_repo_admin_toggle') {
            return;
        }
Severity: Minor
Found in action/ajax.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

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

      Function handleAjax has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handleAjax(Doku_Event $event, $param)
          {
              if ($event->data !== 'plugin_issuelinks') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.php - About 25 mins 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 createOrgRepoHTML has a Cognitive Complexity of 6 (exceeds 5 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 25 mins 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

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

              } else {
                  $response = $service->createWebhook($project);
              }
      Severity: Minor
      Found in action/ajax.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

      Avoid using static access to class '\dokuwiki\plugin\issuelinks\classes\Issue' in method 'getIssueTooltipHTML'.
      Open

                  $issue = Issue::getInstance($pmServiceName, $projectKey, $issueId, $isMergeRequest);
      Severity: Minor
      Found in action/ajax.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\dokuwiki\plugin\issuelinks\classes\Issue' in method 'getAdditionalIssueData'.
      Open

                  $issue = Issue::getInstance($pmServiceName, $projectKey, $issueId, $isMergeRequest);
      Severity: Minor
      Found in action/ajax.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\dokuwiki\plugin\issuelinks\classes\ServiceProvider' in method 'createOrgRepoHTML'.
      Open

              $serviceProvider = ServiceProvider::getInstance();
      Severity: Minor
      Found in action/ajax.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\dokuwiki\plugin\issuelinks\classes\ServiceProvider' in method 'repoAdminToggle'.
      Open

              $serviceProvider = ServiceProvider::getInstance();
      Severity: Minor
      Found in action/ajax.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Take the required action to fix the issue indicated by this "FIXME" comment.
      Open

              // fixme check if $serviceName and $projectKey exist
      Severity: Major
      Found in action/ajax.php by sonar-php

      FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

      Sometimes the developer will not have the time or will simply forget to get back to that tag.

      This rule is meant to track those tags and to ensure that they do not go unnoticed.

      Noncompliant Code Example

      function divide($numerator, $denominator) {
        return $numerator / $denominator;              // FIXME denominator value might be  0
      }
      

      See

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

              $this->util = plugin_load('helper', 'issuelinks_util');
      Severity: Critical
      Found in action/ajax.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 "Not logged in!" 3 times.
      Open

                  $this->util->sendResponse(401, 'Not logged in!');
      Severity: Critical
      Found in action/ajax.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 "AJAX_CALL_UNKNOWN" 4 times.
      Open

              $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'handleAjax');
      Severity: Critical
      Found in action/ajax.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 "BEFORE" 4 times.
      Open

              $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'handleAjax');
      Severity: Critical
      Found in action/ajax.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 "REMOTE_USER" 3 times.
      Open

              if (empty($_SERVER['REMOTE_USER'])) {
      Severity: Critical
      Found in action/ajax.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 "status" 4 times.
      Open

              $this->util->sendResponse($response['status'], $response['data']);
      Severity: Critical
      Found in action/ajax.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 "servicename" 3 times.
      Open

              $serviceId = $INPUT->str('servicename');
      Severity: Critical
      Found in action/ajax.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 "Must be Admin" 4 times.
      Open

                  $this->util->sendResponse(403, 'Must be Admin');
      Severity: Critical
      Found in action/ajax.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.

      Avoid unused local variables such as '$INFO'.
      Open

              global $INPUT, $INFO;
      Severity: Minor
      Found in action/ajax.php by phpmd

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused parameters such as '$param'.
      Open

          public function repoAdminToggle(Doku_Event $event, $param)
      Severity: Minor
      Found in action/ajax.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Avoid unused parameters such as '$param'.
      Open

          public function handleAjax(Doku_Event $event, $param)
      Severity: Minor
      Found in action/ajax.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Avoid unused parameters such as '$param'.
      Open

          public function asyncImportAllIssues(Doku_Event $event, $param)
      Severity: Minor
      Found in action/ajax.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Avoid unused parameters such as '$param'.
      Open

          public function repoAdminOrg(Doku_Event $event, $param)
      Severity: Minor
      Found in action/ajax.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Call to undeclared function \buildAttributes()
      Open

                  $html .= '<span ' . buildAttributes($spanAttributes, true) . '></span>';
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared function \inlineSVG()
      Open

              $importSVG = inlineSVG(__DIR__ . '/../images/import.svg');
      Severity: Critical
      Found in action/ajax.php by phan

      Call to method register_hook from undeclared class \Doku_Event_Handler
      Open

              $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'repoAdminToggle');
      Severity: Critical
      Found in action/ajax.php by phan

      Parameter $event has undeclared type \Doku_Event
      Open

          public function repoAdminToggle(Doku_Event $event, $param)
      Severity: Minor
      Found in action/ajax.php by phan

      Call to method stopPropagation from undeclared class \Doku_Event
      Open

              $event->stopPropagation();
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared function \plugin_load()
      Open

              $this->util = plugin_load('helper', 'issuelinks_util');
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared function \auth_isadmin()
      Open

              if (!auth_isadmin()) {
      Severity: Critical
      Found in action/ajax.php by phan

      Call to method register_hook from undeclared class \Doku_Event_Handler
      Open

              $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'repoAdminOrg');
      Severity: Critical
      Found in action/ajax.php by phan

      Parameter $event has undeclared type \Doku_Event
      Open

          public function asyncImportAllIssues(Doku_Event $event, $param)
      Severity: Minor
      Found in action/ajax.php by phan

      Call to undeclared function \auth_isadmin()
      Open

              if (!auth_isadmin()) {
      Severity: Critical
      Found in action/ajax.php by phan

      Call to method preventDefault from undeclared class \Doku_Event
      Open

              $event->preventDefault();
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared method \action_plugin_issuelinks_ajax::getLang
      Open

              $html .= '<p>' . $this->getLang('text:repo admin') . '</p>';
      Severity: Critical
      Found in action/ajax.php by phan

      Call to method stopPropagation from undeclared class \Doku_Event
      Open

              $event->stopPropagation();
      Severity: Critical
      Found in action/ajax.php by phan

      Reference to instance property data from undeclared class \Doku_Event
      Open

              if ($event->data !== 'issuelinks_repo_admin_toggle') {
      Severity: Minor
      Found in action/ajax.php by phan

      Call to undeclared method \action_plugin_issuelinks_ajax::getLang
      Open

                  $hookTitle = $repo->error === 403 ? $this->getLang('title:forbidden') : $this->getLang('title:issue hook');
      Severity: Critical
      Found in action/ajax.php by phan

      Class extends undeclared class \DokuWiki_Action_Plugin
      Open

      class action_plugin_issuelinks_ajax extends DokuWiki_Action_Plugin
      Severity: Critical
      Found in action/ajax.php by phan

      Parameter $controller has undeclared type \Doku_Event_Handler
      Open

          public function register(Doku_Event_Handler $controller)
      Severity: Minor
      Found in action/ajax.php by phan

      Call to method preventDefault from undeclared class \Doku_Event
      Open

              $event->preventDefault();
      Severity: Critical
      Found in action/ajax.php by phan

      Call to method register_hook from undeclared class \Doku_Event_Handler
      Open

              $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'handleAjax');
      Severity: Critical
      Found in action/ajax.php by phan

      Call to method register_hook from undeclared class \Doku_Event_Handler
      Open

              $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'asyncImportAllIssues');
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared function \auth_isadmin()
      Open

              if (!auth_isadmin()) {
      Severity: Critical
      Found in action/ajax.php by phan

      Reference to instance property data from undeclared class \Doku_Event
      Open

              if ($event->data !== 'issuelinks_import_all_issues_async') {
      Severity: Minor
      Found in action/ajax.php by phan

      Call to method preventDefault from undeclared class \Doku_Event
      Open

              $event->preventDefault();
      Severity: Critical
      Found in action/ajax.php by phan

      Reference to instance property data from undeclared class \Doku_Event
      Open

              if ($event->data !== 'plugin_issuelinks') {
      Severity: Minor
      Found in action/ajax.php by phan

      Call to method stopPropagation from undeclared class \Doku_Event
      Open

              $event->stopPropagation();
      Severity: Critical
      Found in action/ajax.php by phan

      Parameter $event has undeclared type \Doku_Event
      Open

          public function handleAjax(Doku_Event $event, $param)
      Severity: Minor
      Found in action/ajax.php by phan

      Call to method stopPropagation from undeclared class \Doku_Event
      Open

              $event->stopPropagation();
      Severity: Critical
      Found in action/ajax.php by phan

      Parameter $event has undeclared type \Doku_Event
      Open

          public function repoAdminOrg(Doku_Event $event, $param)
      Severity: Minor
      Found in action/ajax.php by phan

      Reference to instance property data from undeclared class \Doku_Event
      Open

              if ($event->data !== 'issuelinks_repo_admin_getorg') {
      Severity: Minor
      Found in action/ajax.php by phan

      Call to undeclared function \buildAttributes()
      Open

                  $html .= '<button ' . buildAttributes($buttonAttributes, true) . ">$importSVG</button>";
      Severity: Critical
      Found in action/ajax.php by phan

      Call to method preventDefault from undeclared class \Doku_Event
      Open

              $event->preventDefault();
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared function \auth_isadmin()
      Open

              if (!auth_isadmin()) {
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared function \plugin_load()
      Open

              $data = plugin_load('helper', 'issuelinks_data');
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared function \plugin_load()
      Open

              $data = plugin_load('helper', 'issuelinks_data');
      Severity: Critical
      Found in action/ajax.php by phan

      Call to undeclared function \msg()
      Open

                  msg('Import not locked ' . $lockID, 2);
      Severity: Critical
      Found in action/ajax.php by phan

      Argument 1 (value) is 'true' but \ignore_user_abort() takes bool
      Open

              ignore_user_abort('true');
      Severity: Minor
      Found in action/ajax.php by phan

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          private function getAdditionalIssueData($pmServiceName, $projectKey, $issueId, $isMergeRequest)
          {
              try {
                  $issue = Issue::getInstance($pmServiceName, $projectKey, $issueId, $isMergeRequest);
                  $issue->getFromDB();
      Severity: Major
      Found in action/ajax.php and 1 other location - About 1 hr to fix
      action/ajax.php on lines 294..307

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 105.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          private function getIssueTooltipHTML($pmServiceName, $projectKey, $issueId, $isMergeRequest)
          {
              try {
                  $issue = Issue::getInstance($pmServiceName, $projectKey, $issueId, $isMergeRequest);
                  $issue->getFromDB();
      Severity: Major
      Found in action/ajax.php and 1 other location - About 1 hr to fix
      action/ajax.php on lines 309..322

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 105.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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
      Severity: Minor
      Found in action/ajax.php by phpcodesniffer

      The class action_plugin_issuelinks_ajax is not named in CamelCase.
      Open

      class action_plugin_issuelinks_ajax extends DokuWiki_Action_Plugin
      {
      
          /** @var helper_plugin_issuelinks_util util */
          public $util;
      Severity: Minor
      Found in action/ajax.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

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

      class action_plugin_issuelinks_ajax extends DokuWiki_Action_Plugin
      Severity: Minor
      Found in action/ajax.php by phpcodesniffer

      The variable $INPUT is not named in camelCase.
      Open

          public function handleAjax(Doku_Event $event, $param)
          {
              if ($event->data !== 'plugin_issuelinks') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function handleAjax(Doku_Event $event, $param)
          {
              if ($event->data !== 'plugin_issuelinks') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function repoAdminOrg(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_getorg') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function asyncImportAllIssues(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_import_all_issues_async') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function asyncImportAllIssues(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_import_all_issues_async') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function repoAdminOrg(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_getorg') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function repoAdminOrg(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_getorg') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function handleAjax(Doku_Event $event, $param)
          {
              if ($event->data !== 'plugin_issuelinks') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function handleAjax(Doku_Event $event, $param)
          {
              if ($event->data !== 'plugin_issuelinks') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INFO is not named in camelCase.
      Open

          public function repoAdminToggle(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_toggle') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function repoAdminToggle(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_toggle') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function repoAdminToggle(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_toggle') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function handleAjax(Doku_Event $event, $param)
          {
              if ($event->data !== 'plugin_issuelinks') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function repoAdminToggle(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_toggle') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function asyncImportAllIssues(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_import_all_issues_async') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function repoAdminToggle(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_toggle') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function handleAjax(Doku_Event $event, $param)
          {
              if ($event->data !== 'plugin_issuelinks') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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 $INPUT is not named in camelCase.
      Open

          public function repoAdminToggle(Doku_Event $event, $param)
          {
              if ($event->data !== 'issuelinks_repo_admin_toggle') {
                  return;
              }
      Severity: Minor
      Found in action/ajax.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