Method: pylint.checkers.base_checker.BaseChecker.check_consistency
Calls: 47529, Exceptions: 2, Paths: 4Back
Path 1: 44115 calls (0.93)
1def check_consistency(self) -> None:
2 """Check the consistency of msgid.
3
4 msg ids for a checker should be a string of len 4, where the two first
5 characters are the checker id and the two last the msg id in this
6 checker.
7
8 :raises InvalidMessageError: If the checker id in the messages are not
9 always the same.
10 """
11 checker_id = None
12 existing_ids = []
13 for message in self.messages:
14 # Id's for shared messages such as the 'deprecated-*' messages
15 # can be inconsistent with their checker id.
16 if message.shared:
17 continue
18 if checker_id is not None and checker_id != message.msgid[1:3]:
19 error_msg = "Inconsistent checker part in message id "
20 error_msg += f"'{message.msgid}' (expected 'x{checker_id}xx' "
21 error_msg += f"because we already had {existing_ids})."
22 raise InvalidMessageError(error_msg)
23 checker_id = message.msgid[1:3]
24 existing_ids.append(message.msgid)
Path 2: 2274 calls (0.05)
1def check_consistency(self) -> None:
2 """Check the consistency of msgid.
3
4 msg ids for a checker should be a string of len 4, where the two first
5 characters are the checker id and the two last the msg id in this
6 checker.
7
8 :raises InvalidMessageError: If the checker id in the messages are not
9 always the same.
10 """
11 checker_id = None
12 existing_ids = []
13 for message in self.messages:
14 # Id's for shared messages such as the 'deprecated-*' messages
15 # can be inconsistent with their checker id.
16 if message.shared:
17 continue
18 if checker_id is not None and checker_id != message.msgid[1:3]:
19 error_msg = "Inconsistent checker part in message id "
20 error_msg += f"'{message.msgid}' (expected 'x{checker_id}xx' "
21 error_msg += f"because we already had {existing_ids})."
22 raise InvalidMessageError(error_msg)
23 checker_id = message.msgid[1:3]
24 existing_ids.append(message.msgid)
Path 3: 1139 calls (0.02)
InvalidMessageError (1)
1def check_consistency(self) -> None:
2 """Check the consistency of msgid.
3
4 msg ids for a checker should be a string of len 4, where the two first
5 characters are the checker id and the two last the msg id in this
6 checker.
7
8 :raises InvalidMessageError: If the checker id in the messages are not
9 always the same.
10 """
11 checker_id = None
12 existing_ids = []
13 for message in self.messages:
14 # Id's for shared messages such as the 'deprecated-*' messages
15 # can be inconsistent with their checker id.
16 if message.shared:
17 continue
18 if checker_id is not None and checker_id != message.msgid[1:3]:
19 error_msg = "Inconsistent checker part in message id "
20 error_msg += f"'{message.msgid}' (expected 'x{checker_id}xx' "
21 error_msg += f"because we already had {existing_ids})."
22 raise InvalidMessageError(error_msg)
23 checker_id = message.msgid[1:3]
24 existing_ids.append(message.msgid)
Path 4: 1 calls (0.0)
InvalidMessageError (1)
1def check_consistency(self) -> None:
2 """Check the consistency of msgid.
3
4 msg ids for a checker should be a string of len 4, where the two first
5 characters are the checker id and the two last the msg id in this
6 checker.
7
8 :raises InvalidMessageError: If the checker id in the messages are not
9 always the same.
10 """
11 checker_id = None
12 existing_ids = []
13 for message in self.messages:
14 # Id's for shared messages such as the 'deprecated-*' messages
15 # can be inconsistent with their checker id.
16 if message.shared:
17 continue
18 if checker_id is not None and checker_id != message.msgid[1:3]:
19 error_msg = "Inconsistent checker part in message id "
20 error_msg += f"'{message.msgid}' (expected 'x{checker_id}xx' "
21 error_msg += f"because we already had {existing_ids})."
22 raise InvalidMessageError(error_msg)
23 checker_id = message.msgid[1:3]
24 existing_ids.append(message.msgid)