duplicate-code-detection-tool icon indicating copy to clipboard operation
duplicate-code-detection-tool copied to clipboard

Empty message posted

Open lukaas33 opened this issue 1 year ago • 3 comments

Hi, I am using this tool, but it is only posting empty comments. Is there any way to check why? This is happenign in a private repo.

This is the config, note that it was also posting empty comments before adding one_comment: true

name: Replication

on: pull_request

jobs:
  duplicate-code-check:
    name: Check for duplicate code
    runs-on: ubuntu-20.04
    steps:     
      - name: Check for duplicate code
        uses: platisd/duplicate-code-detection-tool@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          one_comment: true

lukaas33 avatar Dec 05 '24 08:12 lukaas33

Have you tried running the python tool first manually?

platisd avatar Dec 05 '24 08:12 platisd

Hi,

I have ran it locally and it returns the following:

Code duplication probability for ...\fragshader.c
----------------------------------------------------------------------------------------------------------
                                            File                                             Similarity (%)
----------------------------------------------------------------------------------------------------------
...\vertshader.c     0.00



Code duplication probability for C:\Users\Lucas\Code\profoundvision-website\public\assets\components\neuronnoise\vertshader.c
----------------------------------------------------------------------------------------------------------
                                            File                                             Similarity (%)
----------------------------------------------------------------------------------------------------------
....\fragshader.c     0.00

So is this expected behavior that the report is empty when the probability is so low? Would it not be possible to post no comment instead of an empty one in this case?

lukaas33 avatar Dec 07 '24 18:12 lukaas33

When you run the Action, the ignore_below value is set to 10. To show everything, try setting it to 0. See the optional configuration example which does ignore_below: 5.

platisd avatar Dec 07 '24 18:12 platisd