Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Describe the bug A clear and concise description of what the bug is. I installed jscpd using

npm i -g jscpd
npm i -g @jscpd/html-reporter
npm i -g @jscpd/badge-reporter

and navigated to my root project folder, running the command jscpd --pattern "src/**/*.ts"

but the output is empty, I only see Detection time:: 0.244ms

I also tried jscpd -k 10 -l 1

which should definitely find something. As a test I have

console.log("i got a line of code");
console.log("i got a line of code");

in my typescript file.

What’s the problem here? The idea to detect duplicate code is awesome, if it would work 😕

Desktop (please complete the following information):

  • OS: Windows
  • NodeJS Version [12.18.4]
  • jscpd version [3.3.26]

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

JulianaKomarytskacommented, Oct 19, 2022

Hi! I have the same problem. Node 14.17.4

In file @jscpd/finder/dist/files.js in function “getFilesToDetect” after I got patterns like [ ‘D:\work\project_name\src/**/*’ ]

So in FastGlob.sync() function “getWorks” const task will contain patterns: [ ‘D:\work\project_name\src//*', '!/snapshots/', '!/node_modules/**’ ]

If in files.js I change const currentPath = fs_extra_1.realpathSync(path) to const currentPath = path; it work good for me.

Maybe it will be helpful for you

liujiali365commented, Oct 11, 2022

Hi, Looks like the issue related to fast-glob package, you can use --format option to detect clones in specified language:

jscpd "src/**" --format "javascript,typescript"

hi, I encounter the same issue in analysing vue project, also using Windows but with Node 14.18.0.

jscpd --format "javascript,typescript" src/ path1/ path2/    

can’t solve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

your program produce no output - python - Stack Overflow
When you use input('') , it takes the number from terminal (at the running time), so your code is OK, just to understand...
Read more >
No Output Given : [] - ASKSAGE: Sage Q&A Forum
When there are parameters in the equations (variables which are not variables to-solve-for), I believe SageMath assumes these to be free ...
Read more >
Why does the 'which' command in Terminal give no output in ...
On Ubuntu 20.04 with two versions of python installed python seems to be defined. which python has no response, but python opens the...
Read more >
No error but still no output - Python - Code with Mosh Forum
Why can't this run and give a pattern output, please help. I am a beginner. def pattern(n): k = 2 * n -...
Read more >
Why does this code give no output? - Sololearn
I need to find the sum of the digits in a number. n = int(input()) total = 0 while n > 0: n%10...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found