<commit_before><?php

namespace AppBundle\Controller\Admin;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class DashboardController extends Controller
{
    /**
     * @Route("/administrador/", name="admin_dashboard")
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function indexAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        $suppliers = $em->getRepository('AppBundle:Supplier')->findBy(['deleted' => false]);
        $activeRetailers = $em->getRepository('AppBundle:ActiveRetailer')->findAll();
        $qtyRetailer = ($activeRetailers == null ? 0 : end($activeRetailers)->getQuantity());
        $activeQuotes = count($em->getRepository('AppBundle:Quote')->findBy(['closed' => 0]));

        $topSuppliers = $em->getRepository('AppBundle:Supplier')->findTopSuppliers();

        return $this->render('Admin/dashboard/index.html.twig', [
            'qtySuppliers' => count($suppliers),
            'qtyRetailer' => $qtyRetailer,
            'qtyQuotes' => $activeQuotes,
            'topSuppliers' => $topSuppliers,
        ]);
    }

    /**
     * @Route("/administrador/cotacoes/remotas/data", name="admin_dashboard_remotes_quotes_data")
     */
    public function remotesQuotesDataAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        $quotes = $em->getRepository('AppBundle:Quote')->countRemote();
<commit_msg>- Web: fix count retailers<commit_after><?php

namespace AppBundle\Controller\Admin;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class DashboardController extends Controller
{
    /**
     * @Route("/administrador/", name="admin_dashboard")
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function indexAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        $suppliers = $em->getRepository('AppBundle:Supplier')->findBy(['deleted' => false]);
        $activeRetailers = $em->getRepository('AppBundle:ActiveRetailer')->findAll();
        $retailers = $em->getRepository('AppBundle:Retailer')->findBy(['verified' => true, 'deleted' => false]);
        $qtyRetailer = count($retailers);
        $activeQuotes = count($em->getRepository('AppBundle:Quote')->findBy(['closed' => 0]));

        $topSuppliers = $em->getRepository('AppBundle:Supplier')->findTopSuppliers();

        return $this->render('Admin/dashboard/index.html.twig', [
            'qtySuppliers' => count($suppliers),
            'qtyRetailer' => $qtyRetailer,
            'qtyQuotes' => $activeQuotes,
            'topSuppliers' => $topSuppliers,
        ]);
    }

    /**
     * @Route("/administrador/cotacoes/remotas/data", name="admin_dashboard_remotes_quotes_data")
     */
    public function remotesQuotesDataAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        $quotes = $em->getRepository('AppBundle:Quote')->countRemote();

{'fraction_non_alphanumeric': 0.15892193308550187, 'fraction_numerical': 0.0009293680297397769, 'mean_word_length': 3.755522827687776, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 50, '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': '3222920', 'n_tokens_mistral': 952, 'n_tokens_neox': 948, 'n_words': 128}