Conversation
…gfix/RDMP-362-dupe-list-project-cic
| private CohortIdentificationConfiguration _cic; | ||
| private ProjectCohortIdentificationConfigurationAssociation[] _existingAssociations; | ||
| private ProjectCohortIdentificationConfigurationAssociation _associationToDelete; | ||
| private IBasicActivateItems _activator; |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix the problem, the private field _activator should be declared with the readonly modifier so that it can only be assigned at its declaration or within the constructor, preventing later unintended mutations.
Concretely, in Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandRemoveCohortIdentificationConfigurationProjectAssociation.cs, update the field declaration on line 27 from private IBasicActivateItems _activator; to private readonly IBasicActivateItems _activator;. No other code changes are necessary, because _activator is only assigned in the constructor and read elsewhere. No additional methods, imports, or definitions are required.
| @@ -24,7 +24,7 @@ | ||
| private CohortIdentificationConfiguration _cic; | ||
| private ProjectCohortIdentificationConfigurationAssociation[] _existingAssociations; | ||
| private ProjectCohortIdentificationConfigurationAssociation _associationToDelete; | ||
| private IBasicActivateItems _activator; | ||
| private readonly IBasicActivateItems _activator; | ||
| public ExecuteCommandRemoveCohortIdentificationConfigurationProjectAssociation(IBasicActivateItems activator) : | ||
| base(activator) | ||
| { |
Proposed Change
Remove practically duplicate folders in prioject tree
Type of change
What types of changes does your code introduce? Tick all that apply.
Checklist
By opening this PR, I confirm that I have: