Skip to content

Commit 5f7fe99

Browse files
chore: fix style
1 parent da523d1 commit 5f7fe99

File tree

3 files changed

+260
-264
lines changed

3 files changed

+260
-264
lines changed

src/main/kotlin/app/extractors/Heuristics.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,18 @@ object Heuristics
235235
* Returns a list of language commit stats extracted from the given file.
236236
*/
237237
fun analyze(file: DiffFile) : List<CommitStats>? {
238-
var buf = toBuf(file.new.content)
238+
val buf = toBuf(file.new.content)
239239
var extractor: ExtractorInterface? = null
240240

241241
// Look for an extractor by a file extension. If failed, then fallback
242242
// to generic content analysis.
243-
val extractorFactory = HeuristicsMap.get(file.extension)
243+
val extractorFactory = HeuristicsMap[file.extension]
244244
if (extractorFactory != null) {
245245
extractor = extractorFactory(buf)
246-
}
247-
else {
248-
if (XMLRegex.containsMatchIn(buf))
246+
} else {
247+
if (XMLRegex.containsMatchIn(buf)) {
249248
extractor = CommonExtractor(Lang.XML)
249+
}
250250
}
251251

252252
return extractor?.extract(listOf(file))
@@ -255,7 +255,7 @@ object Heuristics
255255
/**
256256
* Returns a portion of the file content not exceeding the limit.
257257
*/
258-
const val HEURISTICS_CONSIDER_BYTES = 50 * 1024
258+
private const val HEURISTICS_CONSIDER_BYTES = 50 * 1024
259259
private fun toBuf(lines: List<String>) : String {
260260
var buf = ""
261261
for (line in lines) {

src/main/kotlin/app/hashers/CommitCrawler.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@
44
package app.hashers
55

66
import app.Logger
7-
//import app.hashers.VendorConventions
87
import app.model.Author
98
import app.model.Commit
109
import app.model.DiffContent
1110
import app.model.DiffFile
1211
import app.model.DiffRange
1312
import app.model.Repo
1413
import app.utils.EmptyRepoException
15-
import app.utils.FileHelper
1614
import io.reactivex.Observable
1715
import java.io.BufferedReader
18-
import java.io.FileReader
19-
import java.io.File
2016
import java.io.InputStreamReader
2117
import org.apache.commons.codec.digest.DigestUtils
2218
import org.eclipse.jgit.api.Git

0 commit comments

Comments
 (0)