<commit_before><?php

namespace Mfc\Prometheus\Domain\Repository;

/**
 * Class PowermailRepository
 * @package Mfc\Prometheus\Domain\Repository
 */
class PowermailRepository extends BaseRepository
{

    /**
     * @return array
     */
    public function getMetricsValues()
    {
        $data = [];

        $forms = $this->getDatabaseConnection()->exec_SELECTgetRows(
            'tx_powermail_domain_model_form.uid, tx_powermail_domain_model_form.title, count(mail.uid) AS mail_count',
            'tx_powermail_domain_model_form, tx_powermail_domain_model_mail AS mail',
            'tx_powermail_domain_model_form.uid = mail.form' . $this->getEnableFields('tx_powermail_domain_model_form'),
            'tx_powermail_domain_model_form.uid',
            '',
            '',
            'uid'
        );

        if ($forms !== null) {
            $data['typo3_powermail_forms_total'] = count($forms);
        }


        $mailSum = 0;
        foreach ($forms as $formUid => $formData) {
            $data['typo3_powermail_form_mails_total{form_title="'. $formData['title'] .'", form_uid="'. $formUid .'"}'] =
                $formData['mail_count'];
            $mailSum += $formData['mail_count'];<commit_msg>[BUGFIX] added escaping of form title<commit_after><?php

namespace Mfc\Prometheus\Domain\Repository;

/**
 * Class PowermailRepository
 * @package Mfc\Prometheus\Domain\Repository
 */
class PowermailRepository extends BaseRepository
{

    /**
     * @return array
     */
    public function getMetricsValues()
    {
        $data = [];

        $forms = $this->getDatabaseConnection()->exec_SELECTgetRows(
            'tx_powermail_domain_model_form.uid, tx_powermail_domain_model_form.title, count(mail.uid) AS mail_count',
            'tx_powermail_domain_model_form, tx_powermail_domain_model_mail AS mail',
            'tx_powermail_domain_model_form.uid = mail.form' . $this->getEnableFields('tx_powermail_domain_model_form'),
            'tx_powermail_domain_model_form.uid',
            '',
            '',
            'uid'
        );

        if ($forms !== null) {
            $data['typo3_powermail_forms_total'] = count($forms);
        }


        $mailSum = 0;
        foreach ($forms as $formUid => $formData) {
            $data['typo3_powermail_form_mails_total{form_title="'. addslashes($formData['title']) .'", form_uid="'. $formUid .'"}'] =
                $formData['mail_count'];
            $mailSum += $formData['mail_count'];
{'fraction_non_alphanumeric': 0.1319838056680162, 'fraction_numerical': 0.0024291497975708503, 'mean_word_length': 2.743939393939394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4662750', 'n_tokens_mistral': 785, 'n_tokens_neox': 771, 'n_words': 108}