Code Duplication    Length = 5-5 lines in 4 locations

mod/gc_api/lib/profile.php 4 locations

@@ 492-496 (lines=5) @@
489
					return $response;
490
				}
491
				$locationData = json_decode(json_encode($value['en']), true);
492
				if (!isset($locationData['street'])&&!isset($locationData['city'])&&!isset($locationData['province'])&&!isset($locationData['postalCode'])&&!isset($locationData['country'])&&!isset($locationData['building'])&&!isset($locationData['floor'])&&!isset($locationData['officeNum'])) {
493
					$response['error'] = 4;
494
					$response['message'] = 'invalid location data';
495
					return $response;
496
				}
497
				if (!isset($locationData['street'])||!isset($locationData['city'])||!isset($locationData['province'])||!isset($locationData['postalCode'])||!isset($locationData['country'])||!isset($locationData['building'])||!isset($locationData['floor'])||!isset($locationData['officeNum'])) {
498
					$response['error'] = 4;
499
					$response['message'] = 'missing location data';
@@ 509-513 (lines=5) @@
506
					return $response;
507
				}
508
				$locationData = json_decode(json_encode($value['fr']), true);
509
				if (!isset($locationData['street'])&&!isset($locationData['city'])&&!isset($locationData['province'])&&!isset($locationData['postalCode'])&&!isset($locationData['country'])&&!isset($locationData['building'])&&!isset($locationData['floor'])&&!isset($locationData['officeNum'])) {
510
					$response['error'] = 4;
511
					$response['message'] = 'invalid location data';
512
					return $response;
513
				}
514
				if (!isset($locationData['street'])||!isset($locationData['city'])||!isset($locationData['province'])||!isset($locationData['postalCode'])||!isset($locationData['country'])||!isset($locationData['building'])||!isset($locationData['floor'])||!isset($locationData['officeNum'])) {
515
					$response['error'] = 4;
516
					$response['message'] = 'missing location data';
@@ 750-754 (lines=5) @@
747
					return $response;
748
				}
749
				$locationData = json_decode(json_encode($value['en']), true);
750
				if (!isset($locationData['street'])&&!isset($locationData['city'])&&!isset($locationData['province'])&&!isset($locationData['postalCode'])&&!isset($locationData['country'])&&!isset($locationData['building'])&&!isset($locationData['floor'])&&!isset($locationData['officeNum'])) {
751
					$response['error'] = 4;
752
					$response['message'] = 'invalid location data';
753
					return $response;
754
				}
755
				if (!isset($locationData['street'])||!isset($locationData['city'])||!isset($locationData['province'])||!isset($locationData['postalCode'])||!isset($locationData['country'])||!isset($locationData['building'])||!isset($locationData['floor'])||!isset($locationData['officeNum'])) {
756
					$response['error'] = 4;
757
					$response['message'] = 'missing location data';
@@ 767-771 (lines=5) @@
764
					return $response;
765
				}
766
				$locationData = json_decode(json_encode($value['fr']), true);
767
				if (!isset($locationData['street'])&&!isset($locationData['city'])&&!isset($locationData['province'])&&!isset($locationData['postalCode'])&&!isset($locationData['country'])&&!isset($locationData['building'])&&!isset($locationData['floor'])&&!isset($locationData['officeNum'])) {
768
					$response['error'] = 4;
769
					$response['message'] = 'invalid location data';
770
					return $response;
771
				}
772
				if (!isset($locationData['street'])||!isset($locationData['city'])||!isset($locationData['province'])||!isset($locationData['postalCode'])||!isset($locationData['country'])||!isset($locationData['building'])||!isset($locationData['floor'])||!isset($locationData['officeNum'])) {
773
					$response['error'] = 4;
774
					$response['message'] = 'missing location data';