I’m writing my own duplicate code detection where a certain amount of reused data members/class variables will be detected as a code smell (data clump). I’m using the visitNode function of the IssuableSubscriptionVisitor class to scan for duplicate codes and store it somewhere else. Then, when the scan is complete, I want to know when the last visitNode would finish so I can call my issue reporting process. I’m currently using some functions I wrote to count how many files and classes there are to scan, and decrease the number every time visitNode executes, but I know it’s not the best thing to do and could add potential bugs. Are there ways to add callbacks or are there better ways to do what I’m trying to do?
Thanks in advance.