Method: pylint.utils.file_state.FileState._set_message_state_on_line
Calls: 249360, Exceptions: 3383, Paths: 4Back
Path 1: 236152 calls (0.95)
MessageDefinition (236152)
3 (3094) 4 (3085) 5 (3066) 2 (3062) 6 (3021) 1 (2957) 7 (2956) 8 (2896) 9 (2881) 10 (2802)
False (236152)
1 (85813) 2 (54384) 3 (40865) 4 (21549) 5 (10786) 6 (6792) 7 (4646) 8 (2580) 9 (2456) 10 (1756)
1def _set_message_state_on_line(
2 self,
3 msg: MessageDefinition,
4 line: int,
5 state: bool,
6 original_lineno: int,
7 ) -> None:
8 """Set the state of a message on a line."""
9 # Update suppression mapping
10 if not state:
11 self._suppression_mapping[(msg.msgid, line)] = original_lineno
12 else:
13 self._suppression_mapping.pop((msg.msgid, line), None)
14
15 # Update message state for respective line
16 try:
17 self._module_msgs_state[msg.msgid][line] = state
18 except KeyError:
19 self._module_msgs_state[msg.msgid] = {line: state}
Path 2: 9825 calls (0.04)
MessageDefinition (9825)
3 (129) 2 (127) 4 (127) 1 (124) 11 (114) 10 (113) 5 (113) 12 (112) 8 (112) 9 (112)
True (9825)
1 (5008) 151 (600) 152 (453) 85 (336) 164 (326) 149 (296) 289 (288) 260 (259) 72 (213) 188 (187)
1def _set_message_state_on_line(
2 self,
3 msg: MessageDefinition,
4 line: int,
5 state: bool,
6 original_lineno: int,
7 ) -> None:
8 """Set the state of a message on a line."""
9 # Update suppression mapping
10 if not state:
11 self._suppression_mapping[(msg.msgid, line)] = original_lineno
12 else:
13 self._suppression_mapping.pop((msg.msgid, line), None)
14
15 # Update message state for respective line
16 try:
17 self._module_msgs_state[msg.msgid][line] = state
18 except KeyError:
19 self._module_msgs_state[msg.msgid] = {line: state}
Path 3: 3302 calls (0.01)
MessageDefinition (3302)
0 (2955) 1 (105) 2 (46) 3 (27) 4 (23) 6 (17) 5 (15) 7 (6) 9 (5) 8 (4)
False (3302)
1 (1428) 2 (767) 3 (472) 4 (226) 5 (97) 6 (83) 7 (61) 9 (25) 10 (22) 8 (18)
KeyError (3302)
1def _set_message_state_on_line(
2 self,
3 msg: MessageDefinition,
4 line: int,
5 state: bool,
6 original_lineno: int,
7 ) -> None:
8 """Set the state of a message on a line."""
9 # Update suppression mapping
10 if not state:
11 self._suppression_mapping[(msg.msgid, line)] = original_lineno
12 else:
13 self._suppression_mapping.pop((msg.msgid, line), None)
14
15 # Update message state for respective line
16 try:
17 self._module_msgs_state[msg.msgid][line] = state
18 except KeyError:
19 self._module_msgs_state[msg.msgid] = {line: state}
Path 4: 81 calls (0.0)
MessageDefinition (81)
0 (71) 4 (4) 2 (2) 25 (1) 5 (1) 78 (1) 107 (1)
True (81)
5 (14) 17 (7) 151 (4) 6 (4) 85 (4) 72 (3) 27 (3) 152 (3) 2 (3) 1 (2)
KeyError (81)
1def _set_message_state_on_line(
2 self,
3 msg: MessageDefinition,
4 line: int,
5 state: bool,
6 original_lineno: int,
7 ) -> None:
8 """Set the state of a message on a line."""
9 # Update suppression mapping
10 if not state:
11 self._suppression_mapping[(msg.msgid, line)] = original_lineno
12 else:
13 self._suppression_mapping.pop((msg.msgid, line), None)
14
15 # Update message state for respective line
16 try:
17 self._module_msgs_state[msg.msgid][line] = state
18 except KeyError:
19 self._module_msgs_state[msg.msgid] = {line: state}