Skip to content

Fix CS9113: Remove unused logger parameters in controllers#638

Closed
berezovskyi wants to merge 1 commit intomainfrom
fix/remove-unused-logger-parameters-5173446060881866056
Closed

Fix CS9113: Remove unused logger parameters in controllers#638
berezovskyi wants to merge 1 commit intomainfrom
fix/remove-unused-logger-parameters-5173446060881866056

Conversation

@berezovskyi
Copy link
Member

@berezovskyi berezovskyi commented Mar 7, 2026

This pull request removes unused ILogger parameter injections in various controllers to resolve the CS9113 compiler warnings.

The following files were modified:

  • OSLC4NetExamples.Server.NetCoreApi/Controllers/ServiceProviderController.cs
  • OSLC4NetExamples.Server.NetCoreApi/Controllers/CatalogController.cs
  • OSLC4NetExamples.Server.NetCoreApi/Controllers/Resources/ResourceController.cs
  • OSLC4NetExamples.Server.NetCoreApi/Controllers/Resources/ChangeRequestController.cs

These controllers previously injected ILogger parameters through their primary constructors but never utilized them within the class logic. Their removal fixes the warnings and optimizes DI container resolution slightly by not fetching an unused logging instance.

This change is safe because the parameters were entirely unused and does not alter the actual runtime behaviour of the application. The build and all non-server tests pass successfully without any regressions.


PR created automatically by Jules for task 5173446060881866056 started by @berezovskyi

Summary by CodeRabbit

  • Refactor
    • Simplified internal architecture of multiple API controllers across the SDK examples. No changes to functionality or user-facing features.

Removed the unused ILogger parameters from `ServiceProviderController`, `CatalogController`, and `ResourceController<T>` to eliminate the `CS9113: Parameter 'logger' is unread.` warning. Additionally updated `ChangeRequestController` and the documentation in `CatalogController` to match the changes.

Co-authored-by: berezovskyi <64734+berezovskyi@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4892abf5-7d7e-48d8-8bfb-bdadfe819b33

📥 Commits

Reviewing files that changed from the base of the PR and between 6658bb3 and 5c45bcc.

📒 Files selected for processing (4)
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Controllers/CatalogController.cs
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Controllers/Resources/ChangeRequestController.cs
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Controllers/Resources/ResourceController.cs
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Controllers/ServiceProviderController.cs

Walkthrough

Four ASP.NET Core controller classes have their constructor-based logger dependency injection removed, converting them from parameterized constructors to parameterless declarations. Method implementations and public endpoint behavior remain unchanged.

Changes

Cohort / File(s) Summary
Logger Dependency Injection Removal
Controllers/CatalogController.cs, Controllers/Resources/ChangeRequestController.cs, Controllers/Resources/ResourceController.cs, Controllers/ServiceProviderController.cs
Removed ILogger<T> constructor parameters from all controller class declarations. No changes to method implementations or control flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Logger parameters flee with a hop,
Controllers now simpler, the injections all stop,
Four classes made cleaner, no loggers to pass,
Our codebase hops lighter—a refactor with class!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: removing unused logger parameters from controllers to fix CS9113 compiler warnings.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/remove-unused-logger-parameters-5173446060881866056

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.86%. Comparing base (6658bb3) to head (5c45bcc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #638   +/-   ##
=======================================
  Coverage   50.86%   50.86%           
=======================================
  Files         174      174           
  Lines       10202    10202           
  Branches     1010     1010           
=======================================
  Hits         5189     5189           
  Misses       4756     4756           
  Partials      257      257           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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