Skip to content

Fix CS9113: Remove unused logger parameters in NetCoreApi examples#647

Closed
berezovskyi wants to merge 1 commit intomainfrom
fix-cs9113-unread-logger-4751829425066312682
Closed

Fix CS9113: Remove unused logger parameters in NetCoreApi examples#647
berezovskyi wants to merge 1 commit intomainfrom
fix-cs9113-unread-logger-4751829425066312682

Conversation

@berezovskyi
Copy link
Member

@berezovskyi berezovskyi commented Mar 14, 2026

This PR addresses the compiler warning CS9113 ("Parameter 'logger' is unread") found across several classes in the OSLC4NetExamples.Server.NetCoreApi project. The ILogger dependencies injected via primary constructors were never used in the bodies of the controllers.

By removing these unused parameters, we eliminate the warnings and slightly simplify the Dependency Injection requirements for these example controllers. dotnet format was run and tests pass.


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

Summary by CodeRabbit

  • Refactor
    • Simplified internal controller initialization across multiple API endpoints. API functionality and behavior remain unchanged.

Removed unused `ILogger` parameters from the primary constructors of `CatalogController`, `ChangeRequestController`, `ResourceController`, and `ServiceProviderController` in the `OSLC4NetExamples.Server.NetCoreApi` project. This resolves multiple instances of compiler warning CS9113 (Parameter is unread).

No new tests were added as this is a simple syntax cleanup. Code was formatted using `dotnet format`.

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 14, 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: 7313c395-53c7-4527-9bf5-1107f220f3b9

📥 Commits

Reviewing files that changed from the base of the PR and between 6658bb3 and 65d9b3c.

📒 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

Removed dependency injection of ILogger parameters from four controller classes in the Examples project. The controllers now use parameterless constructors without explicitly managing logger instances, simplifying class declarations while maintaining existing action method functionality.

Changes

Cohort / File(s) Summary
Base and Abstract Controllers
OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Controllers/Resources/ResourceController.cs, OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Controllers/Resources/ChangeRequestController.cs
Removed ILogger constructor parameters from generic abstract base class and its derived abstract controller. ChangeRequestController no longer passes logger to base ResourceController initialization.
Concrete Controllers
OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Controllers/CatalogController.cs, OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Controllers/ServiceProviderController.cs
Removed ILogger dependency injection from primary constructor parameters. Both controllers now declare parameterless constructors without logger management.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Loggers once did flow with care,
Through constructors everywhere,
Now they're stripped away so clean,
Simplest code I've ever seen!
Controllers light, the way is clear,

🚥 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 describes the main change: removing unused logger parameters from NetCoreApi 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-cs9113-unread-logger-4751829425066312682
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #647   +/-   ##
=======================================
  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