Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 9ca62de

Browse files
committed
Convert over to sloccounter to ensure line stats are accurate
1 parent 233119e commit 9ca62de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/searchcode/app/jobs/repository/SearchcodeFileVisitor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ public FileVisitResult visitFile(Object file, BasicFileAttributes attrs) throws
104104
SlocCounter.SlocCount slocCount = Singleton.getSlocCounter().countStats(StringUtils.join(codeLinesReturn.getCodeLines(), "\n"), languageName);
105105

106106

107-
String displayLocation = fileLocationFilename.substring(fileLocationFilename.indexOf("/") + 1, fileLocationFilename.length());
107+
String displayLocation = fileLocationFilename.substring(fileLocationFilename.indexOf("/") + 1);
108108

109109
if (Values.FILE.equals(this.repoResult.getScm())) {
110110
displayLocation = fileToString.replace(this.repoResult.getUrl(), "");
111111
if (displayLocation.startsWith("/")) {
112-
displayLocation = displayLocation.substring(displayLocation.indexOf("/") + 1, displayLocation.length());
112+
displayLocation = displayLocation.substring(displayLocation.indexOf("/") + 1);
113113
}
114114
}
115115

@@ -136,7 +136,7 @@ public FileVisitResult visitFile(Object file, BasicFileAttributes attrs) throws
136136
if (this.indexBaseRepoJob.LOWMEMORY) {
137137
Singleton.getIndexService().indexDocument(codeIndexDocument);
138138
} else {
139-
Singleton.getIndexService().incrementCodeIndexLinesCount(codeLinesReturn.getCodeLines().size());
139+
Singleton.getIndexService().incrementCodeIndexLinesCount(slocCount.linesCount);
140140
Singleton.getCodeIndexQueue().add(codeIndexDocument);
141141
}
142142

0 commit comments

Comments
 (0)