Method: pylint.checkers.base_checker.BaseChecker.create_message_definition_from_tuple
Calls: 1279848, Exceptions: 1, Paths: 5Back
Path 1: 859336 calls (0.67)
'E0111' (3453) 'E0119' (3453) 'W0101' (3453) 'W0102' (3453) 'W0104' (3453) 'W0105' (3453) 'W0106' (3453) 'W0108' (3453) 'W0109' (3453) 'W0122' (3453) ...
('The first reversed() argument is not a sequence', 'bad-reversed-sequence', "Used when the first argument to reversed() builtin isn't a sequence (doe...
MessageDefinition (859336)
1def create_message_definition_from_tuple(
2 self, msgid: str, msg_tuple: MessageDefinitionTuple
3 ) -> MessageDefinition:
4 with warnings.catch_warnings():
5 warnings.filterwarnings("ignore", category=DeprecationWarning)
6 if isinstance(self, (BaseTokenChecker, BaseRawFileChecker)):
7 default_scope = WarningScope.LINE
8 # TODO: 3.0: Remove deprecated if-statement
9 elif implements(self, (IRawChecker, ITokenChecker)):
10 warnings.warn( # pragma: no cover
11 "Checkers should subclass BaseTokenChecker or BaseRawFileChecker "
12 "instead of using the __implements__ mechanism. Use of __implements__ "
13 "will no longer be supported in pylint 3.0",
14 DeprecationWarning,
15 )
16 default_scope = WarningScope.LINE # pragma: no cover
17 else:
18 default_scope = WarningScope.NODE
19 options: ExtraMessageOptions = {}
20 if len(msg_tuple) == 4:
21 (msg, symbol, descr, options) = msg_tuple # type: ignore[misc]
22 elif len(msg_tuple) == 3:
23 (msg, symbol, descr) = msg_tuple # type: ignore[misc]
24 else:
25 error_msg = """Messages should have a msgid, a symbol and a description. Something like this :
26
27"W1234": (
28 "message",
29 "message-symbol",
30 "Message description with detail.",
31 ...
32),
33"""
34 raise InvalidMessageError(error_msg)
35 options.setdefault("scope", default_scope)
36 return MessageDefinition(self, msgid, msg, descr, symbol, **options)
Path 2: 217771 calls (0.17)
'R0801' (3453) 'C0401' (3450) 'C0402' (3450) 'C0403' (3450) 'W0511' (3450) 'I0023' (3450) 'C2503' (3450) 'E2501' (3450) 'E2502' (3450) 'E2510' (3450) ...
('Similar lines in %s files\n%s', 'duplicate-code', 'Indicates that a set of similar lines has been detected among multiple file. This usually means t...
MessageDefinition (217771)
1def create_message_definition_from_tuple(
2 self, msgid: str, msg_tuple: MessageDefinitionTuple
3 ) -> MessageDefinition:
4 with warnings.catch_warnings():
5 warnings.filterwarnings("ignore", category=DeprecationWarning)
6 if isinstance(self, (BaseTokenChecker, BaseRawFileChecker)):
7 default_scope = WarningScope.LINE
8 # TODO: 3.0: Remove deprecated if-statement
9 elif implements(self, (IRawChecker, ITokenChecker)):
10 warnings.warn( # pragma: no cover
11 "Checkers should subclass BaseTokenChecker or BaseRawFileChecker "
12 "instead of using the __implements__ mechanism. Use of __implements__ "
13 "will no longer be supported in pylint 3.0",
14 DeprecationWarning,
15 )
16 default_scope = WarningScope.LINE # pragma: no cover
17 else:
18 default_scope = WarningScope.NODE
19 options: ExtraMessageOptions = {}
20 if len(msg_tuple) == 4:
21 (msg, symbol, descr, options) = msg_tuple # type: ignore[misc]
22 elif len(msg_tuple) == 3:
23 (msg, symbol, descr) = msg_tuple # type: ignore[misc]
24 else:
25 error_msg = """Messages should have a msgid, a symbol and a description. Something like this :
26
27"W1234": (
28 "message",
29 "message-symbol",
30 "Message description with detail.",
31 ...
32),
33"""
34 raise InvalidMessageError(error_msg)
35 options.setdefault("scope", default_scope)
36 return MessageDefinition(self, msgid, msg, descr, symbol, **options)
Path 3: 188940 calls (0.15)
'E0001' (4502) 'E0011' (4502) 'E0013' (4502) 'E0014' (4502) 'E0015' (4502) 'F0001' (4502) 'F0002' (4502) 'F0010' (4502) 'F0011' (4502) 'I0001' (4502) ...
tuple (188940)
MessageDefinition (188940)
1def create_message_definition_from_tuple(
2 self, msgid: str, msg_tuple: MessageDefinitionTuple
3 ) -> MessageDefinition:
4 with warnings.catch_warnings():
5 warnings.filterwarnings("ignore", category=DeprecationWarning)
6 if isinstance(self, (BaseTokenChecker, BaseRawFileChecker)):
7 default_scope = WarningScope.LINE
8 # TODO: 3.0: Remove deprecated if-statement
9 elif implements(self, (IRawChecker, ITokenChecker)):
10 warnings.warn( # pragma: no cover
11 "Checkers should subclass BaseTokenChecker or BaseRawFileChecker "
12 "instead of using the __implements__ mechanism. Use of __implements__ "
13 "will no longer be supported in pylint 3.0",
14 DeprecationWarning,
15 )
16 default_scope = WarningScope.LINE # pragma: no cover
17 else:
18 default_scope = WarningScope.NODE
19 options: ExtraMessageOptions = {}
20 if len(msg_tuple) == 4:
21 (msg, symbol, descr, options) = msg_tuple # type: ignore[misc]
22 elif len(msg_tuple) == 3:
23 (msg, symbol, descr) = msg_tuple # type: ignore[misc]
24 else:
25 error_msg = """Messages should have a msgid, a symbol and a description. Something like this :
26
27"W1234": (
28 "message",
29 "message-symbol",
30 "Message description with detail.",
31 ...
32),
33"""
34 raise InvalidMessageError(error_msg)
35 options.setdefault("scope", default_scope)
36 return MessageDefinition(self, msgid, msg, descr, symbol, **options)
Path 4: 13800 calls (0.01)
'C0321' (3450) 'R1702' (3450) 'R1703' (3450) 'W1404' (3449) 'C1802' (1)
tuple (13800)
MessageDefinition (13800)
1def create_message_definition_from_tuple(
2 self, msgid: str, msg_tuple: MessageDefinitionTuple
3 ) -> MessageDefinition:
4 with warnings.catch_warnings():
5 warnings.filterwarnings("ignore", category=DeprecationWarning)
6 if isinstance(self, (BaseTokenChecker, BaseRawFileChecker)):
7 default_scope = WarningScope.LINE
8 # TODO: 3.0: Remove deprecated if-statement
9 elif implements(self, (IRawChecker, ITokenChecker)):
10 warnings.warn( # pragma: no cover
11 "Checkers should subclass BaseTokenChecker or BaseRawFileChecker "
12 "instead of using the __implements__ mechanism. Use of __implements__ "
13 "will no longer be supported in pylint 3.0",
14 DeprecationWarning,
15 )
16 default_scope = WarningScope.LINE # pragma: no cover
17 else:
18 default_scope = WarningScope.NODE
19 options: ExtraMessageOptions = {}
20 if len(msg_tuple) == 4:
21 (msg, symbol, descr, options) = msg_tuple # type: ignore[misc]
22 elif len(msg_tuple) == 3:
23 (msg, symbol, descr) = msg_tuple # type: ignore[misc]
24 else:
25 error_msg = """Messages should have a msgid, a symbol and a description. Something like this :
26
27"W1234": (
28 "message",
29 "message-symbol",
30 "Message description with detail.",
31 ...
32),
33"""
34 raise InvalidMessageError(error_msg)
35 options.setdefault("scope", default_scope)
36 return MessageDefinition(self, msgid, msg, descr, symbol, **options)
Path 5: 1 calls (0.0)
'W0001' (1)
('msg-name',) (1)
InvalidMessageError (1)
1def create_message_definition_from_tuple(
2 self, msgid: str, msg_tuple: MessageDefinitionTuple
3 ) -> MessageDefinition:
4 with warnings.catch_warnings():
5 warnings.filterwarnings("ignore", category=DeprecationWarning)
6 if isinstance(self, (BaseTokenChecker, BaseRawFileChecker)):
7 default_scope = WarningScope.LINE
8 # TODO: 3.0: Remove deprecated if-statement
9 elif implements(self, (IRawChecker, ITokenChecker)):
10 warnings.warn( # pragma: no cover
11 "Checkers should subclass BaseTokenChecker or BaseRawFileChecker "
12 "instead of using the __implements__ mechanism. Use of __implements__ "
13 "will no longer be supported in pylint 3.0",
14 DeprecationWarning,
15 )
16 default_scope = WarningScope.LINE # pragma: no cover
17 else:
18 default_scope = WarningScope.NODE
19 options: ExtraMessageOptions = {}
20 if len(msg_tuple) == 4:
21 (msg, symbol, descr, options) = msg_tuple # type: ignore[misc]
22 elif len(msg_tuple) == 3:
23 (msg, symbol, descr) = msg_tuple # type: ignore[misc]
24 else:
25 error_msg = """Messages should have a msgid, a symbol and a description. Something like this :
26
27"W1234": (
28 "message",
29 "message-symbol",
30 "Message description with detail.",
31 ...
32),
33"""
34 raise InvalidMessageError(error_msg)
35 options.setdefault("scope", default_scope)
36 return MessageDefinition(self, msgid, msg, descr, symbol, **options)