Code Duplication    Length = 18-20 lines in 2 locations

src/apex/plugins/apexparadigm/__init__.py 2 locations

@@ 206-225 (lines=20) @@
203
                        selected_hop['index'] = hop_index
204
                        selected_hop['hop'] = hop
205
                        selected_hop['node'] = node
206
                        selected_hop['ssid'] = ssid
207
                        selected_hop['port_name'] = port_name
208
                        selected_hop['port'] = port
209
                        selected_hop['band_path'] = band_path
210
                        selected_hop['band_path_net'] = band_path_net
211
                elif not band_path_net and port['net'].startswith(band_path):
212
                    # only when a ssid is present should it be treated preemptively if it is a band path
213
                    if not selected_hop:
214
                        selected_hop['index'] = hop_index
215
                        selected_hop['hop'] = hop
216
                        selected_hop['node'] = node
217
                        selected_hop['ssid'] = ssid
218
                        selected_hop['port_name'] = port_name
219
                        selected_hop['port'] = port
220
                        selected_hop['band_path'] = band_path
221
                        selected_hop['band_path_net'] = band_path_net
222
                    elif ssid > selected_hop['ssid']:
223
                        selected_hop['index'] = hop_index
224
                        selected_hop['hop'] = hop
225
                        selected_hop['node'] = node
226
                        selected_hop['ssid'] = ssid
227
                        selected_hop['port_name'] = port_name
228
                        selected_hop['port'] = port
@@ 188-205 (lines=18) @@
185
186
            if not band_path:
187
                continue
188
189
            for port_name in self.port_map.keys():
190
                port = self.port_map[port_name]
191
                if band_path_net and node == port['net']:
192
                    # only when a ssid is present should it be treated preemptively if it is a band path
193
                    if not selected_hop:
194
                        selected_hop['index'] = hop_index
195
                        selected_hop['hop'] = hop
196
                        selected_hop['node'] = node
197
                        selected_hop['ssid'] = ssid
198
                        selected_hop['port_name'] = port_name
199
                        selected_hop['port'] = port
200
                        selected_hop['band_path'] = band_path
201
                        selected_hop['band_path_net'] = band_path_net
202
                    elif ssid > selected_hop['ssid']:
203
                        selected_hop['index'] = hop_index
204
                        selected_hop['hop'] = hop
205
                        selected_hop['node'] = node
206
                        selected_hop['ssid'] = ssid
207
                        selected_hop['port_name'] = port_name
208
                        selected_hop['port'] = port