Compare commits

..

No commits in common. "f04a4719692da66706d614d01ee89acd9540b963" and "18cd2a8c4d6d154d22da17388723eeb948535442" have entirely different histories.

2 changed files with 4 additions and 14 deletions

View File

@ -41,7 +41,7 @@ type Binder struct {
} }
func (b Binder) String() string { func (b Binder) String() string {
return fmt.Sprintf("in the definition of %s (at %s)", b.Binder, b.Pos) return fmt.Sprintf("In the definition of %s (at %s)", b.Binder, b.Pos)
} }
type Binders []Binder type Binders []Binder
@ -51,12 +51,7 @@ func (bs Binders) String() string {
for _, b := range bs { for _, b := range bs {
s = append(s, b.String()) s = append(s, b.String())
} }
combinedStr := strings.Join(s, "; ") return strings.Join(s, "; ")
if len(combinedStr) > 0 && combinedStr[0] == 'i' {
return "I" + combinedStr[1:]
}
return combinedStr
} }
type Source struct { type Source struct {

View File

@ -35,19 +35,14 @@ func (p *Elf) parse(executorResult stage.ExecutorResult, conf Conf) stage.Parser
slog.Error("elf parse", "mapstructure decode err", err) slog.Error("elf parse", "mapstructure decode err", err)
} }
comment += fmt.Sprintf("### [%s] %s\n", report.File, report.Name) comment += fmt.Sprintf("### [%s] %s\n", report.File, report.Name)
caseScore := 0 for _, caseObj := range report.Cases {
for range report.Cases {
for _, match := range conf.Matches { for _, match := range conf.Matches {
for _, keyword := range match.Keywords { for _, keyword := range match.Keywords {
if strings.Contains(kind, keyword) { if strings.Contains(kind, keyword) {
caseScore += -match.Score score += -match.Score
} }
} }
} }
}
score += caseScore
comment += fmt.Sprintf("%d point(s)\n", caseScore)
for _, caseObj := range report.Cases {
switch kind { switch kind {
case "ParenDep": case "ParenDep":
// "<binders>:\n<context> below reaches a parentheses depths of <depths>:\n<code>" // "<binders>:\n<context> below reaches a parentheses depths of <depths>:\n<code>"