-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect calculation issue with nesting (#14)
* Tests that verifies current recursion logic and reproduces issue * Test for C verifying part of the same issue as for go with nesting * Fix stupid calculation error in go test * Fix expected Kotlin test case after reading cognitive complexity paper * Fix nesting issue, aka the incorrect calculation defect * Minor stylistic changes in function use and init
- Loading branch information
Showing
8 changed files
with
101 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <stdio.h> | ||
|
||
int main() { | ||
int i; | ||
for (i = 0; i < 10; i++) { | ||
if(i == 0) { | ||
printf("Hello there\n") | ||
} | ||
|
||
if(i == 9) { | ||
printf("General Kenobi\n"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import "fmt" | ||
|
||
func main() { | ||
v1 := false | ||
v2 := true | ||
|
||
for { | ||
if v1 { | ||
fmt.Println(v1) | ||
} | ||
|
||
if v2 { | ||
fmt.Println(v2) | ||
} | ||
} | ||
|
||
for {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
func factorial(n int) int { | ||
if n <= 1 { | ||
return 1 | ||
} | ||
|
||
return n * factorial(n - 1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters