Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase <AnalysisMode> from Minimum to Recommended #2111

Closed
15 of 18 tasks
imnasnainaec opened this issue May 3, 2023 · 2 comments · Fixed by #2339
Closed
15 of 18 tasks

Increase <AnalysisMode> from Minimum to Recommended #2111

imnasnainaec opened this issue May 3, 2023 · 2 comments · Fixed by #2339
Labels
backend maintenance Issue that makes it difficult to maintain the software or to upgrade installations post-release.

Comments

@imnasnainaec imnasnainaec added backend maintenance Issue that makes it difficult to maintain the software or to upgrade installations post-release. labels May 3, 2023
@imnasnainaec
Copy link
Collaborator Author

Here's a sampling of the Backend errors:

Backend/Helper/FileStorage.cs(27,22): error CA2229: Add a constructor to HomeFolderNotFoundException with the following signature: 'protected HomeFolderNotFoundException(SerializationInfo info, StreamingContext context)'. 
Backend/Services/LiftService.cs(81,18): error CA2229: Add a constructor to MissingProjectException with the following signature: 'protected MissingProjectException(SerializationInfo info, StreamingContext context)'. 
Backend/Services/MergeService.cs(221,22): error CA2229: Add a constructor to InvalidBlacklistEntryException with the following signature: 'protected InvalidBlacklistEntryException(SerializationInfo info, StreamingContext context)'. 
Backend/Services/PermissionService.cs(239,22): error CA2229: Add a constructor to InvalidJwtTokenException with the following signature: 'protected InvalidJwtTokenException(SerializationInfo info, StreamingContext context)'. 
Backend/Models/SemanticDomain.cs(19,23): error CA1720: Identifier 'Guid' contains type name 
Backend/Models/UserRole.cs(75,17): error CA1711: Rename type name Permission so that it does not end in 'Permission' 
Backend/Models/UserEdit.cs(117,21): error CA1720: Identifier 'Guid' contains type name 
Backend/Models/Word.cs(345,21): error CA1720: Identifier 'Guid' contains type name 
Backend/Interfaces/IBannerRepository.cs(9,22): error CA1716: Rename virtual/interface member IBannerRepository.Get(BannerType) so that it no longer conflicts with the reserved language keyword 'Get'. Using a reserved keyword as the name of a virtual/interface member makes it harder for consumers in other languages to override/implement the member. 
Backend/Interfaces/IMergeBlacklistRepository.cs(11,36): error CA1716: Rename virtual/interface member IMergeBlacklistRepository.Get(string, string) so that it no longer conflicts with the reserved language keyword 'Get'. Using a reserved keyword as the name of a virtual/interface member makes it harder for consumers in other languages to override/implement the member. 
Backend/Helper/LiftHelper.cs(17,48): error CA1309: Use ordinal string comparison 
Backend/Helper/LiftHelper.cs(28,41): error CA1310: The behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings. Replace this call in 'BackendFramework.Helper.LiftHelper.IsProtected(SIL.Lift.Parsing.LiftSense)' with a call to 'string.StartsWith(string, System.StringComparison)'. 
Backend/Startup.cs(161,40): error CA1305: The behavior of 'int.Parse(string)' could vary based on the current user's locale settings. Replace this call in 'Startup.ConfigureServices(IServiceCollection)' with a call to 'int.Parse(string, IFormatProvider)'. 
Backend/Startup.cs(294,17): error CA1848: For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogInformation(ILogger, string?, params object?[])' 
Backend/Controllers/LiftController.cs(173,17): error CA1848: For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogError(ILogger, Exception?, string?, params object?[])' 
Backend/Models/Word.cs(150,34): error CA1309: Use ordinal string comparison 
Backend/Controllers/UserController.cs(44,44): error CA1309: Use ordinal string comparison 
Backend/Controllers/UserController.cs(61,24): error CA1305: The behavior of 'string.Format(string, object, object, object)' could vary based on the current user's locale settings. Replace this call in 'UserController.ResetPasswordRequest(UserController.PasswordResetRequestData)' with a call to 'string.Format(IFormatProvider, string, params object[])'. 
Backend/Models/Banner.cs(55,52): error CA1309: Use ordinal string comparison 
Backend/Models/MergeBlacklistEntry.cs(52,33): error CA1309: Use ordinal string comparison 
Backend/Models/UserRole.cs(54,33): error CA1309: Use ordinal string comparison 
Backend/Services/UserEditService.cs(64,106): error CA1725: In member Task<bool> UserEditService.AddStepToGoal(string projectId, string userEditId, int goalIndex, string newStep), change parameter name newStep to stepString in order to match the identifier as it has been declared in Task<bool> IUserEditService.AddStepToGoal(string projectId, string userEditId, int goalIndex, string stepString) 
Backend/Controllers/UserEditController.cs(158,29): error CA1305: The behavior of 'int.ToString()' could vary based on the current user's locale settings. Replace this call in 'UserEditController.UpdateUserEditGoal(string, string, Edit)' with a call to 'int.ToString(IFormatProvider)'. 
Backend/Models/Project.cs(168,28): error CA1309: Use ordinal string comparison 
Backend/Models/UserEdit.cs(53,33): error CA1309: Use ordinal string comparison 
Backend/Models/SemanticDomain.cs(69,25): error CA1309: Use ordinal string comparison 
Backend/Models/User.cs(139,26): error CA1309: Use ordinal string comparison 
Backend/Services/LiftService.cs(104,48): error CA1725: In member void LiftService.SetExportInProgress(string userId, bool isInProgress = true), change parameter name userId to key in order to match the identifier as it has been declared in void ILiftService.SetExportInProgress(string key, bool isInProgress) 
Backend/Services/LiftService.cs(52,30): error CA2215: Ensure that method 'void CombineLiftWriter.Dispose()' calls 'base.Dispose()' in all possible control flow paths 
Backend/Services/PermissionService.cs(108,33): error CA1310: The behavior of 'string.LastIndexOf(string)' could vary based on the current user's locale settings. Replace this call in 'BackendFramework.Services.PermissionService.HasProjectPermission(Microsoft.AspNetCore.Http.HttpContext, BackendFramework.Models.Permission)' with a call to 'string.LastIndexOf(string, System.StringComparison)'. 
Backend/Services/LiftService.cs(304,27): error CA2201: Exception type System.Exception is not sufficiently specific 
Backend/Services/LiftService.cs(644,29): error CA1310: The behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings. Replace this call in 'BackendFramework.Services.LiftService.LiftMerger.FinishEntry(SIL.Lift.Parsing.LiftEntry)' with a call to 'string.StartsWith(string, System.StringComparison)'.

@imnasnainaec
Copy link
Collaborator Author

Here's a sampling of the Backend.Tests errors:

Backend.Tests/Controllers/BannerControllerTests.cs(10,18): error CA1001: Type 'BannerControllerTests' owns disposable field(s) '_bannerController' but is not disposable 
Backend.Tests/Controllers/AvatarControllerTests.cs(14,18): error CA1001: Type 'AvatarControllerTests' owns disposable field(s) '_avatarController', '_userController' but is not disposable 
Backend.Tests/Controllers/MergeControllerTests.cs(11,18): error CA1001: Type 'MergeControllerTests' owns disposable field(s) '_mergeController' but is not disposable 
Backend.Tests/Controllers/ProjectControllerTests.cs(13,18): error CA1001: Type 'ProjectControllerTests' owns disposable field(s) '_projController' but is not disposable 
Backend.Tests/Controllers/SemanticDomainControllerTests.cs(10,18): error CA1001: Type 'SemanticDomainControllerTests' owns disposable field(s) '_semDomController' but is not disposable 
Backend.Tests/Controllers/AudioControllerTests.cs(13,18): error CA1001: Type 'AudioControllerTests' owns disposable field(s) '_audioController', '_wordController' but is not disposable 
Backend.Tests/Controllers/UserControllerTests.cs(12,18): error CA1001: Type 'UserControllerTests' owns disposable field(s) '_userController' but is not disposable 
Backend.Tests/Controllers/UserRoleControllerTests.cs(12,18): error CA1001: Type 'UserRoleControllerTests' owns disposable field(s) '_userRoleController' but is not disposable 
Backend.Tests/Controllers/LiftControllerTests.cs(22,18): error CA1001: Type 'LiftControllerTests' owns disposable field(s) '_liftController' but is not disposable 
Backend.Tests/Controllers/UserEditControllerTests.cs(16,18): error CA1001: Type 'UserEditControllerTests' owns disposable field(s) '_userEditController' but is not disposable 
Backend.Tests/Controllers/WordControllerTests.cs(14,18): error CA1001: Type 'WordControllerTests' owns disposable field(s) '_wordController' but is not disposable 
Backend.Tests/Controllers/AvatarControllerTests.cs(42,97): error CA2201: Exception type System.Exception is not sufficiently specific 
Backend.Tests/Helper/TimeTests.cs(24,50): error CA1305: The behavior of 'DateTime.Parse(string)' could vary based on the current user's locale settings. Replace this call in 'TimeTests.TestUtcNowIso8601()' with a call to 'DateTime.Parse(string, IFormatProvider)'. 
Backend.Tests/Mocks/UserRepositoryMock.cs(25,43): error CA1725: In member Task<User?> UserRepositoryMock.GetUser(string id, bool sanitize = true), change parameter name id to userId in order to match the identifier as it has been declared in Task<User?> IUserRepository.GetUser(string userId, bool sanitize = false) 
Backend.Tests/Controllers/ProjectControllerTests.cs(39,97): error CA2201: Exception type System.Exception is not sufficiently specific 
Backend.Tests/Controllers/SemanticDomainControllerTests.cs(29,21): error CA1707: Remove the underscores from member name Backend.Tests.Controllers.SemanticDomainControllerTests.SemanticDomainController_GetSemanticDomainFull_DomainFound() 
Backend.Tests/Controllers/UserEditControllerTests.cs(46,90): error CA2201: Exception type System.Exception is not sufficiently specific 
Backend.Tests/Mocks/ProjectRepositoryMock.cs(26,49): error CA1725: In member Task<Project?> ProjectRepositoryMock.GetProject(string id), change parameter name id to projectId in order to match the identifier as it has been declared in Task<Project?> IProjectRepository.GetProject(string projectId) 
Backend.Tests/Mocks/MergeBlacklistRepositoryMock.cs(42,69): error CA1725: In member Task<MergeBlacklistEntry> MergeBlacklistRepositoryMock.Create(MergeBlacklistEntry entry), change parameter name entry to blacklistEntry in order to match the identifier as it has been declared in Task<MergeBlacklistEntry> IMergeBlacklistRepository.Create(MergeBlacklistEntry blacklistEntry) 
Backend.Tests/Controllers/UserControllerTests.cs(48,71): error CA2201: Exception type System.Exception is not sufficiently specific 
Backend.Tests/Controllers/LiftControllerTests.cs(251,25): error CA1310: The behavior of 'string.IndexOf(string)' could vary based on the current user's locale settings. Replace this call in 'Backend.Tests.Controllers.LiftControllerTests.TestDeletedWordsExportToLift()' with a call to 'string.IndexOf(string, System.StringComparison)'. 
Backend.Tests/Controllers/UserRoleControllerTests.cs(212,72): error CA2201: Exception type System.Exception is not sufficiently specific 

imnasnainaec added a commit that referenced this issue Jun 2, 2023
Cover CA1305, CA1309, CA1310 of #2111;
Fix GetUser default argument mismatch between UserRepository and IUserRepository;
Add sanitize-user option to GetUserBy* functions;
Remove usage of (string)someString.Clone()
jmgrady pushed a commit that referenced this issue Jun 5, 2023
Cover CA1305, CA1309, CA1310 of #2111;
Fix GetUser default argument mismatch between UserRepository and IUserRepository;
Add sanitize-user option to GetUserBy* functions;
Remove usage of (string)someString.Clone()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend maintenance Issue that makes it difficult to maintain the software or to upgrade installations post-release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant