cosmocode/dokuwiki-plugin-issuelinks

View on GitHub
services/GitHub.service.php

Summary

Maintainability
F
3 days
Test Coverage

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

    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

      The class GitHub has an overall complexity of 76 which is very high. The configured complexity threshold is 50.
      Open

      class GitHub extends AbstractService
      {
      
      
          const SYNTAX = 'gh';
      Severity: Minor
      Found in services/GitHub.service.php by phpmd

      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

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

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

            Avoid too many return statements within this method.
            Open

                        return false;
            Severity: Major
            Found in services/GitHub.service.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return true;
              Severity: Major
              Found in services/GitHub.service.php - About 30 mins to fix

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

                    protected function isOurIssueHook($hook)
                    {
                        if ($hook['config']['url'] !== self::WEBHOOK_URL) {
                            return false;
                        }
                Severity: Minor
                Found in services/GitHub.service.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 getListOfAllReposAndHooks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getListOfAllReposAndHooks($organisation)
                    {
                        $endpoint = "/orgs/$organisation/repos";
                        try {
                            $repos = $this->makeGitHubGETRequest($endpoint);
                Severity: Minor
                Found in services/GitHub.service.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 retrieveAllIssues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function retrieveAllIssues($projectKey, &$startat = 0)
                    {
                        $perPage = 30;
                        $page = ceil(($startat + 1) / $perPage);
                        // FIXME: implent `since` parameter?
                Severity: Minor
                Found in services/GitHub.service.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

                Class "GitHub" has 28 methods, which is greater than 20 authorized. Split it into smaller classes.
                Open

                class GitHub extends AbstractService
                Severity: Major
                Found in services/GitHub.service.php by sonar-php

                A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

                Reduce the number of returns of this function 4, down to the maximum allowed 3.
                Open

                    public function isConfigured()
                Severity: Major
                Found in services/GitHub.service.php by sonar-php

                Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                Noncompliant Code Example

                With the default threshold of 3:

                function myFunction(){ // Noncompliant as there are 4 return statements
                  if (condition1) {
                    return true;
                  } else {
                    if (condition2) {
                      return false;
                    } else {
                      return true;
                    }
                  }
                  return false;
                }
                

                Reduce the number of returns of this function 4, down to the maximum allowed 3.
                Open

                    protected function getTypeFromLabels(array $labels)
                Severity: Major
                Found in services/GitHub.service.php by sonar-php

                Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                Noncompliant Code Example

                With the default threshold of 3:

                function myFunction(){ // Noncompliant as there are 4 return statements
                  if (condition1) {
                    return true;
                  } else {
                    if (condition2) {
                      return false;
                    } else {
                      return true;
                    }
                  }
                  return false;
                }
                

                Reduce the number of returns of this function 6, down to the maximum allowed 3.
                Open

                    protected function isOurIssueHook($hook)
                Severity: Major
                Found in services/GitHub.service.php by sonar-php

                Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                Noncompliant Code Example

                With the default threshold of 3:

                function myFunction(){ // Noncompliant as there are 4 return statements
                  if (condition1) {
                    return true;
                  } else {
                    if (condition2) {
                      return false;
                    } else {
                      return true;
                    }
                  }
                  return false;
                }
                

                Missing class import via use statement (line '31', column '37').
                Open

                        $this->dokuHTTPClient = new \DokuHTTPClient();
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                MissingImport

                Since: 2.7.0

                Importing all external classes in a file through use statements makes them clearly visible.

                Example

                function make() {
                    return new \stdClass();
                }

                Source http://phpmd.org/rules/cleancode.html#MissingImport

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

                        $issue = Issue::getInstance('github', $projectKey, $issueId, false);
                Severity: Minor
                Found in services/GitHub.service.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 'parseIssueSyntax'.
                Open

                        $issue = Issue::getInstance('github', $projectKey, $issueId, true);
                Severity: Minor
                Found in services/GitHub.service.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 'saveIssue'.
                Open

                        $issue = Issue::getInstance(
                            'github',
                            $data['repository']['full_name'],
                            $data['issue']['number'],
                            false,
                Severity: Minor
                Found in services/GitHub.service.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 'retrieveAllIssues'.
                Open

                                $issue = Issue::getInstance(
                                    'github',
                                    $projectKey,
                                    $issueData['number'],
                                    !empty($issueData['pull_request'])
                Severity: Minor
                Found in services/GitHub.service.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

                Define a constant instead of duplicating this literal "merged" 4 times.
                Open

                        $issue->setStatus(isset($info['merged']) ? 'merged' : $info['state']);
                Severity: Critical
                Found in services/GitHub.service.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 "events" 3 times.
                Open

                            'events' => ['issues', 'issue_comment', 'pull_request'],
                Severity: Critical
                Found in services/GitHub.service.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.

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

                        // fixme: add 'user repos'!
                Severity: Major
                Found in services/GitHub.service.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 "assignee" 3 times.
                Open

                        if ($info['assignee']) {
                Severity: Critical
                Found in services/GitHub.service.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 "pull_request" 4 times.
                Open

                            'events' => ['issues', 'issue_comment', 'pull_request'],
                Severity: Critical
                Found in services/GitHub.service.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 "config" 4 times.
                Open

                            "config" => $config,
                Severity: Critical
                Found in services/GitHub.service.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.

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

                        // FIXME: implent `since` parameter?
                Severity: Major
                Found in services/GitHub.service.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 "full_name" 3 times.
                Open

                            $repo->full_name = $repoData['full_name'];
                Severity: Critical
                Found in services/GitHub.service.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 "issuelinks_db" 7 times.
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.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.

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

                        // FIXME: this should be done by JIRA service class
                Severity: Major
                Found in services/GitHub.service.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

                Rename "$user" which has the same name as the field declared at line 21.
                Open

                            $user = $this->makeGitHubGETRequest('/user');
                Severity: Major
                Found in services/GitHub.service.php by sonar-php

                Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

                Noncompliant Code Example

                class Foo {
                  public $myField;
                
                  public function doSomething() {
                    $myField = 0;
                    ...
                  }
                }
                

                See

                Define a constant instead of duplicating this literal "github" 9 times.
                Open

                    const ID = 'github';
                Severity: Critical
                Found in services/GitHub.service.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.

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

                     * // FIXME: set Header application/vnd.github.symmetra-preview+json ?
                Severity: Major
                Found in services/GitHub.service.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 "login" 3 times.
                Open

                            $issue->setAssignee($info['assignee']['login'], $info['assignee']['avatar_url']);
                Severity: Critical
                Found in services/GitHub.service.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 "helper" 9 times.
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.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.

                Remove this commented out code.
                Open

                //            $status = $this->connector->getLastStatus();
                Severity: Major
                Found in services/GitHub.service.php by sonar-php

                Programmers should not comment out code as it bloats programs and reduces readability.

                Unused code should be deleted and can be retrieved from source control history if required.

                See

                • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
                • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
                • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
                • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

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

                        $authToken = $db->getKeyValue('github_token');
                Severity: Critical
                Found in services/GitHub.service.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.

                Rename "$scopes" which has the same name as the field declared at line 27.
                Open

                        $scopes = implode(', ', $this->scopes);
                Severity: Major
                Found in services/GitHub.service.php by sonar-php

                Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

                Noncompliant Code Example

                class Foo {
                  public $myField;
                
                  public function doSomething() {
                    $myField = 0;
                    ...
                  }
                }
                

                See

                Avoid unused parameters such as '$isMergeRequest'.
                Open

                    public static function getProjectIssueSeparator($isMergeRequest)
                Severity: Minor
                Found in services/GitHub.service.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 '$isMergeRequest'.
                Open

                    public function getIssueURL($projectId, $issueId, $isMergeRequest)
                Severity: Minor
                Found in services/GitHub.service.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 using dokuwiki\plugin\issuelinks\services\count() function in do loops.
                Open

                        do {
                            usleep($waittime);
                            try {
                                $data = $this->makeGitHubRequest($endpoint, [], 'GET', []);
                            } catch (ExternalServerException $e) {
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                CountInLoopExpression

                Since: 2.7.0

                Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

                Example

                class Foo {
                
                  public function bar()
                  {
                    $array = array();
                
                    for ($i = 0; count($array); $i++) {
                      // ...
                    }
                  }
                }

                Source https://phpmd.org/rules/design.html#countinloopexpression

                Property \dokuwiki\plugin\issuelinks\services\GitHub->dokuHTTPClient has undeclared type \DokuHTTPClient
                Open

                    protected $dokuHTTPClient;
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Call to method __construct from undeclared class \DokuHTTPClient
                Open

                        $this->dokuHTTPClient = new \DokuHTTPClient();
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \hsc()
                Open

                            $this->configError = 'The GitHub authentication failed with message: ' . hsc($e->getMessage());
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \dbglog()
                Open

                                    dbglog('Error repeats. Aborting Requests.', -1);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Reference to instance property resp_headers from undeclared class \DokuHTTPClient
                Open

                            $links = $utils->parseHTTPLinkHeaders($this->dokuHTTPClient->resp_headers['link']);
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Reference to instance property resp_headers from undeclared class \DokuHTTPClient
                Open

                        $headers = $this->dokuHTTPClient->resp_headers;
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Call to method addTextInput from undeclared class \dokuwiki\Form\Form
                Open

                        $configForm->addTextInput('githubToken', 'GitHub AccessToken')->useInput(false);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \blank()
                Open

                        $valid = !blank($summary);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to method addHTML from undeclared class \dokuwiki\Form\Form
                Open

                        $configForm->addHTML($message);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \blank()
                Open

                        $valid &= !blank($status);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Invalid offset "login" of array type array{}
                Open

                        return $this->user['login'];
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Saw unextractable annotation for comment '* @return'
                Open

                     * @return
                Severity: Info
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Reference to instance property resp_headers from undeclared class \DokuHTTPClient
                Open

                        $headers = $this->dokuHTTPClient->resp_headers;
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Call to undeclared function \dformat()
                Open

                                    dformat($this->dokuHTTPClient->resp_headers['x-ratelimit-reset'])
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \msg()
                Open

                                msg(hsc($e->getMessage()), -1);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \msg()
                Open

                                    msg('Error repeats. Aborting Requests.', -1);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                        $util = plugin_load('helper', 'issuelinks_util');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                            $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Reference to instance property resp_headers from undeclared class \DokuHTTPClient
                Open

                            if ($this->dokuHTTPClient->resp_headers['x-ratelimit-remaining'] < 500) {
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Reference to instance property resp_headers from undeclared class \DokuHTTPClient
                Open

                                    dformat($this->dokuHTTPClient->resp_headers['x-ratelimit-reset'])
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Reference to instance property status from undeclared class \DokuHTTPClient
                Open

                            $status = $this->dokuHTTPClient->status;
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Call to undeclared function \msg()
                Open

                                msg("Server Error occured. Waiting $waittime ms between requests and repeating request.", -1);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Reference to instance property status from undeclared class \DokuHTTPClient
                Open

                            $status = $this->dokuHTTPClient->status;
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \hsc()
                Open

                                msg(hsc($e->getMessage()), -1);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Returning type int but isIssueValid() is declared to return bool
                Open

                        return $valid;
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Call to undeclared function \msg()
                Open

                                msg(sprintf(
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Parameter $configForm has undeclared type \dokuwiki\Form\Form
                Open

                    public function hydrateConfigForm(Form $configForm)
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                            $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                        $utils = plugin_load('helper', 'issuelinks_util');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \dbglog()
                Open

                                dbglog("Server Error occured. Waiting $waittime ms between requests and repeating request.", -1);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Reference to instance property resp_headers from undeclared class \DokuHTTPClient
                Open

                            if (empty($this->dokuHTTPClient->resp_headers['link'])) {
                Severity: Minor
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                            $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \blank()
                Open

                        $valid &= !blank($type);
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \plugin_load()
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Critical
                Found in services/GitHub.service.php by phan

                Call to undeclared function \msg()
                Open

                            msg($e->getMessage() . ' ' . $e->getCode(), -1);
                Severity: Critical
                Found in services/GitHub.service.php by phan

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

                    protected function parseMergeRequestDescription($currentProject, $description)
                    {
                        $issues = [];
                
                        $issueOwnRepoPattern = '/(?:\W|^)#([1-9]\d*)\b/';
                Severity: Major
                Found in services/GitHub.service.php and 1 other location - About 4 hrs to fix
                services/GitLab.service.php on lines 388..414

                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 171.

                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

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

                    protected function getTypeFromLabels(array $labels)
                    {
                        $bugTypeLabels = ['bug'];
                        $improvementTypeLabels = ['enhancement'];
                        $storyTypeLabels = ['feature'];
                Severity: Major
                Found in services/GitHub.service.php and 1 other location - About 1 hr to fix
                services/GitLab.service.php on lines 357..376

                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 119.

                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

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

                    protected function estimateTotal($perPage, $default)
                    {
                        $headers = $this->dokuHTTPClient->resp_headers;
                
                        if (empty($headers['link'])) {
                Severity: Major
                Found in services/GitHub.service.php and 1 other location - About 1 hr to fix
                services/GitLab.service.php on lines 468..484

                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 118.

                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

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

                    public static function isIssueValid(Issue $issue)
                    {
                        $summary = $issue->getSummary();
                        $valid = !blank($summary);
                        $status = $issue->getStatus();
                Severity: Minor
                Found in services/GitHub.service.php and 1 other location - About 35 mins to fix
                services/Jira.service.php on lines 51..60

                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 92.

                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

                Avoid excessively long variable names like $improvementTypeLabels. Keep variable name length under 20.
                Open

                        $improvementTypeLabels = ['enhancement'];
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                LongVariable

                Since: 0.2

                Detects when a field, formal or local variable is declared with a long name.

                Example

                class Something {
                    protected $reallyLongIntName = -3; // VIOLATION - Field
                    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                        $otherReallyLongName = -5; // VIOLATION - Local
                        for ($interestingIntIndex = 0; // VIOLATION - For
                             $interestingIntIndex < 10;
                             $interestingIntIndex++ ) {
                        }
                    }
                }

                Source https://phpmd.org/rules/naming.html#longvariable

                Avoid variables with short names like $db. Configured minimum length is 3.
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                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 $db. Configured minimum length is 3.
                Open

                            $db = plugin_load('helper', 'issuelinks_db');
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                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

                            $id = $data['id'];
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                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 $db. Configured minimum length is 3.
                Open

                            $db = plugin_load('helper', 'issuelinks_db');
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                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 $db. Configured minimum length is 3.
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                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 $db. Configured minimum length is 3.
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                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 $db. Configured minimum length is 3.
                Open

                            $db = plugin_load('helper', 'issuelinks_db');
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                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

                The parameter $repo_id is not named in camelCase.
                Open

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                CamelCaseParameterName

                Since: 0.2

                It is considered best practice to use the camelCase notation to name parameters.

                Example

                class ClassName {
                    public function doSomething($user_name) {
                    }
                }

                Source

                Avoid variables with short names like $db. Configured minimum length is 3.
                Open

                        $db = plugin_load('helper', 'issuelinks_db');
                Severity: Minor
                Found in services/GitHub.service.php by phpmd

                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

                The variable $INPUT is not named in camelCase.
                Open

                    public function handleAuthorization()
                    {
                        global $INPUT;
                
                        $token = $INPUT->str('githubToken');
                Severity: Minor
                Found in services/GitHub.service.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 static function isOurWebhook()
                    {
                        global $INPUT;
                        $userAgent = $INPUT->server->str('HTTP_USER_AGENT');
                        return strpos($userAgent, self::WEBHOOK_UA) === 0;
                Severity: Minor
                Found in services/GitHub.service.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 $missing_scopes is not named in camelCase.
                Open

                    public function isConfigured()
                    {
                        /** @var \helper_plugin_issuelinks_db $db */
                        $db = plugin_load('helper', 'issuelinks_db');
                        $authToken = $db->getKeyValue('github_token');
                Severity: Minor
                Found in services/GitHub.service.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 static function isOurWebhook()
                    {
                        global $INPUT;
                        $userAgent = $INPUT->server->str('HTTP_USER_AGENT');
                        return strpos($userAgent, self::WEBHOOK_UA) === 0;
                Severity: Minor
                Found in services/GitHub.service.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 $missing_scopes is not named in camelCase.
                Open

                    public function isConfigured()
                    {
                        /** @var \helper_plugin_issuelinks_db $db */
                        $db = plugin_load('helper', 'issuelinks_db');
                        $authToken = $db->getKeyValue('github_token');
                Severity: Minor
                Found in services/GitHub.service.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 $signature_github is not named in camelCase.
                Open

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.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 $signature_local is not named in camelCase.
                Open

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.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 handleWebhook($webhookBody)
                    {
                        global $INPUT;
                        $data = json_decode($webhookBody, true);
                        $event = $INPUT->server->str('HTTP_X_GITHUB_EVENT');
                Severity: Minor
                Found in services/GitHub.service.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 handleAuthorization()
                    {
                        global $INPUT;
                
                        $token = $INPUT->str('githubToken');
                Severity: Minor
                Found in services/GitHub.service.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

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.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 $signature_github is not named in camelCase.
                Open

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.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

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.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 $missing_scopes is not named in camelCase.
                Open

                    public function isConfigured()
                    {
                        /** @var \helper_plugin_issuelinks_db $db */
                        $db = plugin_load('helper', 'issuelinks_db');
                        $authToken = $db->getKeyValue('github_token');
                Severity: Minor
                Found in services/GitHub.service.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 $repo_id is not named in camelCase.
                Open

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.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 $signature_local is not named in camelCase.
                Open

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.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

                    protected function isSignatureValid($body, $repo_id)
                    {
                        global $INPUT;
                        if (!$INPUT->server->has('HTTP_X_HUB_SIGNATURE')) {
                            return false;
                Severity: Minor
                Found in services/GitHub.service.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 handleWebhook($webhookBody)
                    {
                        global $INPUT;
                        $data = json_decode($webhookBody, true);
                        $event = $INPUT->server->str('HTTP_X_GITHUB_EVENT');
                Severity: Minor
                Found in services/GitHub.service.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