rhosocial/rho.social

View on GitHub

Showing 48 of 1,384 total issues

Avoid too many return statements within this method.
Open

                return $this->controller->render('error', ['result' => ['err' => '40041', 'msg' => 'Authorization Failed.']]);
Severity: Major
Found in rho.social/modules/api/controllers/authorize/ConfirmAction.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return $this->controller->redirect($this->buildRedirectUri($redirect_uri, $authorization_code->authorization_code, $state));
    Severity: Major
    Found in rho.social/modules/api/controllers/authorize/ConfirmAction.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $region . " " . $district->localname;
      Severity: Major
      Found in my.rho.social/widgets/item/AddressItemWidget.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $this->controller->render('confirm', ['authorize_model' => $authorize_model]);
        Severity: Major
        Found in rho.social/modules/api/controllers/authorize/ConfirmAction.php - About 30 mins to fix

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

              public function notifyOthers($event)
              {
                  if (Yii::$app->user->isGuest) {
                      return;
                  }
          Severity: Minor
          Found in common/models/user/contact/Address.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function run()
              {
                  if (!Yii::$app->user->isGuest) {
                      $homeUrlManager = Yii::$app->multiDomainsManager->get();
                      return $this->controller->redirect($homeUrlManager->createAbsoluteUrl(''));
          Severity: Minor
          Found in reg.rho.social/controllers/register/IndexAction.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 login has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function login()
              {
                  $user = $this->getUser();
                  if ($this->validate()) {
                      if ($user) {
          Severity: Minor
          Found in sso.rho.social/models/LoginForm.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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function init()
              {
                  parent::init();
          
                  $session = \Yii::$app->getSession();
          Severity: Minor
          Found in common/widgets/Alert.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

          Severity
          Category
          Status
          Source
          Language