Skip to content

refactor: drop redundant type declarations#210

Merged
StuartFerguson merged 1 commit into
masterfrom
deepsource-autofix-a3aad22b
Sep 22, 2025
Merged

refactor: drop redundant type declarations#210
StuartFerguson merged 1 commit into
masterfrom
deepsource-autofix-a3aad22b

Conversation

@deepsource-autofix

Copy link
Copy Markdown
Contributor

This PR refactors object creation expressions across the codebase to leverage C# 9 target-typed new expressions, removing redundant type declarations when the type is already specified on the left-hand side.

  • Type can be dropped from the declaration's RHS when explicitly mentioned in the LHS: This issue highlighted redundant instantiations where the same type was declared on both sides of variable assignments. The patch replaces these with target-typed new expressions (such as new() or new(args)), streamlining the code and improving readability.

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

This PR refactors object creation expressions across the codebase to leverage C# 9 target-typed new expressions, removing redundant type declarations when the type is already specified on the left-hand side.

- Type can be dropped from the declaration's RHS when explicitly mentioned in the LHS: This issue highlighted redundant instantiations where the same type was declared on both sides of variable assignments. The patch replaces these with target-typed new expressions (such as `new()` or `new(args)`), streamlining the code and improving readability.

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

deepsource-io Bot commented Sep 22, 2025

Copy link
Copy Markdown

Here's the code health analysis summary for commits 24fd392..5fbbc10. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource C# LogoC#❌ Failure
❗ 2 occurences introduced
🎯 83 occurences resolved
View Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗
DeepSource SQL LogoSQL✅ SuccessView Check ↗

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

@StuartFerguson StuartFerguson merged commit e251d66 into master Sep 22, 2025
10 of 11 checks passed
@github-actions github-actions Bot deleted the deepsource-autofix-a3aad22b branch November 22, 2025 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant