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;
3333class File extends Container , Impl:: File {
3434 /** Holds if this file was extracted from ordinary source code. */
3535 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+ }
3645}
Original file line number Diff line number Diff line change 44
55import rust
66
7- int getLinesOfCode ( ) {
8- result = sum ( File f | | f .getNumberOfLinesOfCode ( ) )
9- }
7+ int getLinesOfCode ( ) { result = sum ( File f | | f .getNumberOfLinesOfCode ( ) ) }
108
119int getLinesOfUserCode ( ) {
1210 result = sum ( File f | exists ( f .getRelativePath ( ) ) | f .getNumberOfLinesOfCode ( ) )
You can’t perform that action at this time.
0 commit comments