| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Drop redundant null checks that the analyzer reports as constantly false: - MemoizingMRUCache.InvalidateAll: oldEntries is guaranteed assigned on the only path that exits the lock without returning, so `oldEntries is null` is always false. Declare it non-nullable (satisfying nullable flow) and remove the dead disjunct. - NinjectDependencyResolver UnregisterCurrent/UnregisterAll (x4): the result of kernel.GetBindings(...).ToArray() is never null, so `bindings is null` is always false. Check only the length. Behaviour is unchanged; both projects build clean under -warnaserror.
|
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #1604 +/- ##
==========================================
- Coverage 82.30% 82.23% -0.08%
==========================================
Files 124 124
Lines 7036 7036
Branches 1080 1080
==========================================
- Hits 5791 5786 -5
- Misses 937 940 +3
- Partials 308 310 +2 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What kind of change does this PR introduce?
Bug fix / code-smell cleanup (no behavioural change).
What is the new behavior?
Removes redundant conditions that SonarCloud reports as always evaluating to False:
What is the current behavior?
The code carried redundant x is null checks that the analyzer flagged as always-false (MemoizingMRUCache.cs L268; NinjectDependencyResolver.cs L361, L383, L413, L438) — five Major "Code Smell" maintainability issues.
What might this PR break?
None. Every removed sub-condition was provably unreachable, so behaviour is identical. Public API is unchanged.
Checklist
Additional information
No tests added — the changes are behaviour-preserving removals of dead conditions. Existing suites pass (Ninject 83, MemoizingMRUCache 27/27) and both projects build clean under -warnaserror.