stingus/StingusJiraBundle

View on GitHub
Controller/OauthController.php

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 8 of 8 total issues

Method callbackAction has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function callbackAction(Request $request): RedirectResponse
{
try {
$oauthToken = null;
if ($this->has('stingus_jira.oauth_token_manager')) {
Severity: Minor
Found in Controller/OauthController.php - About 1 hr to fix

    Method connectAction has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    public function connectAction(Request $request): RedirectResponse
    {
    $tokenId = $request->query->get('tokenId');
    $consumerKey = $request->query->get('consumerKey');
    $baseUrl = $request->query->get('baseUrl');
    Severity: Minor
    Found in Controller/OauthController.php - About 1 hr to fix

      Function callbackAction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      public function callbackAction(Request $request): RedirectResponse
      {
      try {
      $oauthToken = null;
      if ($this->has('stingus_jira.oauth_token_manager')) {
      Severity: Minor
      Found in Controller/OauthController.php - About 55 mins to fix

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

      public function connectAction(Request $request): RedirectResponse
      {
      $tokenId = $request->query->get('tokenId');
      $consumerKey = $request->query->get('consumerKey');
      $baseUrl = $request->query->get('baseUrl');
      Severity: Minor
      Found in Controller/OauthController.php - About 25 mins to fix

      Avoid assigning values to variables in if clauses and the like (line '33', column '22').
      Open

      public function connectAction(Request $request): RedirectResponse
      {
      $tokenId = $request->query->get('tokenId');
      $consumerKey = $request->query->get('consumerKey');
      $baseUrl = $request->query->get('baseUrl');
      Severity: Minor
      Found in Controller/OauthController.php by phpmd

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

      } else {
      $this->addFlash(
      'error',
      $this->get('translator')->trans('jira.errors.general', [], 'StingusJiraBundle')
      );
      Severity: Minor
      Found in Controller/OauthController.php by phpmd

      Avoid assigning values to variables in if clauses and the like (line '82', column '30').
      Open

      public function callbackAction(Request $request): RedirectResponse
      {
      try {
      $oauthToken = null;
      if ($this->has('stingus_jira.oauth_token_manager')) {
      Severity: Minor
      Found in Controller/OauthController.php by phpmd

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

      } else {
      $this->addFlash(
      'error',
      $this->get('translator')->trans('jira.errors.general', [], 'StingusJiraBundle')
      );
      Severity: Minor
      Found in Controller/OauthController.php by phpmd
      Category
      Status