<commit_before>﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using CVGS.Models;

namespace CVGS.Controllers
{
    public class GamesController : Controller
    {
        private CVGSEntities db = new CVGSEntities();

        // GET: Games
        public ActionResult Index(string search)
        {
            var gameList = db.GAMEs.ToList();
            if(search != null && !search.Equals(""))
            {
                int listSize = gameList.Count();
                int arrayIndex = 0;
                //TODO: Filter game list properly
                while(arrayIndex < listSize)
                {
                    if (!gameList[arrayIndex].Title.ToLower().Contains(search.ToLower()))
                    {
                        gameList.RemoveAt(arrayIndex);
                        listSize--;
                    }
                    else
                    {
                        arrayIndex++;
                    }
                }
            }
            return View(gameList);
        }

        // GET: Games/Details/5
        public ActionResult Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            GAME gAME = db.GAMEs.Find(id);
            ViewBag.gameTitle = gAME.Title;<commit_msg>Clean up search<commit_after>﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using CVGS.Models;

namespace CVGS.Controllers
{
    public class GamesController : Controller
    {
        private CVGSEntities db = new CVGSEntities();

        // GET: Games
        public ActionResult Index(string search)
        {
            var gamesList = db.GAMEs.ToList();
            if(search != null)
            {
                gamesList = gamesList.FindAll(x => x.Title.ToLower().Contains(search.ToLower()));
            }
            return View(gamesList);
        }

        // GET: Games/Details/5
        public ActionResult Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            GAME gAME = db.GAMEs.Find(id);
            ViewBag.gameTitle = gAME.Title;
{'fraction_non_alphanumeric': 0.09576202118989405, 'fraction_numerical': 0.0012224938875305623, 'mean_word_length': 1.5, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1538979', 'n_tokens_mistral': 655, 'n_tokens_neox': 639, 'n_words': 142}