Swift: add SuccessfullyExtractedLines query#12725
Conversation
This counts how many lines we have extracted some entity in. If we test changes in this, we can have a more fine grained look into how much we actually extract than looking at the extracted files.
| * @description Count all lines in source code in which something was extracted. | ||
| * @kind metric | ||
| * @id swift/diagnostics/successfully-extracted-lines | ||
| * @tags summary |
There was a problem hiding this comment.
Please confirm that * lines-of-code has been omitted here to avoid code-scanning from picking this up for the time being.
There was a problem hiding this comment.
yes, this query is different than lines-of-code queries from other languages, as
- it will not count lines for which nothing was extracted because of any kind of problem
- it does count comment lines
- it will count 1 line for big things spanning multiple lines. Multiline AST-entities typically have children elements that will show up in this count, but for example multiline strings and comments will contribute only 1 line in this metric.
I think this might be confusing if it were presented as the user-facing lines-of-code, but maybe this is up for debate? For the time being I'd keep it separate
There was a problem hiding this comment.
For context: I've looked into how the C/C++ extractor extracts the data used by lines-of-code, and on each source file it just bluntly opens the file and counts the lines, matching empty and comment lines to fill in the different values of the numlines table (numcode is what is used in the lines-of-code query):
codeql/cpp/ql/lib/semmlecode.cpp.dbscheme
Lines 256 to 262 in 33b4d2d
This counts how many lines we have extracted some entity in. If we test changes in this, we can have a more fine grained look into how much we actually extract than looking at the extracted files.