Can pmd/cpd support finding duplicate code across file formats ? #3009
-
Description: We work on a cross platform mobile app development framework and face a lot of issues with code duplication across multiple file formats. Our framework is built on top of the NativeScript framework and hence we have code written in TypeScript,Java(Android) and Swift/ObjectiveC (iOS). What we observe is that in order to support cross platform support any feature , sometimes the same code ( not exactly duplicate since its written in different languages) i.e code containing same logic is written across all these 3 layers. This introduces a lot of maintenance overhead and leads to lot of regression issues. Hence wanted to check , does pmd/cpd support finding such duplicate code across file formats ? If not , can you please point me to tools / research around this if there has been any ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@kamath-prasad I fear not. CPD checks the syntactic structure to find duplicates. Since syntaxis is language-dependant, it's not possible to find equivalences between languages. |
Beta Was this translation helpful? Give feedback.
-
@jsotuyod : Thanks for your quick response. Although CPD does not support it currently , can you help me to know if there are any tools/technologies/research in this area to find code duplicates across languages ? |
Beta Was this translation helpful? Give feedback.
-
@kamath-prasad I fear I know of no such tools, but I ha e never researched it. |
Beta Was this translation helpful? Give feedback.
@kamath-prasad I fear not.
CPD checks the syntactic structure to find duplicates. Since syntaxis is language-dependant, it's not possible to find equivalences between languages.