Path 1: 5787 calls (0.99)

'' (5636) 'f' (91) 'b' (39) 'u' (21)

'' (168) 'a' (104) 'b' (71) 'hi' (71) '1' (61) 'foo' (58) 'TEST' (57) '2' (51) 'key' (50) 'http://localhost' (50)

1 (577) 5 (156) 8 (136) 9 (122) 10 (113) 6 (110) 13 (100) 7 (95) 14 (87) 12 (87)

7 (1423) 3 (696) 11 (549) 15 (247) 16 (227) 5 (217) 9 (144) 12 (135) 21 (129) 17 (115)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2
            

Path 2: 47 calls (0.01)

'' (44) 'b' (1) 'f' (1) 'u' (1)

'\\n' (14) "this method shouldn\\'t have a docstring" (4) '1\\t' (2) '2\\t' (2) 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb \\\n ...

23 (3) 11 (3) 38 (2) 39 (2) 40 (2) 22 (2) 36 (2) 7 (2) 20 (2) 16 (1)

15 (12) 16 (6) 23 (3) 18 (3) 17 (3) 19 (3) 21 (3) 12 (2) 7 (2) 10 (2)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2
            

Path 3: 9 calls (0.0)

'' (7) 'b' (2)

'\\z' (2) 'abc\\z' (2) '\\[\\]\\\\' (1) '\\/' (1) '\\`' (1) '\\o123\\o000' (1) '\\888\\999' (1)

4 (1) 5 (1) 6 (1) 15 (1) 7 (1) 8 (1) 9 (1) 16 (1) 18 (1)

14 (1) 24 (1) 27 (1) 23 (1) 5 (1) 8 (1) 20 (1) 15 (1) 13 (1)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2
            

Path 4: 5 calls (0.0)

'u' (5)

'\\u0042' (1) '\\U00000042' (1) '\\N{GREEK SMALL LETTER ALPHA}' (1) '\\u1234' (1) '\\U0000abcd' (1)

10 (1) 11 (1) 12 (1) 20 (1) 21 (1)

17 (2) 22 (1) 23 (1) 12 (1)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2
            

Path 5: 4 calls (0.0)

'b' (4)

'\\u0042' (1) '\\U00000042' (1) '\\N{GREEK SMALL LETTER ALPHA}' (1) '\\u1234' (1)

5 (2) 6 (1) 8 (1)

16 (1) 21 (1) 22 (1) 15 (1)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2
            

Path 6: 4 calls (0.0)

'' (4)

"check assignment to function call where the function doesn't return\n\n 'E1111': ('Assigning to function call which doesn\\'t return',\n ...

2 (1) 344 (1) 438 (1) 1 (1)

3 (2) 7 (2)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2
            

Path 7: 2 calls (0.0)

'b' (1) '' (1)

'\n abc\n \\z\n' (1) "Even in a docstring\n\nYou shouldn't have ambiguous text like: C:\\Program Files\\alpha\n" (1)

10 (1) 29 (1)

23 (1) 3 (1)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2
            

Path 8: 1 calls (0.0)

'b' (1)

'a\\\n \\z' (1)

7 (1)

30 (1)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2
            

Path 9: 1 calls (0.0)

'' (1)

'\\u1234' (1)

6 (1)

15 (1)

1def process_non_raw_string_token(
2        self, prefix: str, string_body: str, start_row: int, string_start_col: int
3    ) -> None:
4        """Check for bad escapes in a non-raw string.
5
6        prefix: lowercase string of string prefix markers ('ur').
7        string_body: the un-parsed body of the string, not including the quote
8        marks.
9        start_row: line number in the source.
10        string_start_col: col number of the string start in the source.
11        """
12        # Walk through the string; if we see a backslash then escape the next
13        # character, and skip over it.  If we see a non-escaped character,
14        # alert, and continue.
15        #
16        # Accept a backslash when it escapes a backslash, or a quote, or
17        # end-of-line, or one of the letters that introduce a special escape
18        # sequence <https://docs.python.org/reference/lexical_analysis.html>
19        #
20        index = 0
21        while True:
22            index = string_body.find("\\", index)
23            if index == -1:
24                break
25            # There must be a next character; having a backslash at the end
26            # of the string would be a SyntaxError.
27            next_char = string_body[index + 1]
28            match = string_body[index : index + 2]
29            # The column offset will vary depending on whether the string token
30            # is broken across lines. Calculate relative to the nearest line
31            # break or relative to the start of the token's line.
32            last_newline = string_body.rfind("\n", 0, index)
33            if last_newline == -1:
34                line = start_row
35                col_offset = index + string_start_col
36            else:
37                line = start_row + string_body.count("\n", 0, index)
38                col_offset = index - last_newline - 1
39            if next_char in self.UNICODE_ESCAPE_CHARACTERS:
40                if "u" in prefix:
41                    pass
42                elif "b" not in prefix:
43                    pass  # unicode by default
44                else:
45                    self.add_message(
46                        "anomalous-unicode-escape-in-string",
47                        line=line,
48                        args=(match,),
49                        col_offset=col_offset,
50                    )
51            elif next_char not in self.ESCAPE_CHARACTERS:
52                self.add_message(
53                    "anomalous-backslash-in-string",
54                    line=line,
55                    args=(match,),
56                    col_offset=col_offset,
57                )
58            # Whether it was a valid escape or not, backslash followed by
59            # another character can always be consumed whole: the second
60            # character can never be the start of a new backslash escape.
61            index += 2