New Rule0075: Record Get Procedure Arguments #826
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Discussion: #85
Thank you @rvanbekkum for providing the test cases!
I could use some feedback on this new rule, as my intention is to have set the default severity as a warning for this new rule, where I want to prevent possible false positives.
Some remarks on this PR:
Implicit conversation
Not the best example, but I want to allow this in this rule (and maybe have LC0003 report on this).
For now I have these implicit conversation in place, where I don't have a lot of examples where the parameter type is different then the field type on the table. Could use some input on this if I need to add or remove some conversions here.
String(literal) can be a hard coded value directly in code or for example a Label value.
Enums
Currently I expect the provided Enum to be exactly the same as the Enum declaration of the field. Are there exceptions on this I need to take into account?
Setup Table
For a setup table, where I expect the Singleton Pattern, a
.Get()
call without any values should be sufficiënt. I've now created the check that when a table has one a single primary key of typeCode
, the rule will handle this as a setup table. Potentially this could raise a false positive on a table with a single primary key of another type, like for exampleText
?Length of Code/Text field
Currently the rule will not raise on a Code[20] argument on a Code[10] field, which can possibly create a overflow. I'm looking into handling this with the LC0051 rule.