Code Duplication    Length = 16-16 lines in 2 locations

app/Stats.php 2 locations

@@ 1658-1673 (lines=16) @@
1655
				}
1656
			}
1657
			break;
1658
		case 'birth_distribution_chart':
1659
			$chart_title = I18N::translate('Birth by country');
1660
			// Count how many people were born in each country
1661
			$surn_countries = [];
1662
			$b_countries    = $this->statsPlaces('INDI', 'BIRT', 0, true);
1663
			foreach ($b_countries as $place => $count) {
1664
				$country = $place;
1665
				if (array_key_exists($country, $country_to_iso3166)) {
1666
					if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1667
						$surn_countries[$country_to_iso3166[$country]] = $count;
1668
					} else {
1669
						$surn_countries[$country_to_iso3166[$country]] += $count;
1670
					}
1671
				}
1672
			}
1673
			break;
1674
		case 'death_distribution_chart':
1675
			$chart_title = I18N::translate('Death by country');
1676
			// Count how many people were death in each country
@@ 1674-1689 (lines=16) @@
1671
				}
1672
			}
1673
			break;
1674
		case 'death_distribution_chart':
1675
			$chart_title = I18N::translate('Death by country');
1676
			// Count how many people were death in each country
1677
			$surn_countries = [];
1678
			$d_countries    = $this->statsPlaces('INDI', 'DEAT', 0, true);
1679
			foreach ($d_countries as $place => $count) {
1680
				$country = $place;
1681
				if (array_key_exists($country, $country_to_iso3166)) {
1682
					if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1683
						$surn_countries[$country_to_iso3166[$country]] = $count;
1684
					} else {
1685
						$surn_countries[$country_to_iso3166[$country]] += $count;
1686
					}
1687
				}
1688
			}
1689
			break;
1690
		case 'marriage_distribution_chart':
1691
			$chart_title = I18N::translate('Marriage by country');
1692
			// Count how many families got marriage in each country