daikon-cqrs/security-interop

View on GitHub

Showing 5 of 5 total issues

Method execute has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(ActionInterface $action, DaikonRequest $request): ResponseInterface
    {
        try {
            // Check action access first before running validation
            if ($action instanceof SecureActionInterface) {
Severity: Minor
Found in src/Middleware/SecureActionHandler.php - About 1 hr to fix

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

        public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
        {
            $requestHandler = $request->getAttribute(RoutingHandler::REQUEST_HANDLER);
            if (!$requestHandler instanceof SecureActionInterface) {
                return $handler->handle($request);
    Severity: Minor
    Found in src/Middleware/JwtAuthenticator.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

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

        protected function execute(ActionInterface $action, DaikonRequest $request): ResponseInterface
        {
            try {
                // Check action access first before running validation
                if ($action instanceof SecureActionInterface) {
    Severity: Minor
    Found in src/Middleware/SecureActionHandler.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 process has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
        {
            $requestHandler = $request->getAttribute(RoutingHandler::REQUEST_HANDLER);
            if (!$requestHandler instanceof SecureActionInterface) {
                return $handler->handle($request);
    Severity: Minor
    Found in src/Middleware/JwtAuthenticator.php - About 1 hr to fix

      Method registerRules has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private function registerRules(Acl &$acl, string $type, array $rules, array $roles, string $resource = null): void
      Severity: Minor
      Found in src/Authorization/LaminasAclProvisioner.php - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language