Skip to content

PR 3: chore(quality): mechanical analyzer-driven cleanup (453 files)#176

Open
rlorenzo wants to merge 8 commits into
mainfrom
quality/analyzer-bulk-cleanup
Open

PR 3: chore(quality): mechanical analyzer-driven cleanup (453 files)#176
rlorenzo wants to merge 8 commits into
mainfrom
quality/analyzer-bulk-cleanup

Conversation

@rlorenzo
Copy link
Copy Markdown
Contributor

@rlorenzo rlorenzo commented May 5, 2026

Summary

Part 3 of 6. Stacks on top of PR #175. This is the elephant — 453 files changed, but they're almost all mechanical, tool-applied rewrites with no behavior change.

⚠️ Review note: do not attempt line-by-line review. Review the rule set (each commit's message describes the analyzer rule it applies) plus a few spot-check files per category. The bulk of the diff is in web/Models/{RAPS,AAUD,VIPER,Courses,CTS} — generated/scaffolded EF entity classes.

Commits (each is one analyzer rule's bulk fix)

Commit Rule Files
optimize using directives ReSharper unused/sorted usings ~80
shorten reference qualifiers Namespace.Type → imported Type ~89
remove dead null-checks CA1508 dataflow analysis ~11
clean up stale XML doc comments XML doc cleanup ~22
materialize IEnumerable ReSharper PossibleMultipleEnumeration ~8
remove code redundancies jb cleanupcode --profile=RemoveRedundancies ~368
clear ReSharper PR-gate + CodeQL review findings gate residue, real fixes ~14
discard unused entry param follow-up 1

Why bundled

Splitting these by area would create artificial PRs that the reviewer still couldn't read line-by-line. They share the same review style — "trust the tool, spot-check the result" — so they're better together.

Conflict resolution notes

Two cherry-pick conflicts hit because later refactors (in PR #5/#6) modified files this PR also touches:

  • web/Areas/CMS/Data/Codecs.cs (refactored later in PR 6) — applied just the System.IO.StreamStream qualifier shortening to the pre-refactor file.
  • web/Areas/Students/Services/StudentGroupService.cs (refactored later in PR 6) — applied just the id => id != null!string.IsNullOrEmpty(id) and SqlException qualifier fixes; skipped the sealed record change which targets a record introduced by the PR 6 refactor.
  • web/Areas/Effort/Services/EvaluationReportService.cs: skipped — the materialize IEnumerable fix targets CalculateWeightedAverage, a helper that gets introduced by PR 5. The fix is moved into PR 5 atop that extraction.

PR stack

Test plan

  • CI green
  • npm run verify:build succeeds locally
  • npm run test passes
  • Spot check 5-10 EF model files to confirm changes are limited to using directives / qualifier shortening / redundant defaults

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Too many files!

This PR contains 300 files, which is 150 over the limit of 150.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc3301ed-9318-42fe-8130-d7de86c2470c

📥 Commits

Reviewing files that changed from the base of the PR and between 858333b and 918ce04.

📒 Files selected for processing (300)
  • Viper.sln.DotSettings
  • scripts/audit-resharper-regression.js
  • test/AsyncQueryable.cs
  • test/CTS/AssessmentControllerTest.cs
  • test/CTS/CompetencyBundleAssociationControllerTest.cs
  • test/CTS/SetupAssessments.cs
  • test/CTS/SetupPeople.cs
  • test/Classes/ApiResponseAttributeTests.cs
  • test/Classes/CustomAntiforgeryFilterTests.cs
  • test/ClinicalScheduler/ClinicalSchedulerContextTest.cs
  • test/ClinicalScheduler/ClinicalSchedulerTestBase.cs
  • test/ClinicalScheduler/EmailNotificationTest.cs
  • test/ClinicalScheduler/GradYearServiceTest.cs
  • test/ClinicalScheduler/InstructorScheduleControllerTest.cs
  • test/ClinicalScheduler/Integration/ControllerServiceIntegrationTest.cs
  • test/ClinicalScheduler/Integration/ServiceLayerIntegrationTest.cs
  • test/ClinicalScheduler/IntegrationTestBase.cs
  • test/ClinicalScheduler/PermissionsControllerTest.cs
  • test/ClinicalScheduler/PersonServiceTest.cs
  • test/ClinicalScheduler/RotationServiceTest.cs
  • test/ClinicalScheduler/RotationsControllerTest.cs
  • test/ClinicalScheduler/ScheduleAuditServiceTest.cs
  • test/ClinicalScheduler/ScheduleEditServiceTest.cs
  • test/ClinicalScheduler/SchedulePermissionServiceTest.cs
  • test/ClinicalScheduler/TestDataBuilder.cs
  • test/ClinicalScheduler/TestableScheduleEditService.cs
  • test/ClinicalScheduler/WeekServiceTest.cs
  • test/Effort/ClinicalImportServiceTests.cs
  • test/Effort/CourseRelationshipsControllerTests.cs
  • test/Effort/EffortIntegrationTestBase.cs
  • test/Effort/EffortRecordServiceTests.cs
  • test/Effort/HarvestServiceTests.cs
  • test/Effort/InstructorServiceTests.cs
  • test/Effort/InstructorsControllerTests.cs
  • test/Effort/PercentRolloverServiceTests.cs
  • test/Effort/PercentageServiceTests.cs
  • test/Effort/ReportsControllerTests.cs
  • test/Effort/TermServiceTests.cs
  • test/Effort/VerificationServiceTests.cs
  • test/RAPS/RolesTests.cs
  • test/RAPS/SetupRoles.cs
  • test/Services/EmailServiceTests.cs
  • test/Students/EmergencyContactControllerTests.cs
  • test/Students/EmergencyContactServiceTests.cs
  • test/Students/PhotoGalleryControllerTest.cs
  • test/Students/PhotoServiceTest.cs
  • web/Areas/CMS/Controllers/CMSContentController.cs
  • web/Areas/CMS/Controllers/CMSController.cs
  • web/Areas/CMS/Data/CMS.cs
  • web/Areas/CMS/Data/Codecs.cs
  • web/Areas/CMS/Models/CMSFile.cs
  • web/Areas/CMS/Models/Link.cs
  • web/Areas/CMS/Models/LinkCollection.cs
  • web/Areas/CMS/Models/LinkCollectionTagCategory.cs
  • web/Areas/CMS/Models/LinkTag.cs
  • web/Areas/CMS/Services/CmsNavMenu.cs
  • web/Areas/CMS/Validation/SafeUrlAttribute.cs
  • web/Areas/CTS/Controllers/AssessmentController.cs
  • web/Areas/CTS/Controllers/BundleCompetencyController.cs
  • web/Areas/CTS/Controllers/BundleCompetencyGroupController.cs
  • web/Areas/CTS/Controllers/BundleController.cs
  • web/Areas/CTS/Controllers/CTSController.cs
  • web/Areas/CTS/Controllers/ClinicalScheduleController.cs
  • web/Areas/CTS/Controllers/CompetencyBundleAssociationController.cs
  • web/Areas/CTS/Controllers/CompetencyController.cs
  • web/Areas/CTS/Controllers/CourseController.cs
  • web/Areas/CTS/Controllers/DomainController.cs
  • web/Areas/CTS/Controllers/EpaController.cs
  • web/Areas/CTS/Controllers/LegacyCompetenciesController.cs
  • web/Areas/CTS/Controllers/LevelsController.cs
  • web/Areas/CTS/Controllers/MilestonesController.cs
  • web/Areas/CTS/Models/Epa.cs
  • web/Areas/CTS/Models/StudentEpaAssessment.cs
  • web/Areas/CTS/Services/AuditService.cs
  • web/Areas/CTS/Services/CrestCourseService.cs
  • web/Areas/CTS/Services/CtsNavMenu.cs
  • web/Areas/CTS/Services/CtsSecurityService.cs
  • web/Areas/CTS/Services/EncounterCreationService.cs
  • web/Areas/ClinicalScheduler/Controllers/BaseClinicalSchedulerController.cs
  • web/Areas/ClinicalScheduler/Controllers/CliniciansController.cs
  • web/Areas/ClinicalScheduler/Controllers/InstructorScheduleController.cs
  • web/Areas/ClinicalScheduler/Controllers/PermissionsController.cs
  • web/Areas/ClinicalScheduler/Controllers/RotationsController.cs
  • web/Areas/ClinicalScheduler/Extensions/InstructorScheduleMappingExtensions.cs
  • web/Areas/ClinicalScheduler/Services/BaseClinicalSchedulerService.cs
  • web/Areas/ClinicalScheduler/Services/ClinicalSchedulerNavMenu.cs
  • web/Areas/ClinicalScheduler/Services/EvaluationPolicyService.cs
  • web/Areas/ClinicalScheduler/Services/InstructorScheduleService.cs
  • web/Areas/ClinicalScheduler/Services/PermissionValidator.cs
  • web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs
  • web/Areas/ClinicalScheduler/Services/ScheduleEditService.cs
  • web/Areas/ClinicalScheduler/Services/SchedulePermissionService.cs
  • web/Areas/Computing/Controllers/PersonController.cs
  • web/Areas/Computing/Services/BiorenderStudentLookup.cs
  • web/Areas/Directory/Controllers/DirectoryController.cs
  • web/Areas/Directory/Models/IndividualSearchResult.cs
  • web/Areas/Directory/Models/IndividualSearchResultCreator.cs
  • web/Areas/Directory/Models/IndividualSearchResultWithIDs.cs
  • web/Areas/Directory/Models/LdapUserContact.cs
  • web/Areas/Directory/Services/VMACSService.cs
  • web/Areas/Effort/Controllers/ClinicalImportController.cs
  • web/Areas/Effort/Controllers/CoursesController.cs
  • web/Areas/Effort/Controllers/CoursesSelfServiceController.cs
  • web/Areas/Effort/Controllers/HarvestController.cs
  • web/Areas/Effort/Controllers/InstructorsController.cs
  • web/Areas/Effort/Controllers/PercentRolloverController.cs
  • web/Areas/Effort/Models/DTOs/Responses/ClinicalImportDto.cs
  • web/Areas/Effort/Services/BaseReportService.cs
  • web/Areas/Effort/Services/ClinicalEffortService.cs
  • web/Areas/Effort/Services/ClinicalImportService.cs
  • web/Areas/Effort/Services/ClinicalScheduleService.cs
  • web/Areas/Effort/Services/CourseRelationshipService.cs
  • web/Areas/Effort/Services/CourseService.cs
  • web/Areas/Effort/Services/DashboardService.cs
  • web/Areas/Effort/Services/EffortRecordService.cs
  • web/Areas/Effort/Services/EvalHarvestService.cs
  • web/Areas/Effort/Services/EvaluationReportService.cs
  • web/Areas/Effort/Services/Harvest/CrestHarvestPhase.cs
  • web/Areas/Effort/Services/Harvest/NonCrestHarvestPhase.cs
  • web/Areas/Effort/Services/HarvestService.cs
  • web/Areas/Effort/Services/IHarvestService.cs
  • web/Areas/Effort/Services/InstructorService.cs
  • web/Areas/Effort/Services/MeritMultiYearService.cs
  • web/Areas/Effort/Services/MeritReportService.cs
  • web/Areas/Effort/Services/MeritSummaryService.cs
  • web/Areas/Effort/Services/PercentageService.cs
  • web/Areas/Effort/Services/RCourseService.cs
  • web/Areas/Effort/Services/TermService.cs
  • web/Areas/Effort/Services/VerificationService.cs
  • web/Areas/RAPS/Controllers/AdGroupRolesController.cs
  • web/Areas/RAPS/Controllers/AdGroupsController.cs
  • web/Areas/RAPS/Controllers/AuditController.cs
  • web/Areas/RAPS/Controllers/MemberPermissionsController.cs
  • web/Areas/RAPS/Controllers/MembersController.cs
  • web/Areas/RAPS/Controllers/PermissionsController.cs
  • web/Areas/RAPS/Controllers/RAPSController.cs
  • web/Areas/RAPS/Controllers/RoleMembersController.cs
  • web/Areas/RAPS/Controllers/RolePermissionsController.cs
  • web/Areas/RAPS/Controllers/RoleTemplatesController.cs
  • web/Areas/RAPS/Controllers/RolesController.cs
  • web/Areas/RAPS/Models/LdapGroup.cs
  • web/Areas/RAPS/Models/LdapUser.cs
  • web/Areas/RAPS/Models/MemberPermissionCreateUpdate.cs
  • web/Areas/RAPS/Models/PermissionClone.cs
  • web/Areas/RAPS/Models/RoleMemberCreateUpdate.cs
  • web/Areas/RAPS/Models/RolePermissionComparison.cs
  • web/Areas/RAPS/Models/RoleTemplateSimplified.cs
  • web/Areas/RAPS/Services/CloneService.cs
  • web/Areas/RAPS/Services/OuGroupService.cs
  • web/Areas/RAPS/Services/RAPSAuditService.cs
  • web/Areas/RAPS/Services/RAPSSecurityService.cs
  • web/Areas/RAPS/Services/RoleViews.cs
  • web/Areas/RAPS/Services/UinformService.cs
  • web/Areas/RAPS/Services/VMACSExport.cs
  • web/Areas/Students/Controllers/DvmController.cs
  • web/Areas/Students/Controllers/PhotoGalleryController.cs
  • web/Areas/Students/Services/CourseService.cs
  • web/Areas/Students/Services/EmergencyContactExportService.cs
  • web/Areas/Students/Services/EmergencyContactService.cs
  • web/Areas/Students/Services/GradYearClassLevel.cs
  • web/Areas/Students/Services/PhotoExportService.cs
  • web/Areas/Students/Services/PhotoService.cs
  • web/Areas/Students/Services/StudentGroupService.cs
  • web/Areas/Students/Services/StudentList.cs
  • web/Classes/ApiController.cs
  • web/Classes/ApiExceptionFilterAttribute.cs
  • web/Classes/ApiPaginatedResponse.cs
  • web/Classes/ApiPaginationAttribute.cs
  • web/Classes/ApiResponseAttribute.cs
  • web/Classes/ApiSessionUpdateFilter.cs
  • web/Classes/AreaController.cs
  • web/Classes/ClaimsTransformer.cs
  • web/Classes/ClientIpRestrictionsAttribute.cs
  • web/Classes/CorrelationIdMiddleware.cs
  • web/Classes/CustomAntiforgeryFilter.cs
  • web/Classes/DuoAuthenticationRequirement.cs
  • web/Classes/HttpHelper.cs
  • web/Classes/NavMenuItem.cs
  • web/Classes/PermissionAttribute .cs
  • web/Classes/RestrictToLocalhostAttribute.cs
  • web/Classes/SQLContext/VIPERContext.cs
  • web/Classes/SearchAttributes.cs
  • web/Classes/SitemapMiddleware.cs
  • web/Classes/UserHelper.cs
  • web/Classes/Utilities/ActiveDirectoryService.cs
  • web/Classes/Utilities/F5HttpRequest.cs
  • web/Classes/Utilities/IamApi.cs
  • web/Classes/Utilities/LdapService.cs
  • web/Classes/Utilities/SessionTimeoutService.cs
  • web/Controllers/HomeController.cs
  • web/Controllers/LayoutController.cs
  • web/Models/AAUD/AaudOverride.cs
  • web/Models/AAUD/AaudOverrideJob.cs
  • web/Models/AAUD/AaudUser.cs
  • web/Models/AAUD/Clicker.cs
  • web/Models/AAUD/DlEmployee.cs
  • web/Models/AAUD/DlFlag.cs
  • web/Models/AAUD/DlGradEmployee.cs
  • web/Models/AAUD/DlGradFlag.cs
  • web/Models/AAUD/DlGradId.cs
  • web/Models/AAUD/DlGradPerson.cs
  • web/Models/AAUD/DlGradStudent.cs
  • web/Models/AAUD/DlId.cs
  • web/Models/AAUD/DlJob.cs
  • web/Models/AAUD/DlPerson.cs
  • web/Models/AAUD/DlStudent.cs
  • web/Models/AAUD/DlUnexPerson.cs
  • web/Models/AAUD/DlUnexRoster.cs
  • web/Models/AAUD/Employee.cs
  • web/Models/AAUD/ExceptionDeactivate.cs
  • web/Models/AAUD/Exceptionemployee.cs
  • web/Models/AAUD/Exceptionflag.cs
  • web/Models/AAUD/Exceptionid.cs
  • web/Models/AAUD/Exceptionperson.cs
  • web/Models/AAUD/Exceptionstudent.cs
  • web/Models/AAUD/ExternalId.cs
  • web/Models/AAUD/FakeEmployee.cs
  • web/Models/AAUD/FakeFlag.cs
  • web/Models/AAUD/FakeId.cs
  • web/Models/AAUD/FakePerson.cs
  • web/Models/AAUD/Flag.cs
  • web/Models/AAUD/HelpDeskUser.cs
  • web/Models/AAUD/Id.cs
  • web/Models/AAUD/Job.cs
  • web/Models/AAUD/Ldap.cs
  • web/Models/AAUD/LdapDepartment.cs
  • web/Models/AAUD/LdapFacilityLink.cs
  • web/Models/AAUD/NewEmployeeNotification.cs
  • web/Models/AAUD/NightlyJob.cs
  • web/Models/AAUD/Person.cs
  • web/Models/AAUD/Relationship.cs
  • web/Models/AAUD/RelationshipType.cs
  • web/Models/AAUD/RelationshipsAudit.cs
  • web/Models/AAUD/Status.cs
  • web/Models/AAUD/Student.cs
  • web/Models/AAUD/Studentgrp.cs
  • web/Models/AAUD/TestEmployee.cs
  • web/Models/AAUD/TestFlag.cs
  • web/Models/AAUD/TestId.cs
  • web/Models/AAUD/TestPerson.cs
  • web/Models/AAUD/TestStudent.cs
  • web/Models/AAUD/UnexPerson.cs
  • web/Models/AAUD/UnexRoster.cs
  • web/Models/AAUD/VwAdStaff.cs
  • web/Models/AAUD/VwAdStudent.cs
  • web/Models/AAUD/VwAdTeachingFaculty.cs
  • web/Models/AAUD/VwAdVetstaff.cs
  • web/Models/AAUD/VwAdVmssacscheduler.cs
  • web/Models/AAUD/VwAdconstituent.cs
  • web/Models/AAUD/VwCurrentAffiliate.cs
  • web/Models/AAUD/VwCurrentAffiliatesForPf.cs
  • web/Models/AAUD/VwCurrentAffiliatesForPfBk.cs
  • web/Models/AAUD/VwDvmStudent.cs
  • web/Models/AAUD/VwDvmStudentsHistory.cs
  • web/Models/AAUD/VwDvmStudentsMaxTerm.cs
  • web/Models/AAUD/VwDvmStudentsMaxTermBk.cs
  • web/Models/AAUD/VwDvmStudentsMaxTermNew.cs
  • web/Models/AAUD/VwEmployeesForAaud.cs
  • web/Models/AAUD/VwException.cs
  • web/Models/AAUD/VwJobsForAaud.cs
  • web/Models/AAUD/VwMailIdsForStudent.cs
  • web/Models/AAUD/VwPapercutUser.cs
  • web/Models/AAUD/VwPerfectFormsConstituent.cs
  • web/Models/AAUD/VwSftFaculty.cs
  • web/Models/AAUD/VwSpSvmemployee.cs
  • web/Models/AAUD/VwSpSvmperson.cs
  • web/Models/AAUD/VwUConnect.cs
  • web/Models/AAUD/VwUConnectNew.cs
  • web/Models/AAUD/VwUConnectUnit.cs
  • web/Models/AAUD/VwVmthAllEmployesExcludingClinician.cs
  • web/Models/AAUD/VwVmthClinician.cs
  • web/Models/AAUD/VwVmthConstituent.cs
  • web/Models/AAUD/VwVmthStaff.cs
  • web/Models/AAUD/VwVmthStudent.cs
  • web/Models/AAUD/VwVmthStudentsForPerfectForm.cs
  • web/Models/CTS/Bundle.cs
  • web/Models/CTS/BundleCompetency.cs
  • web/Models/CTS/BundleCompetencyGroup.cs
  • web/Models/CTS/BundleCompetencyLevel.cs
  • web/Models/CTS/BundleRole.cs
  • web/Models/CTS/BundleService.cs
  • web/Models/CTS/Competency.cs
  • web/Models/CTS/CompetencyOutcome.cs
  • web/Models/CTS/CourseCompetency.cs
  • web/Models/CTS/CourseRole.cs
  • web/Models/CTS/Domain.cs
  • web/Models/CTS/MilestoneLevel.cs
  • web/Models/CTS/Patient.cs
  • web/Models/CTS/Role.cs
  • web/Models/CTS/SessionCompetency.cs
  • web/Models/CTS/StudentCompetency.cs
  • web/Models/Courses/Baseinfo.cs
  • web/Models/Courses/CurrentAndFutureTermCode.cs
  • web/Models/Courses/CurrentAndFutureTermCodesInCurrentAcademicYear.cs
  • web/Models/Courses/CurrentNonSummerTermCode.cs
  • web/Models/Courses/DlBaseinfo.cs
  • web/Models/Courses/DlGrademode.cs
  • web/Models/Courses/DlPoa.cs
  • web/Models/Courses/DlRoster.cs
  • web/Models/Courses/DlSupportPerson.cs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch quality/analyzer-bulk-cleanup

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.

@rlorenzo rlorenzo force-pushed the quality/analyzer-bulk-cleanup branch from 0d26c81 to 438134a Compare May 5, 2026 07:39
@rlorenzo rlorenzo force-pushed the tools/codeql-roslyn-sonar-resharper branch 2 times, most recently from 078b830 to ccde16a Compare May 5, 2026 14:47
@rlorenzo rlorenzo force-pushed the quality/analyzer-bulk-cleanup branch from 438134a to 11799f3 Compare May 5, 2026 14:47
Base automatically changed from tools/codeql-roslyn-sonar-resharper to main May 5, 2026 23:40
@rlorenzo rlorenzo force-pushed the quality/analyzer-bulk-cleanup branch from 11799f3 to 2580a27 Compare May 7, 2026 13:59
@codecov-commenter
Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2026

Codecov Report

❌ Patch coverage is 15.61866% with 416 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.01%. Comparing base (4678e73) to head (918ce04).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
web/Areas/RAPS/Controllers/RAPSController.cs 0.00% 34 Missing ⚠️
web/Areas/Students/Services/PhotoExportService.cs 0.00% 30 Missing ⚠️
web/Controllers/LayoutController.cs 0.00% 21 Missing ⚠️
web/Areas/CTS/Services/CtsNavMenu.cs 0.00% 20 Missing ⚠️
web/Areas/CMS/Data/CMS.cs 0.00% 18 Missing ⚠️
web/Areas/Students/Services/StudentGroupService.cs 0.00% 16 Missing ⚠️
...b/Areas/Directory/Models/IndividualSearchResult.cs 0.00% 15 Missing ⚠️
web/Areas/RAPS/Services/OuGroupService.cs 0.00% 15 Missing ⚠️
web/Classes/Utilities/IamApi.cs 0.00% 15 Missing ⚠️
web/Areas/RAPS/Services/VMACSExport.cs 0.00% 14 Missing ⚠️
... and 86 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
+ Coverage   42.95%   43.01%   +0.05%     
==========================================
  Files         876      876              
  Lines       51454    51399      -55     
  Branches     4802     4808       +6     
==========================================
+ Hits        22101    22108       +7     
+ Misses      28829    28767      -62     
  Partials      524      524              
Flag Coverage Δ
backend 43.09% <15.61%> (+0.06%) ⬆️
frontend 41.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@rlorenzo rlorenzo requested a review from Copilot May 7, 2026 14:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Comment thread web/Program.cs Fixed
Comment thread web/Program.cs Fixed
@rlorenzo rlorenzo force-pushed the quality/analyzer-bulk-cleanup branch 2 times, most recently from 6b500eb to f9e9c1a Compare May 7, 2026 15:57
rlorenzo added 6 commits May 8, 2026 22:14
- Bulk-applied via `jb cleanupcode --profile=OptimizeUsings` then
  `dotnet format`. Removes unused usings and sorts/groups remaining
  ones — compiler-equivalent, no behavior change.
- Adds Viper.sln.DotSettings with OptimizeUsings, ShortenReferences,
  and RemoveRedundancies profiles for this and follow-up PRs.
- Reproduction note: cleanupcode deadlocks on MSBuild's shared
  compiler server while the dev server runs; set
  DOTNET_USE_COMPILER_SERVER=0 to bypass.
- Bulk-applied via `jb cleanupcode --profile=ShortenReferences` then
  `dotnet format`. Replaces inline `Namespace.Type` with imported
  `Type` (or `using Alias = Namespace.Type;` for ambiguous names).
  Compiler-equivalent — no behavior change.
- PhotoExportService.cs gets the largest single diff because it
  juggles four DocumentFormat.OpenXml sub-namespaces with conflicting
  type names (`Picture`, `Paragraph`, `Run`, etc.); aliases at the
  top replace the inline full qualifiers throughout.
- Drop dead `?.` and `!= null` guards in 10 files where the analyzer
  proves the value is non-null (DI-injected helpers, catch
  parameters, values guaranteed by preceding null-checks).
- ViteProxyHelpers.cs: suppress CA1508 with `#pragma warning disable`
  on the inner check of a double-checked locking pattern. The outer
  guard may have raced; CA1508's dataflow analysis doesn't model
  thread interleaving, so this is a known false positive.
- Strip empty `<param name="X"></param>` tags whose corresponding
  parameter doesn't exist (or where the tag adds no doc value).
  Removes ~24 InvalidXmlDocComment findings.
- Fix malformed XML: escape literal `<T>` as `&lt;T&gt;` in three
  doc comments (HttpHelper, IamApi, UinformService); promote two
  `// <summary>` typos in IamApi to `///`; demote orphan `///`
  block on Program.cs SetAwsCredentials (top-level local function
  doesn't accept doc comments) to plain comment.
- Rename three orphan `<param>` tags to match real parameters
  (UserHelper.HasPermission, RAPSSecurityService.IsAllowedTo,
  VMACSExport.ExportToInstances).

Partial-coverage cases (methods with descriptive `<param>` tags
for some but not all parameters) intentionally left alone — their
existing documentation has real value, and selectively adding
empty tags or deleting good ones would be a net loss.
Fixes the 29 PossibleMultipleEnumeration findings flagged by ReSharper.
Each call site enumerated an IEnumerable two-or-more times (e.g.,
`source.Any()` then `source.First()`, or `source.Sum(a)` then
`source.Sum(b)`). Materialising once with `.ToList()` is semantically
equivalent and avoids re-evaluating deferred queries.

- Test files: cast assertion targets to lists so xUnit's `Assert.NotEmpty`
  + `Assert.Equal(N, x.Count())` doesn't iterate twice.
- VueTableDefault.cs: `data`, `skipColumns`, `altColumnNames` are
  enumerated 3+ times per helper and 3 times across helpers from
  `InvokeAsync`. Materialise at both layers.
- EvaluationPolicyService.IsRequiredFor*: `rotationWeeks` is enumerated
  by `.Any()`, `.FirstOrDefault(currentWeek)`, and `.FirstOrDefault(nextWeek)`.
  Materialise at top of method.
- CMSContentController.GetContentBlockByFn: switch `Any()/First()`
  to `Count == 0` / indexer.
- CliniciansController.FilterCliniciansByPermissions: rename param to
  `cliniciansSource`, materialise once into `clinicians`.
- Smaller fixes in RotationsController, EvaluationReportService.
- Bulk-applied via `jb cleanupcode --profile=RemoveRedundancies`
  then `dotnet format`. Removes redundant argument default values,
  redundant member initializers, redundant `else` after `return`,
  redundant anonymous-type property names, and other rewrites in
  the ReSharper "Remove code redundancies" category — all
  compiler-equivalent, no behavior change.
- Updates `Viper.sln.DotSettings`: the umbrella
  `<CSRemoveCodeRedundancies>` flag alone is a no-op. ReSharper
  also requires the (sparsely-documented) sibling
  `<RemoveCodeRedundancies>` flag plus per-rule sub-flags
  (`<CSRemoveRedundantArgumentDefaultValues>`,
  `<CSRemoveRedundantInitializers>`) to actually trigger the
  rewrites.
- Fixes a minor follow-up: `CliniciansController.cs:569` was
  changed to `clinicians.Count` (List property) from
  `clinicians.Count()` (LINQ). The IEnumerable to List
  materialisation in `9823a4c9` made `clinicians` a List, which
  Sonar S2971 then flagged as preferring the property. No new
  lint rule violations introduced by this commit.
@rlorenzo rlorenzo force-pushed the quality/analyzer-bulk-cleanup branch 2 times, most recently from 55cbcab to 7f36555 Compare May 9, 2026 17:19
rlorenzo added 2 commits May 11, 2026 09:27
- Real cleanups across CMS / ClinicalScheduler / Effort / RAPS / Students:
  drop dead null-checks Roslyn flow analysis can prove unreachable,
  collapse a duplicated return path, simplify the cache lookup that
  was capturing a never-assigned outer variable, fix the stale XML doc
  param tag left behind by the IEnumerable materialisation rename,
  remove a virtual call from a DTO constructor, and split a SqlCommand
  object initializer outside the using statement.
- Replace anonymous-type byte[]? gymnastics in PhotoExportService with
  a named record so CodeQL stops flagging the casts as redundant.
- Gate now supports `--exclude-rule` and ships defaults for rules that
  fire false positives on ASP.NET Core / EF surfaces (DTO accessors
  bound at runtime by JSON / MVC, record positional properties used
  via record pattern Equals, and the EF nav-property NRT contract that
  Roslyn intentionally distrusts because Include() can be missing).
The UserHelper.GetByLoginId cache populator doesn't need the
ICacheEntry parameter; using `_` silences the new ReSharper
UnusedParameter.Local finding the previous commit introduced
when it collapsed the closure.
@rlorenzo rlorenzo force-pushed the quality/analyzer-bulk-cleanup branch from 7f36555 to 918ce04 Compare May 11, 2026 16:28
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.

4 participants