Showing 27 of 27 total issues
Function authenticate
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function authenticate(ServerRequestInterface $request, array $credentials, array $onlyCheck = [])
{
if (empty($authenticators = $this->authenticators)) {
throw new ProviderNotFoundException('No authenticator found.');
}
- Read upRead up
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 consumeRememberMeCookie
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function consumeRememberMeCookie(string $rawCookie, UserProviderInterface $userProvider): array
{
[, $identifier, $expires, $value] = self::fromRawCookie($rawCookie);
if (!\str_contains($value, ':')) {
- Read upRead up
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 authenticate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function authenticate(ServerRequestInterface $request, array $credentials, string $firewallName): ?TokenInterface
{
$loadedUsers = $cookies = [];
foreach ($request->getCookieParams() as $cookieName => $rawCookie) {
- Read upRead up
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 authenticate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function authenticate(ServerRequestInterface $request, array $credentials, $firewallName): ?TokenInterface
{
if (empty($credentials)) {
return null;
}
- Read upRead up
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 __construct
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(object $storage, $expiry = 60 * 60 * 24 * 30)
{
$this->storage = function (string $key, TokenInterface $token = null) use ($storage, $expiry): ?TokenInterface {
if (1 === \func_num_args()) {
if ($storage instanceof CacheItemPoolInterface) {
- Read upRead up
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 authenticate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function authenticate(ServerRequestInterface $request, array $credentials, array $onlyCheck = [])
{
if (empty($authenticators = $this->authenticators)) {
throw new ProviderNotFoundException('No authenticator found.');
}
Method consumeRememberMeCookie
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function consumeRememberMeCookie(string $rawCookie, UserProviderInterface $userProvider): array
{
[, $identifier, $expires, $value] = self::fromRawCookie($rawCookie);
if (!\str_contains($value, ':')) {
Method authenticate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function authenticate(ServerRequestInterface $request, array $credentials, $firewallName): ?TokenInterface
{
if (empty($credentials)) {
return null;
}
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$errorIo = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
$input->isInteractive() ? $errorIo->title('Biurad User Utility') : $errorIo->newLine();
Function authenticate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function authenticate(ServerRequestInterface $request, array $credentials, string $firewallName): ?TokenInterface
{
if (isset($credentials['g-recaptcha-response'])) {
if (empty($captcha = $credentials['g-recaptcha-response'])) {
throw new BadCredentialsException('The presented captcha cannot be empty.');
- Read upRead up
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 supports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function supports(ServerRequestInterface $request): bool
{
if (!$username = ($request->getServerParams()[$this->userKey] ?? null)) {
$username = $request->getServerParams()[$this->credentialsKey] ?? null;
- Read upRead up
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 getParameterValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getParameterValue(object $data, string $path, PropertyAccessorInterface $propertyAccessor = null)
{
if ($data instanceof ServerRequestInterface) {
$getter = static function (string $value) use ($data) {
if ($data instanceof Request) {
- Read upRead up
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 __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
array $authenticators,
TokenStorageInterface $tokenStorage,
AccessDecisionManagerInterface $accessDecisionManager,
UserCheckerInterface $userChecker = null,
AbstractRequestRateLimiter $limiter = null,
Method __construct
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(object $storage, $expiry = 60 * 60 * 24 * 30)
{
$this->storage = function (string $key, TokenInterface $token = null) use ($storage, $expiry): ?TokenInterface {
if (1 === \func_num_args()) {
if ($storage instanceof CacheItemPoolInterface) {
Method authenticate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function authenticate(ServerRequestInterface $request, array $credentials, string $firewallName): ?TokenInterface
{
$loadedUsers = $cookies = [];
foreach ($request->getCookieParams() as $cookieName => $rawCookie) {
Method getParameterValue
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getParameterValue(object $data, string $path, PropertyAccessorInterface $propertyAccessor = null)
{
if ($data instanceof ServerRequestInterface) {
$getter = static function (string $value) use ($data) {
if ($data instanceof Request) {
Function executeAuthenticator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function executeAuthenticator(AuthenticatorInterface $authenticator, ServerRequestInterface $request, array $credentials): ?TokenInterface
{
$token = $authenticator->authenticate($request, $credentials, $this->firewallName);
if (null !== $token) {
- Read upRead up
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 determineTargetUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function determineTargetUrl(
ServerRequestInterface $request,
SessionInterface $session = null,
string $parameter = '_target_path',
bool $fromReferer = false
- Read upRead up
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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $secret,
TokenProviderInterface $tokenProvider = null,
TokenVerifierInterface $tokenVerifier = null,
SignatureHasher $signatureHasher = null,
string $requestParameter = '_remember_me',
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
UserProviderInterface $provider,
PasswordHasherFactoryInterface $hasherFactory,
RememberMeHandler $rememberMeHandler = null,
string $userParameter = '_identifier',
string $passwordParameter = '_password'