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

Sections of copy-pasted code are not being detected #728

Open
GonzalooDelgado opened this issue Dec 20, 2024 · 0 comments
Open

Sections of copy-pasted code are not being detected #728

GonzalooDelgado opened this issue Dec 20, 2024 · 0 comments

Comments

@GonzalooDelgado
Copy link

Describe the bug
In some cases - when the entire file is 100% a copy and pasted segment of code. JSCPD is not detecting them, no matter the settings that are being used.

To Reproduce
Steps to reproduce the behavior:

  1. Compare file hunk_3_additions.txt to file KafkaStreams.txt (rename them both to .java first)
  2. Setup JSCPD using the .jscpd.json file given

{
"ignore": ["node_modules/", "dist/", ".jscpd.json", "package.json", "package-lock.json"],
"minTokens": 40,
"minLines": 1,
"reporters": ["html", "csv"],
"skipLocal": true,
"output": "reports/",
"path": ["./src", "./cmp"]
}

  1. Run JSCPD with the following command
    jscpd --pattern "*.java"
  2. See Results for each
  3. Repeat by changing minTokens to 30 and then 20.

Expected behavior
These files should be detected as copied and pasted code segments

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Sonoma
  • OS Version: 14.6.1
  • NodeJS Version: 22.8
  • jscpd version: 3.5.10

Additional context
The compared file was obtained by taking them from a github .patch file and parsing them from the hungs.

KafkaStreams.txt
hunk_3_additions.txt

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

No branches or pull requests

1 participant