platisd / duplicate-code-detection-tool

A simple Python3 tool to detect similarities between files within a repository
MIT License
162 stars 30 forks source link

Reports files without duplicated code #17

Closed cgutierr-zgz closed 2 years ago

cgutierr-zgz commented 2 years ago

Hi, I've been using this GH Action and set ignore_below: 20, tool anyway shows up, even when there's no similarities found whatsoever

Example: Screenshot 2022-07-29 at 14 56 51

I might be doing something wrong, but I've literally copied over from the example provided

Thanks

platisd commented 2 years ago

Hello there, is this on a public repo? If so do you have a link to a pull request?

cgutierr-zgz commented 2 years ago

Hello there, is this on a public repo? If so do you have a link to a pull request?

Sadly it's on a private repo I have it like follows

   - name: 🕵️ Check for duplicate code
        uses: platisd/duplicate-code-detection-tool@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          directories: "src/app"
          # Only examine .ts files
          file_extensions: "ts"
          # Only report similarities above 20%
          ignore_below: 20
          # If a file is more than 99% similar to another, then the job fails
          # This should probably be around 70% in the future
          fail_above: 99
          # If a file is more than 20% similar to another, show a warning symbol in the report
          warn_above: 20

It's reporting files as I showed in the screenshot on top

Maybe I have something written bad in the yaml, but I can't seem to find it

platisd commented 2 years ago

@cgutierr-zgz Can you try out #18? It should fix your issue. :+1:

cgutierr-zgz commented 2 years ago

Yes, works just fine @platisd Thanks for the quick fix, feel free to merge that, I've tested it with a bunch of different PRs, and it works well.

platisd commented 2 years ago

Thanks for reporting the issue! 👍