GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Sqlite   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 29.63 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 8
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A concatenateEscapedFields() 0 4 1
A fetchSetting() 8 8 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: wechsler
5
 * Date: 04/10/15
6
 * Time: 21:09
7
 */
8
9
namespace Phase\TakeATicket\DataSource;
10
11
class Sqlite extends AbstractSql
12
{
13
    /**
14
     * @param array $fields
15
     *
16
     * @return string
17
     */
18
    protected function concatenateEscapedFields($fields)
19
    {
20
        return implode('||', $fields);
21
    }
22
23
    /**
24
     * Get current value of a named setting, NULL if missing
25
     *
26
     * @param  $key
27
     * @return mixed|null
28
     */
29 View Code Duplication
    public function fetchSetting($key)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
    {
31
        $conn = $this->getDbConn();
32
        $row = $conn->fetchAssoc('SELECT settingValue FROM settings WHERE settingKey=:key', ['key' => $key]);
33
34
        return $row ? $row['settingValue'] : null;
35
        // rowCount seems to not work on sqlite: http://php.net/manual/en/pdostatement.rowcount.php
36
    }
37
}
38