Clone groups are formed before some pairs are dropped. Suppressed members take their pairs with them, and the clone-type filter removes whole pair types. A group that only held together through a dropped pair must be split into the connected components of the remaining pairs, and its type and similarity must be recomputed from them.
pyscn implements this twice: splitDisconnectedGroups in internal/analyzer/clone_detector.go (69f577b) and filterCloneGroupsByPairs in service/clone_group_filter.go (cf077e1, fc35b60). jscan now has one generic helper, analyzer.SplitGroupsByPairs in polyscan/internal/js/analyzer/clone_group_split.go, which both its detector and its clone service call.
The operation is language-independent and belongs next to FilterGroupsWithoutBackingPairs in core/clone. Moving it there needs a core tag, after which jscan and pyscn can both drop their local copies.
Clone groups are formed before some pairs are dropped. Suppressed members take their pairs with them, and the clone-type filter removes whole pair types. A group that only held together through a dropped pair must be split into the connected components of the remaining pairs, and its type and similarity must be recomputed from them.
pyscn implements this twice:
splitDisconnectedGroupsininternal/analyzer/clone_detector.go(69f577b) andfilterCloneGroupsByPairsinservice/clone_group_filter.go(cf077e1, fc35b60). jscan now has one generic helper,analyzer.SplitGroupsByPairsinpolyscan/internal/js/analyzer/clone_group_split.go, which both its detector and its clone service call.The operation is language-independent and belongs next to
FilterGroupsWithoutBackingPairsincore/clone. Moving it there needs a core tag, after which jscan and pyscn can both drop their local copies.