clang-tidy readability-function-cognitive-complexity

clang-format
This commit is contained in:
2025-07-20 16:12:27 +02:00
parent f2915aa4b4
commit 2620a76865
56 changed files with 2376 additions and 2295 deletions

View File

@@ -56,12 +56,9 @@ void Notifier::update() {
clearFinishedNotifications();
}
bool Notifier::shouldProcessNotification(int index) const {
auto Notifier::shouldProcessNotification(int index) const -> bool {
// Si la notificación anterior está "saliendo", no hagas nada
if (index > 0 && notifications_[index - 1].state == NotificationStatus::RISING) {
return false;
}
return true;
return !(index > 0 && notifications_[index - 1].state == NotificationStatus::RISING);
}
void Notifier::processNotification(int index) {
@@ -103,11 +100,11 @@ void Notifier::updateNotificationState(int index) {
void Notifier::handleRisingState(int index) {
auto& notification = notifications_[index];
const float step = (float)notification.counter / notification.travel_dist;
const int alpha = 255 * step;
const float STEP = (float)notification.counter / notification.travel_dist;
const int ALPHA = 255 * STEP;
moveNotificationVertically(notification, param.notification.pos_v == NotifyPosition::TOP ? 1 : -1);
notification.texture->setAlpha(alpha);
notification.texture->setAlpha(ALPHA);
if (notification.rect.y == notification.y) {
transitionToStayState(index);
@@ -126,11 +123,11 @@ void Notifier::handleStayState(int index) {
void Notifier::handleVanishingState(int index) {
auto& notification = notifications_[index];
const float step = notification.counter / (float)notification.travel_dist;
const int alpha = 255 * (1 - step);
const float STEP = notification.counter / (float)notification.travel_dist;
const int ALPHA = 255 * (1 - STEP);
moveNotificationVertically(notification, param.notification.pos_v == NotifyPosition::TOP ? -1 : 1);
notification.texture->setAlpha(alpha);
notification.texture->setAlpha(ALPHA);
if (notification.rect.y == notification.y - notification.travel_dist) {
notification.state = NotificationStatus::FINISHED;