Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
fix: total failed count
Browse files Browse the repository at this point in the history
  • Loading branch information
dimabru committed Apr 29, 2021
1 parent 56e68dc commit 8b9653f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions bl/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,8 @@ func (e *Evaluator) aggregateEvaluationResults(evaluationResults []cliClient.Eva

totalRulesCount := len(evaluationResults)
totalFailedCount := 0
filenames := make(map[string]string)

for _, result := range evaluationResults {
if !result.Passed {
totalFailedCount++
}
for _, match := range result.Results.Matches {
// file not already exists in mapper
if _, exists := mapper[match.FileName]; !exists {
Expand All @@ -162,17 +158,12 @@ func (e *Evaluator) aggregateEvaluationResults(evaluationResults []cliClient.Eva

// file and rule not already exists in mapper
if _, exists := mapper[match.FileName][result.Rule.ID]; !exists {
filenames[match.FileName] = match.FileName
totalFailedCount++
mapper[match.FileName][result.Rule.ID] = &Rule{ID: result.Rule.ID, Name: result.Rule.Name, FailSuggestion: result.Rule.FailSuggestion, Count: 0}
}

mapper[match.FileName][result.Rule.ID].IncrementCount()
}
for _, mismatch := range result.Results.Mismatches {
if _, exists := mapper[mismatch.FileName]; !exists {
filenames[mismatch.FileName] = mismatch.FileName
}
}
}

results := &EvaluationResults{
Expand Down

0 comments on commit 8b9653f

Please sign in to comment.