how do I check java code duplications from files

382 views Asked by At

I am going through a project where I have to check the plagiarism between two files.In two files there have some java code.That means if there are two files named a.java and b.java and in two files have some java code which was written in .java class and I have to check the duplicacy in percantage between the java code which was written the two files. can anyone tell me how can I solve this problem?I am a beginner.

1

There are 1 answers

1
Hung Vu On

There are several ways to do so, but in general, you have to use third party service.

Example Solution 1: Install plugin to your IDE. For example, if you are using Eclipse, PMD supports duplicated code checking.

Example Solution 2: If you are using version control system like GitHub, you can add plugins to your repository and it will do the check for you. For instance, you can use plugin named Codacy. It is an automatic testing tool used in CI/CD, which supports duplicated code checking.