-
Notifications
You must be signed in to change notification settings - Fork 11
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
Simplify File analysis/validation #378
Conversation
91bfcd1
to
bf6ec82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Quality Gate failedFailed conditions 57.9% Coverage on New Code (required ≥ 65%) |
ee5c90f
to
577ee8e
Compare
fileAnalysisResults = await Analyse(dataType, fileStream, fileName); | ||
} | ||
|
||
bool fileValidationSuccess = true; |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
fileValidationSuccess
List<ValidationIssue> validationIssues = new(); | ||
if (FileValidationEnabledForDataType(dataType)) | ||
{ | ||
(fileValidationSuccess, validationIssues) = await Validate(dataType, fileAnalysisResults); |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
fileValidationSuccess
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 4 New issues |
We do not have any issue |
While working on rewriting the interfaces for validation to remove
ModelStateDictionary
and related infrastructure in #369 / #374, I took a look at File validation and think I found something to simplify there as well.This PR has no functional changes, but introduces a new way to registrer file analysers and validators through keyed services, to match the new way of registrering validations.
instead of the more convoluted config where
myValidator.Id => "MY_VALIDATOR"
anddatatype.EnabledValidators[]
contains"MY_VALIDATOR"
.I think we should strive to use only one concept to register any type of validator, and the double approach used here is probably not a very good idea.
Note: This PR includes #369, so for review only look at 91bfcd1
Verification
Documentation