Leuchtfeuer/auth0-for-typo3

View on GitHub

Showing 31 of 31 total issues

Function deleteAction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function deleteAction(array $property, string $table, string $type): ResponseInterface
    {
        if ((bool)$property['readOnly'] === false) {
            $auth0Configuration = GeneralUtility::makeInstance(Auth0Configuration::class);
            $configuration = $auth0Configuration->load();
Severity: Minor
Found in Classes/Controller/PropertyController.php - About 35 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 mapRoles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function mapRoles(array $groupMapping, array &$groupsToAssign, bool &$isBeAdmin, bool &$shouldUpdate): void
    {
        $rolesKey = $this->yamlConfiguration['roles']['key'] ?? 'roles';
        $roles = (array)$this->user['app_metadata'][$rolesKey] ?? [];

Severity: Minor
Found in Classes/Utility/Database/UpdateUtility.php - About 35 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 setIssuer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setIssuer(): void
    {
        if (!ModeUtility::isBackend()) {
            try {
                if (!$GLOBALS['TSFE']) {
Severity: Minor
Found in Classes/Utility/TokenUtility.php - About 35 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

Avoid too many return statements within this method.
Open

        return $this->handleFrontendCallback($request, $dataSet);
Severity: Major
Found in Classes/Middleware/CallbackMiddleware.php - About 30 mins to fix

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

        protected function updateUsers(): int
        {
            $userCount = 0;
            try {
                $auth0 = ApplicationFactory::build($this->configuration->getBackendConnection());
    Severity: Minor
    Found in Classes/Command/CleanUpCommand.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 getGroupMappingFromDatabase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getGroupMappingFromDatabase(): array
        {
            $groupMapping = [];
            $userGroupRepository = $this->getUserGroupRepository();
    
    
    Severity: Minor
    Found in Classes/Utility/Database/UpdateUtility.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 getSummary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getSummary(array $params): string
        {
            $this->listType = $params['row']['list_type'];
            $this->flexFormData = GeneralUtility::xml2array($params['row']['pi_flexform']);
    
    
    Severity: Minor
    Found in Classes/Hooks/PageLayoutViewHook.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 getAuth0ValueRecursive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getAuth0ValueRecursive(array $user, array $properties): string
        {
            $property = array_shift($properties);
    
            if (isset($user[$property])) {
    Severity: Minor
    Found in Classes/Utility/ParseFuncUtility.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 logoutAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function logoutAction(): void
        {
            $application = GeneralUtility::makeInstance(ApplicationRepository::class)->findByUid($this->application);
            $singleLogOut = isset($this->settings['softLogout']) ? !(bool)$this->settings['softLogout'] : $application->isSingleLogOut();
    
    
    Severity: Minor
    Found in Classes/Controller/LoginController.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 updateUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function updateUser(Auth0 $auth0, int $application): void
        {
            try {
                $this->logger->notice('Try to update user.');
                if ($auth0->exchange()) {
    Severity: Minor
    Found in Classes/Utility/UserUtility.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 initAuth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function initAuth($mode, $loginData, $authInfo, $pObj): void
        {
            // Set default values
            $this->setDefaults($authInfo, $mode, $loginData, $pObj);
    
    
    Severity: Minor
    Found in Classes/Service/AuthenticationService.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