From 2e933d8ab223a60c6356d1c0cab06c4392a06818 Mon Sep 17 00:00:00 2001 From: Stefano Braghin <527806+stefano81@users.noreply.github.com> Date: Sat, 16 May 2026 22:14:56 +0100 Subject: [PATCH] Apply suggested fix to src/risk_assessment/classification/unstructured/aggregator.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- .../classification/unstructured/aggregator.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/risk_assessment/classification/unstructured/aggregator.py b/src/risk_assessment/classification/unstructured/aggregator.py index b7599be..f4f1b9d 100644 --- a/src/risk_assessment/classification/unstructured/aggregator.py +++ b/src/risk_assessment/classification/unstructured/aggregator.py @@ -342,24 +342,24 @@ def validate_entity(self, entity: Entity, text: str) -> bool: return False if self.configuration.identifiers_list and frozenset(["DRL"]) == entity.source: - indentifier = None + identifier = None - for current_indentifier in self.configuration.identifiers_list: - if entity.entity_type == current_indentifier.__str__(): - indentifier = current_indentifier + for current_identifier in self.configuration.identifiers_list: + if entity.entity_type == current_identifier.__str__(): + identifier = current_identifier break - if not indentifier: + if not identifier: return True span_to_validate = [entity.start, entity.end] - if indentifier.is_need_span(): - span_to_validate = [max(0, entity.start - indentifier.get_span_length_required_to_check()), entity.end] # type: ignore + if identifier.is_need_span(): + span_to_validate = [max(0, entity.start - identifier.get_span_length_required_to_check()), entity.end] # type: ignore for i in range(span_to_validate[0], entity.start): - if indentifier.is_of_this_type(text[i : span_to_validate[1]]): + if identifier.is_of_this_type(text[i : span_to_validate[1]]): return True - elif indentifier.is_of_this_type(text[span_to_validate[0] : span_to_validate[1]]): + elif identifier.is_of_this_type(text[span_to_validate[0] : span_to_validate[1]]): return True else: return False