<commit_before><?php namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Project;
use App\Deployment;

use Illuminate\Http\Request;

class DashboardController extends Controller
{
    /**
     * The main page of the dashboard
     *
     * @return \Illuminate\View\View
     */
    public function index()
    {
        // Get the latest 15 deployments
        $deployments = Deployment::take(15)
                                 ->orderBy('started_at', 'DESC')
                                 ->get();

        $grouped_by_date = [];
        foreach ($deployments as $deployment) {
            $date = $deployment->started_at->format('Y-m-d');
<commit_msg>Excluding deleted projects from the timeline<commit_after><?php namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Project;
use App\Deployment;

use Illuminate\Http\Request;

class DashboardController extends Controller
{
    /**
     * The main page of the dashboard
     *
     * @return \Illuminate\View\View
     */
    public function index()
    {
        // Get the latest 15 deployments
        $deployments = Deployment::whereRaw('project_id IN (SELECT id FROM projects WHERE deleted_at IS NULL)') // FIXME: Surely there is a nicer way to do this?
                                 ->take(15)
                                 ->orderBy('started_at', 'DESC')
                                 ->get();

        $grouped_by_date = [];
        foreach ($deployments as $deployment) {
            $date = $deployment->started_at->format('Y-m-d');

{'fraction_non_alphanumeric': 0.11187072715972654, 'fraction_numerical': 0.004972032318210068, 'mean_word_length': 2.09021113243762, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2263362', 'n_tokens_mistral': 456, 'n_tokens_neox': 450, 'n_words': 115}