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

Companial Cop - PR: Analyze Transfer Fields #429

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

tinestaric
Copy link
Contributor

This PR adds a new rule to analyze table pairs coupled using TransferFields.

First, it analyzes all TableExtensions in the code base, if any TableExts are part of the hardcoded table pairs that were found in the BaseApp, then all fields that have the same ID in both objects need also to have the same name and type.

Next, it finds all TransferFields invocations in the code. It analyzes three different situations:

  • TransferFields(DependencyTable1, DependencyTable2): In this case, it will look for TableExt objects, and compare all fields there
  • TransferFields(MyOwnTable1, MyOwnTable2): Here, it compares all fields in both table objects
  • TransferFields(DependencyTable1, MyOwnTable1): Here, it compares the DependencyTable fields and DependencyTableExt fields with all the fields in my table fields.

I went through most of the BaseApp to find as many table pairs as possible. I might have missed some.
A possible extension to this rule is to include some settings file, where per project, you could add additional table pairs that are coupled in other dependencies, besides BaseApp.

@pri-kise
Copy link

Are the tuples checked bi-directional or do we need a Tupble for Both TransferFields Directions?

Table1.TransferFields(Table2);
Table2.TransferFields(Table1);

@tinestaric
Copy link
Contributor Author

Are the tuples checked bi-directional or do we need a Tupble for Both TransferFields Directions?

Table1.TransferFields(Table2);
Table2.TransferFields(Table1);

bi-directional

@Arthurvdv Arthurvdv changed the base branch from master to development December 13, 2023 10:11
@Arthurvdv Arthurvdv merged commit 323e65a into StefanMaron:development Dec 13, 2023
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.

3 participants