We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a32c17 commit 0aa1945Copy full SHA for 0aa1945
cpp/ql/lib/semmle/code/cpp/AutogeneratedFile.qll
@@ -84,6 +84,7 @@ private int fileHeaderLimit(File f) {
84
fc = fileFirstComment(f) and
85
result =
86
min(int line |
87
+ // code ending the initial comments
88
exists(DeclarationEntry de, Location l |
89
l = de.getLocation() and
90
l.getFile() = f and
@@ -105,8 +106,12 @@ private int fileHeaderLimit(File f) {
105
106
line > fc
107
)
108
or
109
+ // end of the file
110
line = f.getMetrics().getNumberOfLines()
111
112
+ // rarely, we've seen extremely long sequences of initial comments
113
+ // (and/or limitations in the above constraints) cause an overflow of
114
+ // the maximum string length. So don't look past 1000 lines regardless.
115
line = 1000
116
117
0 commit comments