Comm   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 34
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getGravatar() 0 10 1
1
<?php
2
namespace Anax\Comments;
3
4
use \Anax\Database\ActiveRecordModel;
5
6
/**
7
 * A database driven model.
8
 */
9
class Comm extends ActiveRecordModel
10
{
11
    /**
12
     * @var string $tableName name of the database table.
13
     */
14
    protected $tableName = "Comm";
15
16
17
    /**
18
     * Columns in the table.
19
     *
20
     * @var integer $id primary key auto incremented.
21
     */
22
    public $id;
23
    public $userid;
24
    public $email;
25
    public $title;
26
    public $comment;
27
    public $parentid;
28
    public $created;
29
    public $updated;
30
31
32 2
    public function getGravatar($email)
33
    {
34 2
        $size = 20;
35 2
        $dim = 'mm';
36 2
        $rad = 'g';
37 2
        $url = 'https://www.gravatar.com/avatar/';
38 2
        $url .= md5(strtolower(trim($email)));
39 2
        $url .= "?s=$size&d=$dim&r=$rad";
40 2
        return $url;
41
    }
42
}
43