Method: pylint.utils.file_state.FileState.set_msg_status
Calls: 3564, Exceptions: 3384, Paths: 4Back
Path 1: 3373 calls (0.95)
MessageDefinition (3373)
1 (1431) 2 (770) 3 (472) 4 (226) 5 (111) 6 (87) 7 (62) 9 (25) 10 (24) 8 (18)
False (3366) True (7)
'module' (3373)
KeyError (3373)
1def set_msg_status(
2 self,
3 msg: MessageDefinition,
4 line: int,
5 status: bool,
6 scope: str = "package",
7 ) -> None:
8 """Set status (enabled/disable) for a given message at a given line."""
9 assert line > 0
10 assert self._module
11 # TODO: 3.0: Remove unnecessary assertion
12 assert self._msgs_store
13
14 if scope != "line":
15 # Expand the status to cover all relevant block lines
16 self._set_state_on_block_lines(
17 self._msgs_store, self._module, msg, {line: status}
18 )
19 else:
20 self._set_message_state_on_line(msg, line, status, line)
21
22 # Store the raw value
23 try:
24 self._raw_module_msgs_state[msg.msgid][line] = status
25 except KeyError:
26 self._raw_module_msgs_state[msg.msgid] = {line: status}
Path 2: 175 calls (0.05)
MessageDefinition (175)
1 (52) 8 (6) 10 (5) 18 (5) 20 (5) 14 (4) 16 (4) 7 (4) 6 (3) 12 (3)
False (98) True (77)
'module' (175)
1def set_msg_status(
2 self,
3 msg: MessageDefinition,
4 line: int,
5 status: bool,
6 scope: str = "package",
7 ) -> None:
8 """Set status (enabled/disable) for a given message at a given line."""
9 assert line > 0
10 assert self._module
11 # TODO: 3.0: Remove unnecessary assertion
12 assert self._msgs_store
13
14 if scope != "line":
15 # Expand the status to cover all relevant block lines
16 self._set_state_on_block_lines(
17 self._msgs_store, self._module, msg, {line: status}
18 )
19 else:
20 self._set_message_state_on_line(msg, line, status, line)
21
22 # Store the raw value
23 try:
24 self._raw_module_msgs_state[msg.msgid][line] = status
25 except KeyError:
26 self._raw_module_msgs_state[msg.msgid] = {line: status}
Path 3: 11 calls (0.0)
MessageDefinition (11)
4 (2) 71 (2) 14 (1) 25 (1) 3 (1) 29 (1) 95 (1) 21 (1) 46 (1)
False (11)
'line' (11)
KeyError (11)
1def set_msg_status(
2 self,
3 msg: MessageDefinition,
4 line: int,
5 status: bool,
6 scope: str = "package",
7 ) -> None:
8 """Set status (enabled/disable) for a given message at a given line."""
9 assert line > 0
10 assert self._module
11 # TODO: 3.0: Remove unnecessary assertion
12 assert self._msgs_store
13
14 if scope != "line":
15 # Expand the status to cover all relevant block lines
16 self._set_state_on_block_lines(
17 self._msgs_store, self._module, msg, {line: status}
18 )
19 else:
20 self._set_message_state_on_line(msg, line, status, line)
21
22 # Store the raw value
23 try:
24 self._raw_module_msgs_state[msg.msgid][line] = status
25 except KeyError:
26 self._raw_module_msgs_state[msg.msgid] = {line: status}
Path 4: 5 calls (0.0)
MessageDefinition (5)
9 (2) 14 (1) 37 (1) 36 (1)
False (5)
'line' (5)
1def set_msg_status(
2 self,
3 msg: MessageDefinition,
4 line: int,
5 status: bool,
6 scope: str = "package",
7 ) -> None:
8 """Set status (enabled/disable) for a given message at a given line."""
9 assert line > 0
10 assert self._module
11 # TODO: 3.0: Remove unnecessary assertion
12 assert self._msgs_store
13
14 if scope != "line":
15 # Expand the status to cover all relevant block lines
16 self._set_state_on_block_lines(
17 self._msgs_store, self._module, msg, {line: status}
18 )
19 else:
20 self._set_message_state_on_line(msg, line, status, line)
21
22 # Store the raw value
23 try:
24 self._raw_module_msgs_state[msg.msgid][line] = status
25 except KeyError:
26 self._raw_module_msgs_state[msg.msgid] = {line: status}