<commit_before><?php
    use TmlpStats\Quarter;

    $divId = isset($divId) ? $divId : 'rating-container';

    $display = (isset($statsReport) || (isset($globalReport) && isset($region)));

    if (isset($statsReport)) {
        $report = $statsReport;
        $quarter = $report->quarter;
        $requestClass = 'LocalReport';
    } else if (isset($globalReport) && isset($regions)) {
        $report = $globalReport;
        $quarter = Quarter::getQuarterByDate($report->reportingDate, $regions[0]->getParentGlobalRegion());
        $requestClass = 'GlobalReport';
    }
?>
@if ($display)
<script>
    var chartData = [];
    var seriesNames = [];

    function updateChart(reportData, seriesName) {
        chartData.push(reportData);
        seriesNames.push(seriesName);

        var series = [];
        var now = new Date();
        for (var i = 0; i < chartData.length; i++) {
            reportData = chartData[i];

            var data = [];
            for (var key in reportData) {
                if (!reportData.hasOwnProperty(key)) continue;

                var date = Date.parse(key);
                if (now < date) continue;

                var obj = reportData[key];

                data.push([Date.parse(key), obj.points.total]);
            }

            series.push({
                name: seriesNames[i],
                data: data
            });
        }

        $("#{{ $divId }}").highcharts({
            chart: {<commit_msg>Only show up to reportingDate on effectiveness graphs<commit_after><?php
    use TmlpStats\Quarter;

    $divId = isset($divId) ? $divId : 'rating-container';

    $display = (isset($statsReport) || (isset($globalReport) && isset($region)));

    if (isset($statsReport)) {
        $report = $statsReport;
        $quarter = $report->quarter;
        $requestClass = 'LocalReport';
    } else if (isset($globalReport) && isset($regions)) {
        $report = $globalReport;
        $quarter = Quarter::getQuarterByDate($report->reportingDate, $regions[0]->getParentGlobalRegion());
        $requestClass = 'GlobalReport';
    }
?>
@if ($display)
<script>
    var chartData = [];
    var seriesNames = [];

    function updateChart(reportData, seriesName) {
        chartData.push(reportData);
        seriesNames.push(seriesName);

        var series = [];
        var now = new Date(settings.reportingDate);
        for (var i = 0; i < chartData.length; i++) {
            reportData = chartData[i];

            var data = [];
            for (var key in reportData) {
                if (!reportData.hasOwnProperty(key)) continue;

                var date = Date.parse(key);
                if (now < date) continue;

                var obj = reportData[key];

                data.push([Date.parse(key), obj.points.total]);
            }

            series.push({
                name: seriesNames[i],
                data: data
            });
        }

        $("#{{ $divId }}").highcharts({
            chart: {
{'fraction_non_alphanumeric': 0.1465459423205902, 'fraction_numerical': 0.0013413816230717639, 'mean_word_length': 2.0161779575328613, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '3953522', 'n_tokens_mistral': 863, 'n_tokens_neox': 821, 'n_words': 181}