mirror of
https://github.com/anotherhadi/github-recon.git
synced 2026-10-05 19:08:24 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98769561c3 |
@@ -202,7 +202,7 @@ func DeepScan(s github_recon_settings.Settings) (response DeepScanResult) {
|
||||
Name: authorName,
|
||||
Email: authorEmail,
|
||||
FoundIn: []string{repoIdentifier},
|
||||
Levenshtein: utils.LevenshteinDistance(s.Target, authorName),
|
||||
Levenshtein: levenshteinDistanceAuthor(s.Target, authorName, authorEmail),
|
||||
})
|
||||
mapAuthorToIndex[trimmedLine] = len(authorOccurrences) - 1
|
||||
}
|
||||
@@ -380,3 +380,10 @@ func findEmailsAndOccurrencesInDir(rootPath string, username string) (Emails, er
|
||||
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func levenshteinDistanceAuthor(target, name, email string) int {
|
||||
if strings.Contains(email, "@") {
|
||||
email = strings.SplitN(email, "@", 2)[0]
|
||||
}
|
||||
return slices.Min([]int{utils.LevenshteinDistance(target, name), utils.LevenshteinDistance(target, email)})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user