File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,12 @@ private predicate looksLikeCode(string line) {
2525 // brace that's preceded by something other than whitespace ...
2626 trimmed .regexpMatch ( ".*.\\}" )
2727 implies
28- // ... then there has to be ") {" (with some variation of
29- // whitespace) on the line, suggesting it's a statement like `if`
28+ // ... then there has to be ") {" (or some variation)
29+ // on the line, suggesting it's a statement like `if`
3030 // or a function declaration. Otherwise it's likely to be a
3131 // benign use of braces such as a JSON example or explanatory
3232 // pseudocode.
33- trimmed .regexpMatch ( ".*\\ )\\s*\\{.*" )
33+ trimmed .regexpMatch ( ".*(\\)|const|volatile|override|final|noexcept|& )\\s*\\{.*" )
3434 )
3535 and not trimmed .regexpMatch ( "(>.*|.*[\\\\@][{}].*|(optional|repeated) .*;|.*(\\{\\{\\{|\\}\\}\\}).*|\\{[-0-9a-zA-Z]+\\})" ) )
3636}
Original file line number Diff line number Diff line change 11| test2.cpp:37:1:37:39 | // int myFunction() { return myValue; } | This comment appears to contain commented-out code |
2+ | test2.cpp:39:1:39:45 | // int myFunction() const { return myValue; } | This comment appears to contain commented-out code |
3+ | test2.cpp:41:1:41:54 | // int myFunction() const noexcept { return myValue; } | This comment appears to contain commented-out code |
24| test.c:2:1:2:22 | // commented out code; | This comment appears to contain commented-out code |
35| test.c:4:1:7:8 | // some; | This comment appears to contain commented-out code |
46| test.c:9:1:13:8 | // also; | This comment appears to contain commented-out code |
Original file line number Diff line number Diff line change 3535// Example: { 1, 2, 3, 4 }
3636
3737// int myFunction() { return myValue; }
38+
39+ // int myFunction() const { return myValue; }
40+
41+ // int myFunction() const noexcept { return myValue; }
You can’t perform that action at this time.
0 commit comments