@Override
    protected BigDecimal calculateScore(final ClientInfo clientInfo,
                                        final Authentication authentication,
                                        final RegisteredService service,
                                        final List<? extends CasEvent> events) {
        val agent = clientInfo.getUserAgent();
        LOGGER.debug("Filtering authentication events for user agent [{}]", agent);
        val count = events.stream()
            .filter(e -> StringUtils.isNotBlank(e.getAgent()))
            .filter(e -> e.getAgent().equalsIgnoreCase(agent))
            .count();
        LOGGER.debug("Total authentication events found for [{}]: [{}]", agent, count);
        return calculateScoreBasedOnEventsCount(authentication, events, count);
    }
This is {@link UserAgentAuthenticationRequestRiskCalculator}.

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