<commit_before>package org.kumoricon.presenter;

import org.kumoricon.model.badge.Badge;
import org.kumoricon.model.badge.BadgeRepository;
import org.kumoricon.view.HomeView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
@Scope("request")
public class HomePresenter {

    @Autowired
    private BadgeRepository badgeRepository;


    private HomeView view;

    public void showBadges() {
        List<Badge> badges = badgeRepository.findByVisibleTrue();
        view.showBadges(badges);
    }

    public HomeView getView() { return view; }
<commit_msg>If no badges are defined, don't try to display them.<commit_after>package org.kumoricon.presenter;

import org.kumoricon.model.badge.Badge;
import org.kumoricon.model.badge.BadgeRepository;
import org.kumoricon.view.HomeView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
@Scope("request")
public class HomePresenter {

    @Autowired
    private BadgeRepository badgeRepository;


    private HomeView view;

    public void showBadges() {
        List<Badge> badges = badgeRepository.findByVisibleTrue();
        if (badges.size() > 0) {
            view.showBadges(badges);
        }
    }

    public HomeView getView() { return view; }

{'fraction_non_alphanumeric': 0.09735099337748344, 'fraction_numerical': 0.0006622516556291391, 'mean_word_length': 4.320422535211268, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7586653', 'n_tokens_mistral': 461, 'n_tokens_neox': 444, 'n_words': 92}