Code Duplication    Length = 9-9 lines in 4 locations

mod/gc_mobile_api/models/group.php 1 location

@@ 503-511 (lines=9) @@
500
501
			$other = get_entity($event->object_guid);
502
			$parent = get_entity($other->container_guid);
503
			if ($parent instanceof ElggGroup) {
504
				if (!isset($event->object['name'])) {
505
					$event->object['name'] = ($parent->title) ? $parent->title : $parent->name;
506
				}
507
			} else {
508
				if (!isset($event->object['name'])) {
509
					$event->object['name'] = ($parent->title) ? $parent->title : $parent->name;
510
				}
511
			}
512
		} else {
513
			//@TODO handle any unknown events
514
			if (strpos($object->title, '"en":') !== false) {

mod/gc_mobile_api/models/test.php 1 location

@@ 202-210 (lines=9) @@
199
			$event->object['description'] = gc_explode_translation($object->description, $lang);
200
201
			$other = get_entity($object->container_guid);
202
			if ($other instanceof ElggGroup) {
203
				if (!isset($event->object['type'])) {
204
					$event->object['name'] = ($other->title) ? $other->title : $other->name;
205
				}
206
			} else {
207
				if (!isset($event->object['type'])) {
208
					$event->object['name'] = ($other->title) ? $other->title : $other->name;
209
				}
210
			}
211
212
			if (strpos($event->object['name'], '"en":') !== false) {
213
				$event->object['name'] = gc_explode_translation($event->object['name'], $lang);

mod/gc_mobile_api/models/user.php 2 locations

@@ 621-629 (lines=9) @@
618
619
			$other = get_entity($event->object_guid);
620
			$parent = get_entity($other->container_guid);
621
			if ($parent instanceof ElggGroup) {
622
				if (!isset($event->object['name'])) {
623
					$event->object['name'] = ($parent->title) ? $parent->title : $parent->name;
624
				}
625
			} else {
626
				if (!isset($event->object['name'])) {
627
					$event->object['name'] = ($parent->title) ? $parent->title : $parent->name;
628
				}
629
			}
630
		} else {
631
			//@TODO handle any unknown events
632
			if (strpos($object->title, '"en":') !== false) {
@@ 866-874 (lines=9) @@
863
			$event->object['description'] = gc_explode_translation($object->description, $lang);
864
865
			$other = get_entity($object->container_guid);
866
			if ($other instanceof ElggGroup) {
867
				if (!isset($event->object['type'])) {
868
					$event->object['name'] = ($other->title) ? $other->title : $other->name;
869
				}
870
			} else {
871
				if (!isset($event->object['type'])) {
872
					$event->object['name'] = ($other->title) ? $other->title : $other->name;
873
				}
874
			}
875
876
			if (strpos($event->object['name'], '"en":') !== false) {
877
				$event->object['name'] = gc_explode_translation($event->object['name'], $lang);