PluralRule16::getPlural()   F
last analyzed

Complexity

Conditions 23
Paths 6144

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 23

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 2
cc 23
eloc 2
nc 6144
nop 1
crap 23

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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
class PluralRule16 implements IPlural {
8 718
	final public function getPlural($n = 1) {
9 718
		return $n % 10 == 1 && $n % 100 != 11 && $n % 100 != 71 && $n % 100 != 91 ? 0 : ($n % 10 == 2 && $n % 100 != 12 && $n % 100 != 72 && $n % 100 != 92 ? 1 : (($n % 10 == 3 || $n % 10 == 4 || $n % 10 == 9) && $n % 100 != 13 && $n % 100 != 14 && $n % 100 != 19 && $n % 100 != 73 && $n % 100 != 74 && $n % 100 != 79 && $n % 100 != 93 && $n % 100 != 94 && $n % 100 != 99 ? 2 : ($n % 1000000 == 0 && $n != 0 ? 3 : 4)));
10
	}
11
12 361
	final public function getPluralForm() {
13 361
		return 'nplurals=5; plural=n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?0:(n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?1:((n%10==3||n%10==4||n%10==9)&&n%100!=13&&n%100!=14&&n%100!=19&&n%100!=73&&n%100!=74&&n%100!=79&&n%100!=93&&n%100!=94&&n%100!=99?2:(n%1000000==0&&n!=0?3:4)));';
14
	}
15
16 2
	final public function getPluralsCount() {
17 2
		return 5;
18
	}
19
}
20