CountLogEntries   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 3
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getKpi() 0 6 1
A getFormat() 0 4 1
1
<?php
2
/**
3
 * Count log entries
4
 *
5
 * @package CacheCheck\Service\Analyzer
6
 * @author  Tim Lochmüller
7
 */
8
9
namespace HDNET\CacheCheck\Service\Analyzer;
10
11
use HDNET\CacheCheck\Domain\Model\Cache;
12
13
/**
14
 * Count log entries
15
 *
16
 * @author Tim Lochmüller
17
 */
18
class CountLogEntries extends AbstractAnalyzer
19
{
20
21
    /**
22
     * Get the given KPI
23
     *
24
     * @param Cache $cache
25
     *
26
     * @return mixed
27
     * @throws \HDNET\CacheCheck\Exception
28
     */
29
    public function getKpi(Cache $cache)
30
    {
31
        $databaseConnection = $this->getDatabaseConnection();
32
        $where = 'cache_name = "' . $cache->getName() . '"';
33
        return (int)$databaseConnection->exec_SELECTcountRows('*', 'tx_cachecheck_domain_model_log', $where);
34
    }
35
36
    /**
37
     * Format the given KPI
38
     *
39
     * @param mixed $kpi
40
     *
41
     * @return string
42
     */
43
    public function getFormat($kpi)
44
    {
45
        return $kpi;
46
    }
47
}
48