Path 1: 12074 calls (0.51)

MessageDefinition (12074)

1 (1821) 2 (1004) 3 (698) 4 (439) 5 (293) 0 (285) 6 (280) 7 (214) 9 (199) 8 (197)

None (12074)

("'missing-function-docstring'", 1) (623) ('missing-function-docstring', 'C0116') (469) ('missing-class-docstring', 'C0115') (439) ('missing-module-do...

Confidence (12074)

None (12049) 1 (4) 5 (3) 15 (2) 21 (2) 25 (2) 0 (2) 20 (1) 17 (1) 27 (1)

None (12074)

None (12074)

None (12074)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 2: 3983 calls (0.17)

MessageDefinition (3983)

None (3983)

AssignName (1423) Expr (434) ImportFrom (332) Import (309) Module (298) Name (257) Call (197) Const (108) Compare (88) Lambda (81)

None (1081) 'self' (116) ('Argument', 'x', 'snake_case naming style') (84) ('Argument', 'y', 'snake_case naming style') (71) ('Variable', 'a', 'snake_...

Confidence (3983)

None (3983)

None (3983)

None (3983)

None (3983)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 3: 3527 calls (0.15)

MessageDefinition (3527)

None (3527)

ClassDef (2045) FunctionDef (1445) AsyncFunctionDef (37)

None (2145) (0, 2) (557) (1, 2) (427) ('function', 7) (31) 'foo' (28) ('Class', 'A', 'PascalCase naming style') (27) ('Class', 'B', 'PascalCase naming...

Confidence (3527)

None (3527)

None (3527)

None (3527)

None (3527)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 4: 1515 calls (0.06)

MessageDefinition (1515)

None (1515)

Call (296) Name (238) AssignName (169) Attribute (110) Compare (108) Import (101) ImportFrom (49) BoolOp (47) Assign (41) If (38)

('lazy %',) (19) ('else', 'remove the "else" and de-indent the code inside it') (19) ('v',) (18) ('Union', '') (17) ('typing.List', 'list') (13) 'erro...

Confidence (1515)

None (1515)

None (1515)

None (1515)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 5: 571 calls (0.02)

MessageDefinition (571)

None (571)

Call (191) Name (37) Raise (35) Lambda (29) Const (24) Assign (22) Subscript (20) Attribute (17) BoolOp (17) Compare (16)

None (571)

Confidence (571)

None (571)

None (571)

None (571)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 6: 511 calls (0.02)

MessageDefinition (511)

None (511)

AssignName (86) Import (81) Call (76) Name (70) Attribute (46) ImportFrom (28) Compare (17) AssignAttr (11) If (11) BinOp (9)

"'nonexistent'" (21) 'import nonexistent' (21) 'i' (14) ('lazy %',) (10) 'variable' (10) 'x' (6) ('else', 'remove the "else" and de-indent the code in...

Confidence (511)

None (511)

None (511)

None (511)

KeyError (511)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 7: 347 calls (0.01)

MessageDefinition (347)

None (347)

FunctionDef (226) ClassDef (97) UnboundMethod (18) AsyncFunctionDef (6)

('x, y',) (15) ('x',) (13) ('yarg1',) (6) (0, 2) (6) ('xarg, zarg',) (5) ('AttributeError',) (5) ('RuntimeError',) (5) ('dict() (builtins.dict)',) (4)...

Confidence (347)

None (347)

None (347)

None (347)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 8: 276 calls (0.01)

MessageDefinition (276)

None (74) 9 (18) 1 (16) 11 (15) 10 (14) 8 (10) 16 (10) 2 (10) 12 (9) 18 (9)

None (276)

('From reduce_map_data',) (36) ('From process_module, two files seen.',) (36) (1, 'spaces', 4) (24) tuple (13) (2, 'spaces', 8) (12) ('invalid-name', ...

Confidence (276)

None (253) 5 (5) 20 (3) 4 (2) 27 (1) 30 (1) 23 (1) 21 (1) 22 (1) 7 (1)

None (273) 2 (3)

None (273) 4 (3)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 9: 186 calls (0.01)

MessageDefinition (186)

None (186)

Call (42) Module (18) Name (17) Raise (11) Expr (11) Assign (8) BinOp (7) Return (6) AssignName (6) ImportFrom (5)

None (186)

Confidence (186)

None (186)

None (186)

None (186)

KeyError (186)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 10: 153 calls (0.01)

MessageDefinition (153)

None (44) 1 (29) 0 (18) 8 (13) 5 (12) 6 (7) 7 (6) 4 (5) 2 (5) 3 (4)

None (153)

(1, 'spaces', 4) (14) ('From reduce_map_data',) (12) ('From process_module, two files seen.',) (12) (1, 2) (10) tuple (7) "Parsing failed: 'invalid sy...

Confidence (153)

None (138) 5 (3) 1 (3) 9 (3) 23 (2) 14 (1) 16 (1) 15 (1) 4 (1)

None (152) 1 (1)

None (152) 4 (1)

KeyError (153)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 11: 143 calls (0.01)

MessageDefinition (143)

None (143)

FunctionDef (90) ClassDef (41) AsyncFunctionDef (7) UnboundMethod (5)

(0, 2) (6) ('RuntimeError',) (5) ('function',) (3) ('y',) (3) ('x, y',) (3) ('ClassFoo',) (3) ('xarg1, zarg1',) (3) ('_',) (3) ('_, _ignored',) (3) ('...

Confidence (143)

None (143)

None (143)

None (143)

KeyError (143)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 12: 135 calls (0.01)

MessageDefinition (135)

13 (5) 8 (4) 11 (4) 12 (4) 6 (4) 16 (3) 17 (3) 20 (3) 21 (3) 22 (3)

Const (135)

None (135)

Confidence (135)

4 (63) 10 (20) 19 (7) 21 (5) 6 (4) 15 (3) 11 (3) 7 (2) 8 (2) 14 (2)

None (135)

None (135)

None (135)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 13: 135 calls (0.01)

MessageDefinition (135)

None (135)

FunctionDef (113) ClassDef (17) AsyncFunctionDef (5)

None (135)

Confidence (135)

None (135)

None (135)

None (135)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 14: 106 calls (0.0)

MessageDefinition (106)

None (106)

FunctionDef (93) ClassDef (13)

None (106)

Confidence (106)

None (106)

None (106)

None (106)

KeyError (106)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 15: 52 calls (0.0)

MessageDefinition (52)

12 (2) 105 (2) 19 (1) 29 (1) 11 (1) 44 (1) 48 (1) 60 (1) 61 (1) 65 (1)

While (27) Assign (22) TryExcept (2) TryFinally (1)

'+=' (4) '%=' (4) '*=' (2) '^=' (2) '&=' (2) '|=' (2) ('(x == 0) and (x >= 0) and (x != 0)', 'True') (2) 'try clause contains 3 statements, expected a...

Confidence (52)

None (30) 0 (22)

None (52)

None (52)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 16: 34 calls (0.0)

MessageDefinition (34)

263 (2) 12 (2) 4 (2) 8 (1) 9 (1) 10 (1) 11 (1) 13 (1) 14 (1) 15 (1)

Const (27) For (4) Lambda (2) While (1)

None (34)

Confidence (34)

0 (27) None (7)

None (34)

None (34)

None (34)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 17: 29 calls (0.0)

MessageDefinition (29)

46 (1) 47 (1) 48 (1) 49 (1) 50 (1) 51 (1) 52 (1) 53 (1) 54 (1) 80 (1)

Const (29)

None (29)

Confidence (29)

4 (10) 8 (10) 10 (9)

None (29)

None (29)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 18: 25 calls (0.0)

MessageDefinition (25)

1 (7) 5 (6) 3 (4) 4 (2) 11 (2) 10 (1) 21 (1) 13 (1) 8 (1)

None (25)

None (25)

Confidence (25)

None (13) 4 (5) 0 (3) 10 (1) 33 (1) 11 (1) 21 (1)

None (14) 5 (5) 1 (3) 11 (1) 13 (1) 8 (1)

None (17) 5 (5) 80 (1) 49 (1) 43 (1)

KeyError (25)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 19: 22 calls (0.0)

MessageDefinition (22)

5 (2) 11 (2) 12 (2) 13 (2) 8 (1) 14 (1) 4 (1) 6 (1) 31 (1) 34 (1)

None (22)

None (22)

Confidence (22)

None (12) 11 (2) 22 (2) 3 (2) 10 (1) 14 (1) 73 (1) 46 (1)

None (22)

None (22)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 20: 11 calls (0.0)

MessageDefinition (11)

10 (1) 12 (1) 19 (1) 21 (1) 23 (1) 25 (1) 17 (1) 27 (1) 34 (1) 39 (1)

Lambda (6) While (3) For (2)

None (11)

Confidence (11)

None (11)

None (11)

None (11)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 21: 4 calls (0.0)

MessageDefinition (4)

7 (2) 5 (1) 10 (1)

While (2) TryExcept (1) Assign (1)

'try clause contains 3 statements, expected at most 1' (1) '+=' (1) ('k != 10', '1') (1) ('(a := 10) != (a := 10)', 'True') (1)

Confidence (4)

None (3) 0 (1)

None (4)

None (4)

KeyError (4)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 22: 3 calls (0.0)

MessageDefinition (3)

45 (1) 5 (1) 4 (1)

Const (2) Module (1)

None (3)

Confidence (3)

10 (1) 11 (1) 21 (1)

None (3)

None (3)

KeyError (3)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 23: 3 calls (0.0)

MessageDefinition (3)

32 (1) 33 (1) 134 (1)

Assign (3)

'+=' (3)

Confidence (3)

8 (3)

None (3)

None (3)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 24: 3 calls (0.0)

MessageDefinition (3)

None (2) 2 (1)

None (2) 'fake_node' (1)

(1, 2) (2) None (1)

Confidence (3)

None (3)

None (3)

None (3)

InvalidMessageError (3)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )
            

Path 25: 2 calls (0.0)

MessageDefinition (2)

8 (1) 9 (1)

Lambda (1) For (1)

None (2)

Confidence (2)

None (2)

None (2)

None (2)

KeyError (2)

1def _add_one_message(
2        self,
3        message_definition: MessageDefinition,
4        line: int | None,
5        node: nodes.NodeNG | None,
6        args: Any | None,
7        confidence: interfaces.Confidence | None,
8        col_offset: int | None,
9        end_lineno: int | None,
10        end_col_offset: int | None,
11    ) -> None:
12        """After various checks have passed a single Message is
13        passed to the reporter and added to stats.
14        """
15        message_definition.check_message_definition(line, node)
16
17        # Look up "location" data of node if not yet supplied
18        if node:
19            if node.position:
20                if not line:
21                    line = node.position.lineno
22                if not col_offset:
23                    col_offset = node.position.col_offset
24                if not end_lineno:
25                    end_lineno = node.position.end_lineno
26                if not end_col_offset:
27                    end_col_offset = node.position.end_col_offset
28            else:
29                if not line:
30                    line = node.fromlineno
31                if not col_offset:
32                    col_offset = node.col_offset
33                if not end_lineno:
34                    end_lineno = node.end_lineno
35                if not end_col_offset:
36                    end_col_offset = node.end_col_offset
37
38        # should this message be displayed
39        if not self.is_message_enabled(message_definition.msgid, line, confidence):
40            self.file_state.handle_ignored_message(
41                self._get_message_state_scope(
42                    message_definition.msgid, line, confidence
43                ),
44                message_definition.msgid,
45                line,
46            )
47            return
48
49        # update stats
50        msg_cat = MSG_TYPES[message_definition.msgid[0]]
51        self.msg_status |= MSG_TYPES_STATUS[message_definition.msgid[0]]
52        self.stats.increase_single_message_count(msg_cat, 1)
53        # TODO: 3.0 Should be removable after https://github.com/PyCQA/pylint/pull/5580
54        self.stats.increase_single_module_message_count(
55            self.current_name,  # type: ignore[arg-type]
56            msg_cat,
57            1,
58        )
59        try:
60            self.stats.by_msg[message_definition.symbol] += 1
61        except KeyError:
62            self.stats.by_msg[message_definition.symbol] = 1
63        # Interpolate arguments into message string
64        msg = message_definition.msg
65        if args is not None:
66            msg %= args
67        # get module and object
68        if node is None:
69            module, obj = self.current_name, ""
70            abspath = self.current_file
71        else:
72            module, obj = utils.get_module_and_frameid(node)
73            abspath = node.root().file
74        if abspath is not None:
75            path = abspath.replace(self.reporter.path_strip_prefix, "", 1)
76        else:
77            path = "configuration"
78        # add the message
79        self.reporter.handle_message(
80            Message(
81                message_definition.msgid,
82                message_definition.symbol,
83                MessageLocationTuple(
84                    abspath or "",
85                    path,
86                    module or "",
87                    obj,
88                    line or 1,
89                    col_offset or 0,
90                    end_lineno,
91                    end_col_offset,
92                ),
93                msg,
94                confidence,
95            )
96        )