PluralRule9::getPlural()   B
last analyzed

Complexity

Conditions 6
Paths 20

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 3
loc 3
ccs 2
cts 2
cp 1
rs 8.8571
cc 6
eloc 2
nc 20
nop 1
crap 6
1
<?php
2
namespace l10n\Plural;
3
4
/**
5
 * @link https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals#List_of_Plural_Rules
6
 */
7 View Code Duplication
class PluralRule9 implements IPlural {
0 ignored issues
show
Duplication introduced by
This class 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...
8 576
	final public function getPlural($n = 1) {
9 576
		return $n == 1 ? 0 : ($n % 10 >= 2 && $n % 10 <= 4 && ($n % 100 < 10 || $n % 100 >= 20) ? 1 : 2);
10
	}
11
12 290
	final public function getPluralForm() {
13 290
		return 'nplurals=3; plural=n==1?0:(n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2);';
14
	}
15
16 2
	final public function getPluralsCount() {
17 2
		return 3;
18
	}
19
}
20