mirror of
https://github.com/anotherhadi/github-recon.git
synced 2026-10-05 10:58:25 +02:00
Lower the stored result to count occurence
Signed-off-by: Hadi <[email protected]>
This commit is contained in:
@@ -2,6 +2,7 @@ package recon
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
github_recon_settings "github.com/anotherhadi/github-recon/settings"
|
||||
"github.com/anotherhadi/github-recon/utils"
|
||||
@@ -49,7 +50,7 @@ func Commits(s github_recon_settings.Settings) (response CommitsResult) {
|
||||
if utils.SkipResult(name, email) {
|
||||
continue
|
||||
}
|
||||
if _, seen := results[name+" - "+email+" - "+login]; !seen {
|
||||
if _, seen := results[strings.ToLower(name)+" - "+strings.ToLower(email)+" - "+strings.ToLower(login)]; !seen {
|
||||
author := CommitResult{
|
||||
Name: name,
|
||||
Email: email,
|
||||
@@ -58,11 +59,11 @@ func Commits(s github_recon_settings.Settings) (response CommitsResult) {
|
||||
FirstFoundIn: item.GetRepository().Owner.GetLogin() + "/" + item.GetRepository().
|
||||
GetName(),
|
||||
}
|
||||
results[name+" - "+email+" - "+login] = author
|
||||
results[strings.ToLower(name)+" - "+strings.ToLower(email)+" - "+strings.ToLower(login)] = author
|
||||
} else {
|
||||
result := results[name+" - "+email+" - "+login]
|
||||
result := results[strings.ToLower(name)+" - "+strings.ToLower(email)+" - "+strings.ToLower(login)]
|
||||
result.Occurrences++
|
||||
results[name+" - "+email+" - "+login] = result
|
||||
results[strings.ToLower(name)+" - "+strings.ToLower(email)+" - "+strings.ToLower(login)] = result
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package recon
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
github_recon_settings "github.com/anotherhadi/github-recon/settings"
|
||||
"github.com/anotherhadi/github-recon/utils"
|
||||
@@ -54,25 +55,27 @@ func Commits(s github_recon_settings.Settings) (response CommitsResult) {
|
||||
}
|
||||
|
||||
for i := range names {
|
||||
if utils.SkipResult(names[i], emails[i]) {
|
||||
name := names[i]
|
||||
email := emails[i]
|
||||
if utils.SkipResult(name, email) {
|
||||
continue
|
||||
}
|
||||
if names[i] == "" || emails[i] == "" {
|
||||
if name == "" || email == "" {
|
||||
continue
|
||||
}
|
||||
if _, seen := results[names[i]+" - "+emails[i]]; !seen {
|
||||
if _, seen := results[strings.ToLower(name)+" - "+strings.ToLower(email)]; !seen {
|
||||
author := CommitResult{
|
||||
Name: names[i],
|
||||
Email: emails[i],
|
||||
Name: name,
|
||||
Email: email,
|
||||
Occurrences: 1,
|
||||
FirstFoundIn: item.GetRepository().Owner.GetLogin() + "/" + item.GetRepository().
|
||||
GetName(),
|
||||
}
|
||||
results[names[i]+" - "+emails[i]] = author
|
||||
results[strings.ToLower(name)+" - "+strings.ToLower(email)] = author
|
||||
} else if i == 0 {
|
||||
result := results[names[i]+" - "+emails[i]]
|
||||
result := results[strings.ToLower(name)+" - "+strings.ToLower(email)]
|
||||
result.Occurrences++
|
||||
results[names[i]+" - "+emails[i]] = result
|
||||
results[strings.ToLower(name)+" - "+strings.ToLower(email)] = result
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user