Skip to content

Commit

Permalink
Code climate fix for tests/cces-removed.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mab879 committed Feb 14, 2024
1 parent 3bb2ffd commit 4951763
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/cces-removed.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ def _parse_args() -> argparse.Namespace:
return parser.parse_args()


def _process_rule(cces_in_use, products, rule_obj):
for identifier_key, identifier_value in rule_obj['identifiers'].items():
for product in products.split(","):
if identifier_key.endswith(product):
cces_in_use.add(identifier_value)


def _get_cces_in_use(data, products) -> Set[str]:
cces_in_use: Set[str] = set()
for rule_id, rule_obj in data.items():
for identifier_key, identifier_value in rule_obj['identifiers'].items():
for product in products.split(","):
if identifier_key.endswith(product):
cces_in_use.add(identifier_value)
_process_rule(cces_in_use, products, rule_obj)
return cces_in_use


Expand Down

0 comments on commit 4951763

Please sign in to comment.