diff --git a/decoimpact/data/parsers/parser_classification_rule.py b/decoimpact/data/parsers/parser_classification_rule.py index 3ebf65ca..cebd8e65 100644 --- a/decoimpact/data/parsers/parser_classification_rule.py +++ b/decoimpact/data/parsers/parser_classification_rule.py @@ -133,13 +133,14 @@ def divide_table_in_unique_chunks(criteria_table, conditions={}, unique=True): divide_table_in_unique_chunks(new_crit_table, {}, unique) del new_crit_table[key] - if len(msgs) < 2: + max_msg = 6 + if len(msgs) < max_msg: logger.log_warning("\n".join(msgs)) else: - logger.log_warning("\n".join(msgs[:10])) + logger.log_warning("\n".join(msgs[:max_msg])) logger.log_warning( f"{len(msgs)} warnings found concerning coverage of the " - "parameters. Only first 10 warnings are shown. See " + f"parameters. Only first {max_msg} warnings are shown. See " "classification_warnings.log file for all warnings." ) f = open("classification_warnings.log", "w") diff --git a/tests/data/parsers/test_parser_classification_rule.py b/tests/data/parsers/test_parser_classification_rule.py index ed6d8c44..098487c2 100644 --- a/tests/data/parsers/test_parser_classification_rule.py +++ b/tests/data/parsers/test_parser_classification_rule.py @@ -268,6 +268,6 @@ def test_feedback_for_criteria_multiple_parameters_more_10_warnings(): data.parse_dict(contents, logger) logger.log_warning.assert_called_with( - "11 warnings found concerning coverage of the parameters. Only first 10 " + "11 warnings found concerning coverage of the parameters. Only first 6 " "warnings are shown. See classification_warnings.log file for all warnings." )