AdminController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 0
cbo 3
dl 0
loc 23
ccs 11
cts 11
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A adminAction() 0 16 1
1
<?php
2
3
namespace AppBundle\Controller\Admin;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
8
9
/**
10
 * Class AdminController
11
 * @package AppBundle\Controller\Admin
12
 */
13
class AdminController extends Controller
14
{
15
    /**
16
     * @Route("/admin", name="admin")
17
     * @Template("@App/admin/admin.html.twig")
18
     */
19 1
    public function adminAction()
20
    {
21 1
        $em = $this->getDoctrine()->getManager();
22
23 1
        $countUsers = $em->getRepository('AppBundle:User')->findCountUsers();
24 1
        $countModules = $em->getRepository('AppBundle:Module')->findCountModules();
25 1
        $countCategories = $em->getRepository('AppBundle:Category')->findCountCategories();
26 1
        $countQuestions = $em->getRepository('AppBundle:Question')->findCountQuestions();
27
28
        return [
29 1
            'count_users' => $countUsers['count_u'],
30 1
            'count_modules' => $countModules['count_m'],
31 1
            'count_categories' => $countCategories['count_c'],
32 1
            'count_questions' => $countQuestions['count_q']
33 1
        ];
34
    }
35
}
36