Skip to content

Conversation

@deepsource-autofix
Copy link
Contributor

This PR refactors object instantiations to leverage C# target-typed new expressions, removing redundant type names on the RHS when the type is already declared on the LHS.

  • Type can be dropped from the declaration's RHS when explicitly mentioned in the LHS: Many instantiations across the codebase used the verbose new TypeName(...) syntax even though the variable type was obvious from the left-hand side. All such occurrences—ranging from dictionaries and resolvers to domain events, factories, mocks, repositories, and unit-test setups—have been updated to the concise new(...) form. This reduces boilerplate, improves readability, and aligns the code with modern C# best practices.

This Autofix was generated by AI. Please review the change before merging.

This PR refactors object instantiations to leverage C# target-typed new expressions, removing redundant type names on the RHS when the type is already declared on the LHS.

- Type can be dropped from the declaration's RHS when explicitly mentioned in the LHS: Many instantiations across the codebase used the verbose `new TypeName(...)` syntax even though the variable type was obvious from the left-hand side. All such occurrences—ranging from dictionaries and resolvers to domain events, factories, mocks, repositories, and unit-test setups—have been updated to the concise `new(...)` form. This reduces boilerplate, improves readability, and aligns the code with modern C# best practices.

> This Autofix was generated by AI. Please review the change before merging.
@deepsource-io
Copy link

deepsource-io bot commented Sep 19, 2025

Here's the code health analysis summary for commits 8b7949b..0b32713. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource SQL LogoSQL✅ SuccessView Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource C# LogoC#✅ Success
🎯 58 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

StuartFerguson and others added 2 commits September 19, 2025 08:30
This PR removes unused mock variable declarations across multiple test methods to eliminate compiler warnings and improve code clarity.

- Variable is declared but not used: Several mock variables (e.g., Mock<IApplicationBuilder> appBuilder and Mock<IDomainEventHandlerResolver> deh) were declared but never utilized in the tests, leading to compiler warnings and unnecessary code bloat. We removed these unused declarations from all affected test methods, consolidating only the necessary mocks. This cleanup streamlines the test setup, reduces noise, and enhances maintainability.

> This Autofix was generated by AI. Please review the change before merging.
@StuartFerguson StuartFerguson merged commit e3363a3 into master Sep 19, 2025
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants