@@ -300,6 +300,16 @@ def parse_depscan_report(self, depscan_report):
300
300
previous_line = line
301
301
line = current_line .strip ()
302
302
303
+ # ---- Dirty fix for unusually structured sections ----
304
+
305
+ if current_location != self .REACHABLE_FLOWS_DATA and last_seen_reachable_flows in [self .REACHABLE_FLOWS , None ]:
306
+ if line .startswith ("#" ) or self .string_matches_regex (line , r'<span class="r\d+">#\d+<\/span><span class="r\d+">.*<\/span>' ):
307
+ current_location = self .REACHABLE_FLOWS_DATA
308
+
309
+ if current_location != self .NON_REACHABLE_FLOWS_DATA and last_seen_reachable_flows == self .NON_REACHABLE_FLOWS :
310
+ if line .startswith ("#" ) or self .string_matches_regex (line , r'<span class="r\d+">#\d+<\/span><span class="r\d+">.*<\/span>' ):
311
+ current_location = self .NON_REACHABLE_FLOWS_DATA
312
+
303
313
# ---- Location identification: Secure Design Tips ----
304
314
305
315
if line == self .SECURE_DESIGN_TIPS or self .string_matches_span_pattern (
@@ -314,9 +324,10 @@ def parse_depscan_report(self, depscan_report):
314
324
# ---- Data population: Secure Design Tips ----
315
325
316
326
if current_location == self .SECURE_DESIGN_TIPS :
317
- if sections_tree [self .SECURE_DESIGN_TIPS ][self .SUMMARY ] != "" :
318
- sections_tree [self .SECURE_DESIGN_TIPS ][self .SUMMARY ] += "\n "
319
- sections_tree [self .SECURE_DESIGN_TIPS ][self .SUMMARY ] += line
327
+ if line not in sections_tree [self .SECURE_DESIGN_TIPS ][self .SUMMARY ]:
328
+ if sections_tree [self .SECURE_DESIGN_TIPS ][self .SUMMARY ] != "" :
329
+ sections_tree [self .SECURE_DESIGN_TIPS ][self .SUMMARY ] += "\n "
330
+ sections_tree [self .SECURE_DESIGN_TIPS ][self .SUMMARY ] += line
320
331
continue
321
332
322
333
# ---- Location identification: INFO ----
@@ -719,14 +730,6 @@ def parse_depscan_report(self, depscan_report):
719
730
last_seen_reachable_flows = self .REACHABLE_FLOWS
720
731
continue
721
732
722
- if current_location != self .REACHABLE_FLOWS_DATA and last_seen_reachable_flows in [self .REACHABLE_FLOWS , None ]:
723
- if line .startswith ("#" ) or self .string_matches_regex (line , r'<span class="r\d+">#\d+<\/span><span class="r\d+">.*<\/span>' ):
724
- current_location = self .REACHABLE_FLOWS_DATA
725
-
726
- if current_location != self .NON_REACHABLE_FLOWS_DATA and last_seen_reachable_flows == self .NON_REACHABLE_FLOWS :
727
- if line .startswith ("#" ) or self .string_matches_regex (line , r'<span class="r\d+">#\d+<\/span><span class="r\d+">.*<\/span>' ):
728
- current_location = self .NON_REACHABLE_FLOWS_DATA
729
-
730
733
# ---- Data population: Reachable Flows ----
731
734
732
735
if current_location == self .REACHABLE_FLOWS_RECOMMENDATION :
0 commit comments