File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -33,4 +33,13 @@ class Folder = Impl::Folder;
33
33
class File extends Container , Impl:: File {
34
34
/** Holds if this file was extracted from ordinary source code. */
35
35
predicate fromSource ( ) { any ( ) }
36
+
37
+ /**
38
+ * Gets the number of lines containing code in this file. This value
39
+ * is approximate.
40
+ */
41
+ int getNumberOfLinesOfCode ( ) {
42
+ result =
43
+ count ( int line | exists ( Location loc | loc .getFile ( ) = this and loc .getStartLine ( ) = line and not loc instanceof EmptyLocation ) )
44
+ }
36
45
}
Original file line number Diff line number Diff line change 4
4
5
5
import rust
6
6
7
- int getLinesOfCode ( ) {
8
- result = sum ( File f | | f .getNumberOfLinesOfCode ( ) )
9
- }
7
+ int getLinesOfCode ( ) { result = sum ( File f | | f .getNumberOfLinesOfCode ( ) ) }
10
8
11
9
int getLinesOfUserCode ( ) {
12
10
result = sum ( File f | exists ( f .getRelativePath ( ) ) | f .getNumberOfLinesOfCode ( ) )
You can’t perform that action at this time.
0 commit comments