Skip to content

MegaLinter Unintentionally Enforces jscpd Threshold of 0Β #2450

Description

@Kurt-von-Laven

Describe the bug
Starting in v6.20.0, jscpd began failing when run via MegaLinter on repositories containing at least 1 clone even if they configured a sufficiently high threshold.

To Reproduce
Steps to reproduce the behavior:

  1. Copy and paste at least a few lines of code in your repository so that you have at least 1 clone for jscpd to detect.
  2. Set a threshold of 100 in .jscpd.json so that jscpd should pass unconditionally.
  3. Run npx jscpd@3.5.3 ., and observe that jscpd passes.
  4. Run jscpd via MegaLinter v6.20.0+ or npx jscpd@3.5.3 --exitCode 1 ., and observe that jscpd fails.

Expected behavior
jscpd should succeed if and only if the percentage of duplicated lines doesn't exceed the configured threshold.

Additional context
This bug was introduced by uncommenting --exitCode 1 in #2329. I believe the solution is to delete these arguments; please let me know if anyone anticipates any drawbacks to this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnostaleThis issue or pull request is not stale, keep it open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions