| Conditions | 4 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 70 | 2 | public function getPercent() |
|
| 71 | { |
||
| 72 | 2 | if (empty($this->percent) && ($frequencies = $this->getFrequency())) { |
|
| 73 | 2 | $ratio = max($frequencies) / 100; |
|
| 74 | 2 | foreach ($frequencies as $word => $frequency) { |
|
| 75 | 2 | $this->percent[$word] = $frequency / $ratio; |
|
| 76 | } |
||
| 77 | } |
||
| 78 | |||
| 79 | 2 | return $this->percent; |
|
| 80 | } |
||
| 82 |