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.
Completed
Push — master ( 8707d7...dfc86a )
by mike
03:43 queued 01:25
created

_MeasurePerformance   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A work() 0 3 1
A endWork() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
class _MeasurePerformance {
4
	/*
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
5
	$m = new _MeasurePerformance();
6
	//do sometime
7
	$m->work(1);
8
	$m->work(1);
9
	echo $m->totalAvgPerformance;
10
	*/
11
	public $startTime;
12
	public $counter = 0;
13
	public $avgPerformance = '';
14
	public $runTime = 0;
15
16
	public function __construct(){
17
		$this->startTime = microtime(true);
18
	}
19
20
	public function work($counterAddFloat = 1){
21
		$this->counter = $this->counter + (float)$counterAddFloat;
0 ignored issues
show
Documentation Bug introduced by
The property $counter was declared of type integer, but $this->counter + (double) $counterAddFloat is of type double. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
22
	}
23
	public function endWork(){
24
		$this->runTime = microtime(true) - $this->startTime;
0 ignored issues
show
Documentation Bug introduced by
The property $runTime was declared of type integer, but microtime(true) - $this->startTime is of type double. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
25
		$this->avgPerformance = number_format(($this->counter/$this->runTime), 2, '.', '');
26
	}
27
28
}
29