Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24 bugs in ParallelMonteCarloSimulation.cs #79

Closed
lmalenfant opened this issue Aug 3, 2023 · 3 comments · Fixed by #95
Closed

24 bugs in ParallelMonteCarloSimulation.cs #79

lmalenfant opened this issue Aug 3, 2023 · 3 comments · Fixed by #95
Assignees

Comments

@lmalenfant
Copy link
Member

Describe the bug
In the file ParallelMonteCarloSimulation.cs 'listOfMeans.FirstOrDefault()' is null on at least one execution path. There are 24 instances of this bug identified by SonarCloud in this file.

Application (VTS code):

To Reproduce
The link to the issues is here:
https://sonarcloud.io/project/issues?resolved=false&types=BUG&id=VirtualPhotonics_VTS&open=AYmYDtRnMpwhnU9-85fg

Expected behavior
Avoid the code throwing a NullReferenceException unexpectedly.

Additional context
The resolution and why this is an issue is detailed on SonarCloud at the link above.

@lmalenfant
Copy link
Member Author

@hayakawa16 I assigned this one to you because you mentioned that you would like to fix this but let me know if you need any assistance.

@lmalenfant
Copy link
Member Author

lmalenfant commented Aug 28, 2023

I ran SonarCloud on the branch and the bugs are still there, there are 28 bugs now though, possibly these were already present but not detected.
https://sonarcloud.io/project/issues?resolved=false&types=BUG&id=VirtualPhotonics_VTS

I looked at the code because with SonarLint, I can see this issue in Visual Studio but I cannot figure out how to fix it. Maybe we should look at this together when we have some time.

Here is the sonar rule:
https://rules.sonarsource.com/csharp/RSPEC-2259/

@hayakawa16
Copy link
Member

All looks great by me!

@lmalenfant lmalenfant linked a pull request Sep 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants