Reports   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 16
c 1
b 1
f 0
dl 0
loc 34
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A data_report() 0 11 2
A __construct() 0 3 1
A data_report_002() 0 11 2
1
<?php
2
3
class Reports
4
{
5
    private $db;
6
7
    public function __construct($database)
8
    {
9
        $this->db = $database;
10
    }
11
12
    public function data_report($idreport)
0 ignored issues
show
Unused Code introduced by
The parameter $idreport is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

12
    public function data_report(/** @scrutinizer ignore-unused */ $idreport)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
    {
14
        $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `slaid`= ?');
15
        $query->bindValue(1, $slaid);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $slaid seems to be never defined.
Loading history...
16
17
        try {
18
            $query->execute();
19
20
            return $query->fetch();
21
        } catch (PDOException $e) {
22
            die($e->getMessage());
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
23
        }
24
    }
25
26
    public function data_report_002()
27
    {
28
        $query = $this->db->prepare('SELECT * FROM `sla` ORDER BY `slaid` ASC');
29
30
        try {
31
            $query->execute();
32
        } catch (PDOException $e) {
33
            die($e->getMessage());
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
34
        }
35
36
        return $query->fetchAll();
37
    }
38
}
39