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

Exclude symbolic links - phpmd freezes when a full wordpress installation even if excluding the symbolic link #1038

Open
jcvignoli opened this issue Sep 28, 2023 · 2 comments

Comments

@jcvignoli
Copy link

  • PHPMD version: 2.14
  • PHP Version: 8.2.10
  • Installation type: composer
  • Operating System / Distribution & Version: Ubuntu

Current Behavior

PHPMD freezes when parsing a symbolic link to a wordpress installation. I tried to launch phpmd with
vendor/bin/phpmd -vvv
but the only info I get is "ResultCache is not enabled." Then it remains at this point with no further info on screen.

Expected Behavior

To be able to exclude symbolic links

Steps To Reproduce:

The symbolic link is excluded with the following pattern
.src/wordpress/.
I also tried
src/wordpress/
and also took the trailing slash off with no luck.

I removed the symbolic link and phpmd could normaly run.

The symbolic link links towards a full wordpress installation, probably get stuck when parsing so many files.

Checks before submitting

  • [ X] Be sure that there isn't already an issue about this. See: Issues list
  • [ X] Be sure that there isn't already a pull request about this. See: Pull requests
  • [ X] I have added every step to reproduce the bug.
  • [ X] If possible I added relevant code examples.
  • [X ] This issue is about 1 bug and nothing more.
  • [X ] The issue has a descriptive title. For example: "JSON rendering failed on Windows for filenames with space".
@AJenbo
Copy link
Member

AJenbo commented Sep 28, 2023

.src/wordpress/.

Looks like you are missing a slash here, it should probably be ./src/wordpress/., since . just means "relative to current" you could just have ./src/wordpress

@jcvignoli
Copy link
Author

jcvignoli commented Sep 28, 2023

./src/wordpress doesn't work.
I've been able to unfreeze phpmd by using
wordpress/*
but then it reports another symbolic links that are inside the folder wordpress.
I had to add them into the exclude pattern, and most surprisingly, I had to use the full path to make it work.
wordpress/symboliclink/*
didn't work, while
fullpathofsymboliclink/*
did.
I keep this open, even if I solved my issue, I think weird the way phpmd exclude paths.
It's very different from other static analysis tools.

@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants