DerDu/SPHERE-Framework

View on GitHub
Application/Platform/Gatekeeper/Authentication/Frontend.php

Summary

Maintainability
F
4 days
Test Coverage

File Frontend.php has 537 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace SPHERE\Application\Platform\Gatekeeper\Authentication;

use SPHERE\Application\Education\Graduation\Evaluation\Evaluation;
Severity: Major
Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 1 day to fix

    Function frontendWelcome has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        public function frontendWelcome()
        {
    
            $Stage = new Stage('Willkommen', '', '');
            $IsMaintenance = false;
    Severity: Minor
    Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method frontendIdentificationAgb has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function frontendIdentificationAgb($tblAccount, $tblIdentification, $doAccept = 0)
        {
            $View = new Stage(new MoreItems().' Anmelden', '', $this->getIdentificationEnvironment());
    
            $tblAccount = Account::useService()->getAccountById($tblAccount);
    Severity: Major
    Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 4 hrs to fix

      Method frontendIdentificationToken has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function frontendIdentificationToken($tblAccount, $tblIdentification, $CredentialKey = null)
          {
              $View = new Stage(new YubiKey().' Anmelden', '', $this->getIdentificationEnvironment());
      
              $tblAccount = Account::useService()->getAccountById($tblAccount);
      Severity: Major
      Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 3 hrs to fix

        Method frontendIdentificationCredential has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function frontendIdentificationCredential($CredentialName = null, $CredentialLock = null)
            {
                $View = new Stage(new Nameplate().' Anmelden', '', $this->getIdentificationEnvironment());
        
                // Search for matching Account
        Severity: Major
        Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 3 hrs to fix

          Method frontendWelcome has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function frontendWelcome()
              {
          
                  $Stage = new Stage('Willkommen', '', '');
                  $IsMaintenance = false;
          Severity: Major
          Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 2 hrs to fix

            Function frontendIdentificationToken has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                public function frontendIdentificationToken($tblAccount, $tblIdentification, $CredentialKey = null)
                {
                    $View = new Stage(new YubiKey().' Anmelden', '', $this->getIdentificationEnvironment());
            
                    $tblAccount = Account::useService()->getAccountById($tblAccount);
            Severity: Minor
            Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function frontendIdentificationCredential has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                public function frontendIdentificationCredential($CredentialName = null, $CredentialLock = null)
                {
                    $View = new Stage(new Nameplate().' Anmelden', '', $this->getIdentificationEnvironment());
            
                    // Search for matching Account
            Severity: Minor
            Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function frontendIdentificationAgb has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function frontendIdentificationAgb($tblAccount, $tblIdentification, $doAccept = 0)
                {
                    $View = new Stage(new MoreItems().' Anmelden', '', $this->getIdentificationEnvironment());
            
                    $tblAccount = Account::useService()->getAccountById($tblAccount);
            Severity: Minor
            Found in Application/Platform/Gatekeeper/Authentication/Frontend.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

            Avoid deeply nested control flow statements.
            Open

                                    if ($tblAccount->getPassword() == $Password) {
                                        $IsEqual = true;
                                    }
            Severity: Major
            Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 45 mins to fix

              Avoid too many return statements within this method.
              Open

                      return $View;
              Severity: Major
              Found in Application/Platform/Gatekeeper/Authentication/Frontend.php - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status