@Override
    public final AuthenticationRiskScore calculate(final Authentication authentication,
                                                   final RegisteredService service,
                                                   final ClientInfo clientInfo) {
        val principal = authentication.getPrincipal();
        val events = getCasTicketGrantingTicketCreatedEventsFor(principal.getId()).collect(Collectors.toList());
        if (events.isEmpty()) {
            return AuthenticationRiskScore.highestRiskScore();
        }
        val score = calculateScore(clientInfo, authentication, service, events);
        val authenticationRiskScore = new AuthenticationRiskScore(score).withClientInfo(ClientInfoHolder.getClientInfo());
        LOGGER.debug("Calculated authentication risk score by [{}] is [{}]", getClass().getSimpleName(), authenticationRiskScore);
        return authenticationRiskScore;
    }
This is {@link BaseAuthenticationRequestRiskCalculator}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-electrofence/src/main/java/org/apereo/cas/impl/calcs/BaseAuthenticationRequestRiskCalculator.java