Skip to content

Commit

Permalink
Fixed the Fact func logic on test code
Browse files Browse the repository at this point in the history
  • Loading branch information
uudashr committed Jul 13, 2021
1 parent 4e3325e commit 6ae0409
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion testdata/src/a/a.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Fact(n int) int { // want "cognitive complexity 3 of func Fact is high \\(>
if n <= 1 { // +1
return 1
} else { // +1
return n + Fact(n-1) // +1
return n * Fact(n-1) // +1
}
} // total complexity = 3

Expand Down
2 changes: 1 addition & 1 deletion testdata/src/b/b.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Fact(n int) int {
if n <= 1 { // +1
return 1
} else { // +1
return n + Fact(n-1) // +1
return n * Fact(n-1) // +1
}
} // total complexity = 3

Expand Down

0 comments on commit 6ae0409

Please sign in to comment.