nHapiNET / nHapi

nHapi is the .Net port of the original Java project HAPI.
Mozilla Public License 2.0
273 stars 155 forks source link

Fix some static analysis issues #291

Closed PhantomGrazzler closed 2 years ago

PhantomGrazzler commented 2 years ago
github-actions[bot] commented 2 years ago

Unit Test Results

       5 files     111 suites   20s :stopwatch: 1 131 tests 1 054 :heavy_check_mark: 77 :zzz: 0 :x: 2 096 runs  2 014 :heavy_check_mark: 82 :zzz: 0 :x:

Results for commit 39569024.

github-actions[bot] commented 2 years ago

Unit Test Results

       5 files     111 suites   24s :stopwatch: 1 131 tests 1 054 :heavy_check_mark: 77 :zzz: 0 :x: 2 096 runs  2 014 :heavy_check_mark: 82 :zzz: 0 :x:

Results for commit 8cf9cf57.

PhantomGrazzler commented 2 years ago

@PhantomGrazzler are these all static code analysis changes? Are we sure these fields only get set at construction time?

Yes, these are all static analysis changes that I saw on Codacy (https://app.codacy.com/gh/nHapiNET/nHapi/pullRequest?prid=9304251).

My understanding of the readonly keyword (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly) is that the code would fail to compile if there is an attempt to assign to these fields outside of constructor or field declaration. It is entirely possible that my understanding is flawed though :)

milkshakeuk commented 2 years ago

@PhantomGrazzler okay cool, makes sense.

milkshakeuk commented 2 years ago

@PhantomGrazzler thanks for the PR.