<commit_before><?php

/*
 * This file is part of the AndroIRC website.
 *
 * (c) 2010-2011 <NAME> <<EMAIL>>
 * (c) 2010-2011 <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Madalynn\AndroBundle\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;

use Madalynn\AndroBundle\Entity\CrashReport;

/**
 * CrashReport Controller
 *
 * @author <NAME> <<EMAIL>>
 */
class CrashReportController extends AbstractController
{
    public function addAction(Request $request)
    {
        $phoneModel = $request->query->get('phone_model');
        $androidVersion = $request->query->get('android_version');
        $threadName = $request->query->get('thread_name');
        $errorMessage = $request->query->get('error_message');
        $callstack = $request->query->get('callstack');
        $androircVersion = $request->query->get('version', 'Unknown');

        if (!$callstack || !$phoneModel || !$androidVersion) {
            return new Response('Missing arguments.');
        }

        // We check if the crash report is coming from a testing mobilephone
        if (preg_match('#sdk#', $phoneModel)) {
            return new Response('Coming from a SDK Android phone.');
        }

        $crashReport = new CrashReport();

        $crashReport->setPhoneModel($phoneModel);
        $crashReport->setAndroidVersion($androidVersion);
        $crashReport->setThreadName($threadName);
        $crashReport->setErrorMessage($errorMessage);
        $crashReport->setCallstack($callstack);
        $crashReport->setAndroircVersion($androircVersion);

        $em = $this->getDoctrine()->getEntityManager();
        $repo = $em->getRepository('AndroBundle:CrashReport');

        $tmp = $repo->alreadyExist($crashReport);

        if (false !== $tmp) {
            $tmp->incCount();<commit_msg>fixed previous commit...<commit_after><?php

/*
 * This file is part of the AndroIRC website.
 *
 * (c) 2010-2011 <NAME> <<EMAIL>>
 * (c) 2010-2011 <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Madalynn\AndroBundle\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;

use Madalynn\AndroBundle\Entity\CrashReport;

/**
 * CrashReport Controller
 *
 * @author <NAME> <<EMAIL>>
 */
class CrashReportController extends AbstractController
{
    public function addAction(Request $request)
    {
        $phoneModel = $request->request->get('phone_model');
        $androidVersion = $request->request->get('android_version');
        $threadName = $request->request->get('thread_name');
        $errorMessage = $request->request->get('error_message');
        $callstack = $request->request->get('callstack');
        $androircVersion = $request->request->get('version', 'Unknown');

        if (!$callstack || !$phoneModel || !$androidVersion) {
            return new Response('Missing arguments.');
        }

        // We check if the crash report is coming from a testing mobilephone
        if (preg_match('#sdk#', $phoneModel)) {
            return new Response('Coming from a SDK Android phone.');
        }

        $crashReport = new CrashReport();

        $crashReport->setPhoneModel($phoneModel);
        $crashReport->setAndroidVersion($androidVersion);
        $crashReport->setThreadName($threadName);
        $crashReport->setErrorMessage($errorMessage);
        $crashReport->setCallstack($callstack);
        $crashReport->setAndroircVersion($androircVersion);

        $em = $this->getDoctrine()->getEntityManager();
        $repo = $em->getRepository('AndroBundle:CrashReport');

        $tmp = $repo->alreadyExist($crashReport);

        if (false !== $tmp) {
            $tmp->incCount();
{'fraction_non_alphanumeric': 0.14278442351743445, 'fraction_numerical': 0.00814456604734029, 'mean_word_length': 3.3959731543624163, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 67, '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': '2013267', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1093, 'n_words': 241}