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

consoleFull/html reporter shows wrong code block than line number gives #612

Open
kalashnlkov opened this issue Oct 26, 2023 · 1 comment
Labels
bug An issue contains information about wrong behaviour

Comments

@kalashnlkov
Copy link

kalashnlkov commented Oct 26, 2023

Describe the bug
consoleFull/html reporter shows wrong code block than line number gives

To Reproduce
jscpd -r consoleFull --skipLocal --mode strict b/utsname.c a/utsname.c

Screenshots
error code block as following:

$ jscpd  -r consoleFull --skipLocal --mode strict b/utsname.c  a/utsname.c
Clone found (c):
 - b/utsname.c [6:27 - 16:1] (10 lines, 68 tokens)
   a/utsname.c [31:1 - 41:1]

Clone found (c):
 - b/utsname.c [6:27 - 16:1] (10 lines, 68 tokens)
   a/utsname.c [31:1 - 41:1]

 6  │ 31 │ ude <linux/uts.h>
 7  │ 32 │ #include <linux/utsname.h>
 8  │ 33 │ #include <linux/err.h>
 9  │ 34 │
 10 │ 35 │ // only in testing hahahha
 11 │ 36 │ static struct uts_namespace *create_uts_ns(void)
 12 │ 37 │ {
 13 │ 38 │      struct uts_namespace *uts_ns;
 14 │ 39 │
 15 │ 40 │      uts_ns = kmalloc(sizeof(

Found 1 clones.
Detection time:: 46.558ms

Expected behavior
output shows correct, full matched code.

Desktop (please complete the following information):

  • OS: Ubuntu
  • OS Version 18.04
  • NodeJS Version v16.20.2
  • jscpd version 3.5.10

Additional context
b/utsname.c

#include <linux/export.h>
#include <linux/uts.h>
#include <linux/utsname.h>
#include <linux/err.h>

// only in testing hahahha
static struct uts_namespace *create_uts_ns(void) // line 6 here.
{
        struct uts_namespace *uts_ns;

        uts_ns = kmalloc(sizeof(struct uts_namespace), GFP_KERNEL);
        if (uts_ns)
                kref_init(&uts_ns->kref);
        return uts_ns;
}

a/utsname.c contains function implement in b/utsname.c

@kucherenko
Copy link
Owner

will check, thank you

@kucherenko kucherenko added the bug An issue contains information about wrong behaviour label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue contains information about wrong behaviour
Projects
None yet
Development

No branches or pull requests

2 participants