Code Duplication    Length = 7-8 lines in 2 locations

engine/classes/ElggMenuBuilder.php 2 locations

@@ 134-141 (lines=8) @@
131
				continue;
132
			}
133
						
134
			if (empty($parents)) {
135
				// menu items without parents? That is sad.. report to the log
136
				$message = _elgg_services()->translator->translate('ElggMenuBuilder:Trees:NoParents');
137
				_elgg_services()->logger->notice($message);
138
				
139
				// skip section as without parents menu can not be drawn
140
				continue;
141
			}
142
						
143
			foreach ($children as $menu_item_name => $menu_item) {
144
				$parent_name = $menu_item->getParentName();
@@ 157-163 (lines=7) @@
154
				if (!in_array($menu_item, $all_menu_items[$parent_name]->getData('children'))) {
155
					$all_menu_items[$parent_name]->addChild($menu_item);
156
					$menu_item->setParent($all_menu_items[$parent_name]);
157
				} else {
158
					// menu item already existed in parents children, report the duplicate registration
159
					$message = _elgg_services()->translator->translate('ElggMenuBuilder:Trees:DuplicateChild', array($menu_item_name));
160
					_elgg_services()->logger->notice($message);
161
					
162
					continue;
163
				}
164
			}
165
166
			// convert keys to indexes for first level of tree