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.

Temperature   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 5
Bugs 0 Features 1
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 29
rs 10
c 5
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A average() 0 9 2
1
<?php
2
3
namespace Acme;
4
5
/**
6
 * Temperature 
7
 * 
8
 * @author isidromerayo <[email protected]>
9
 */
10
class Temperature
11
{
12
13
    private $_service;
14
15
    /**
16
     * Constructor 
17
     * @param type $service
18
     */
19
    public function __construct($service)
20
    {
21
        $this->_service = $service;
22
    }
23
24
    /**
25
     * Calculate temperature's average
26
     * @return integer
27
     */
28
    public function average()
29
    {
30
        $total = 0;
31
        for ($i = 0; $i < 3; $i++) {
32
            $total += $this->_service->readTemp();
33
        }
34
35
        return $total / 3;
36
    }
37
38
}
39
40