Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 10 12:43
    sandhje commented #62
  • Apr 10 12:42

    sandhje on develop

    Merge pull request #35 from san… Merge branch 'release/v1.1.0' Merge branch 'release/v1.2.0' and 3 more (compare)

  • Apr 10 12:39

    sandhje on master

    Fix credit Merge pull request #62 from Ry0… (compare)

  • Apr 10 12:39
    sandhje closed #62
  • Apr 10 01:10
    Ry0taK opened #62
  • Apr 09 21:07
    sandhje commented #57
  • Apr 09 21:07
    sandhje commented #57
  • Apr 09 21:00
    sandhje commented #58
  • Apr 09 20:56
    sandhje commented #60
  • Apr 09 20:55
    sandhje unlabeled #60
  • Apr 09 20:52
    sandhje commented #60
  • Apr 09 20:52
    sandhje labeled #60
  • Apr 09 20:50
    sandhje closed #61
  • Apr 09 20:50
    sandhje commented #61
  • Apr 09 20:28

    sandhje on v1.3.0

    (compare)

  • Apr 09 20:28

    sandhje on develop

    Bump version number and update … Merge branch 'release/v1.3.0' i… (compare)

  • Apr 09 20:28

    sandhje on master

    Merge branch 'release/v1.2.0' i… Add system requirements to read… Fix remote code execution Se… and 8 more (compare)

  • Apr 09 20:14

    sandhje on v1.3.0

    Bump version number and update … (compare)

  • Apr 09 20:01

    sandhje on develop

    Fix remote code execution Se… Update PHPMD to version 2.9.1 Fix false negative if xml speci… and 4 more (compare)

  • Apr 06 22:15
    sandhje labeled #61
rezashamdani
@rezashamdani
hi, on launching vscode, the phpmd succefully detect 21 problems on a file, yet when i try to fix only 1 problem, the phpmd failed to detect the rest of the problems. it stated 0 problem on the output tab.
[Info - 12:45:17 PM] Language server connection initialized.
[Info - 12:45:17 PM] Configuration change triggerd, validating all open documents.
[Info - 12:45:17 PM] Creating controller
[Info - 12:45:17 PM] New document opened, starting validation.
[Info - 12:45:17 PM] PHP Mess Detector validation started for file:///Users/rezash/Sites/howdenbenefitsasia.local/admin_benefit/get_data.php
[Info - 12:45:17 PM] PHP command test successful (PHP 7.0.19 (cli) ...)
[Info - 12:45:24 PM] PHP Mess Detector test succesful (PHPMD 2.6.0)
[Info - 12:45:24 PM] Running phpmd command (php /Users/rezash/.vscode/extensions/ecodes.vscode-phpmd-1.0.0/phpmd/phpmd.phar /Users/rezash/Sites/howdenbenefitsasia.local/admin_benefit/get_data.php xml ~/Sites/phpmd_config.xml)
[Info - 12:45:24 PM] PHP Mess Detector validation completed for file:///Users/rezash/Sites/howdenbenefitsasia.local/admin_benefit/get_data.php. 21 problems found
[Info - 12:46:54 PM] Document saved, starting validation.
[Info - 12:46:54 PM] PHP Mess Detector validation started for file:///Users/rezash/Sites/howdenbenefitsasia.local/admin_benefit/get_data.php
[Info - 12:46:54 PM] PHP command test successful (PHP 7.0.19 (cli) ...)
[Info - 12:46:54 PM] PHP Mess Detector test succesful (PHPMD 2.6.0)
[Info - 12:46:54 PM] Running phpmd command (php /Users/rezash/.vscode/extensions/ecodes.vscode-phpmd-1.0.0/phpmd/phpmd.phar /Users/rezash/Sites/howdenbenefitsasia.local/admin_benefit/get_data.php xml ~/Sites/phpmd_config.xml)
[Info - 12:46:56 PM] PHP Mess Detector validation completed for file:///Users/rezash/Sites/howdenbenefitsasia.local/admin_benefit/get_data.php. 0 problems found
Sandhjé Bouw
@sandhje
hi @rezashamdani, I would love to help but can't reproduce the problem you're experiencing. The logs don't show anything strange either so if you could send me the php file that's giving you these problems that would be very helpful. (sandhje/vscode-phpmd#12)
Markus Igeland
@Markussss
hey! is there any easy way to disable a few specific rules in phpmd in vscode?
Sandhjé Bouw
@sandhje
Yes, you can use the phpmd.rules setting of the extension to set either rulesets or a phpmd config file. If you set a phpmd config file you get full control over which rules you want to use and wich not.
See this link (https://phpmd.org/documentation/creating-a-ruleset.html) on how to create a phpmd config file.
And see this link (https://phpmd.org/rules/index.html) for the available rules.
See the phpmd.rules section in the extension's readme on how to set the option.
Markus Igeland
@Markussss
@sandhje Ah, I see. I was hoping there was some ezpz way to turn off a single rule, while keeping the default settings, but if that's not possible, I'll just create a new phpmd ruleset. Thanks for the answer!
mischief2175
@mischief2175
Hello, I've just installed this plugin and I'm a little confused as to why it's not working:
[Info - 14:20:43] New document opened, starting validation.
[Info - 14:20:43] PHP Mess Detector validation started for file:///home/mischief/git/test.php
[Info - 14:20:43] PHP command test successful (PHP 7.2.10-0ubun ...)
[Info - 14:20:43] PHP Mess Detector test succesful (PHPMD 2.6.0)
[Info - 14:20:43] File /home/mischief/git/test.php test successful
[Info - 14:20:43] Running phpmd command (php /home/mischief/.vscode/extensions/ecodes.vscode-phpmd-1.1.0/phpmd/phpmd.phar "/home/mischief/git/test.php" xml "cleancode,codesize,controversial,design,unusedcode,naming")
[Error - 14:20:43] An error occured during document validation after open with the following message: An error occured, no output was received after executing the phpmd command
Sandhjé Bouw
@sandhje
Hi, could you try running the phpmd command (php /home/mischief/.vscode/extensions/ecodes.vscode-phpmd-1.1.0/phpmd/phpmd.phar "/home/mischief/git/test.php" xml "cleancode,codesize,controversial,design,unusedcode,naming") in a shell and paste the output here?
mischief2175
@mischief2175
Here you go:
`PHP Fatal error: Uncaught Error: Call to undefined function PHPMD\simplexml_load_string() in phar:///home/mischief/.vscode/extensions/ecodes.vscode-phpmd-1.1.0/phpmd/phpmd.phar/src/main/php/PHPMD/RuleSetFactory.php:551
Stack trace:
#0 phar:///home/mischief/.vscode/extensions/ecodes.vscode-phpmd-1.1.0/phpmd/phpmd.phar/src/main/php/PHPMD/PHPMD.php(208): PHPMD\RuleSetFactory->getIgnorePattern('cleancode,codes...')
#1 phar:///home/mischief/.vscode/extensions/ecodes.vscode-phpmd-1.1.0/phpmd/phpmd.phar/src/main/php/PHPMD/TextUI/Command.php(132): PHPMD\PHPMD->processFiles('/home/mischief/...', 'cleancode,codes...', Array, Object(PHPMD\RuleSetFactory))
#2 phar:///home/mischief/.vscode/extensions/ecodes.vscode-phpmd-1.1.0/phpmd/phpmd.phar/src/main/php/PHPMD/TextUI/Command.php(173): PHPMD\TextUI\Command->run(Object(PHPMD\TextUI\CommandLineOptions), Object(PHPMD\RuleSetFactory))
#3 /home/mischief/.vscode/extensions/ecodes.vscode-phpmd-1.1.0/phpmd/phpmd.phar(19): PHPMD\TextUI\Command::main(Array)
#4 {main}
thrown in phar:///home/mischief/.vscode/extensions/ecodes.vscode-phpmd-1.1.0/phpmd/phpmd.phar/src/main/php/PHPMD/RuleSetFactory.php on line 551`
Derek Pennycuff
@dap6000_twitter
hi everyone. i'd like for each project to have configuration files in the project root. i've got my xml file saved as .php_md.xml in my project root. and in the workspace specific settings i set Phpmd:Rules to ${workspaceRoot}/.php_md.xml and enabled verbose logging. now i get "An error occurred while executing PHP Mess Detector" but i don't get any info beyond that. i'm sure i've ever screwed up the path to the xml file or i've got a typo in my xml file. but i don't know where to find the logs. any tips?
ah, output panel has PHP Mess Detector as an option. i think that's the logging.
Derek Pennycuff
@dap6000_twitter
[Info  - 3:02:43 PM] Running phpmd command (php [/path/to/phar] "/path/to/file.php" xml "${workspaceRoot}/.php_md.xml")
[Error - 3:02:43 PM] An error occured during document validation after open with the following message: An error occured, no output was received after executing the phpmd command
that ${workspaceRoot} string literal probably isn't supposed to be there 0_o
looks like ${workspaceFolder} replaced ${workspaceRoot} a while back
…xml "${workspaceFolder}/.php_md.xml") so that didn't expand either. boo
Derek Pennycuff
@dap6000_twitter
looks like variable substitution isn't supported in settings at all. https://code.visualstudio.com/docs/editor/variables-reference#_common-questions
Derek Pennycuff
@dap6000_twitter
looks like i'll punt on "check project root for config file" behavior for now. i ran the test on the CLI and got an error Premature end of data in tag ruleset line 2 so i'd munged up my XML too. fixed that and CLI worked as expected. set the full path to the file for this workspace and now it's working as expected within vs code as well. needing to put in the full path for each project isn't the end of the world. i can live with that. thanks for giving me a space for some rubber duck debugging. :D
Sandhjé Bouw
@sandhje
Hi Derek,
I see your problem, I'll submit a new issue on github so I can investigate adding some form of variable substitution in the next version when loading the config file.
Sandhjé Bouw
@sandhje
Derek Pennycuff
@dap6000_twitter
awesome. thank you @sandhje.
for what it's worth, the convention of loading a configuration file from the root of a project seems to be part of PHP CS Fixer itself, not the VS Code plugin for it. https://github.com/FriendsOfPHP/PHP-CS-Fixer/#config-file
Renato Schroepfer
@renatoschroepfer
Has anyone had same error in Ubuntu? An error occured during document validation after save with the following message: An error occured, no output was received after executing the phpmd command
Sandhjé Bouw
@sandhje
@renatoschroepfer I personally don't run on ubuntu, but you can try to enable the verbose logging in the extension settings, and check the output panel of vscode for the executed phpmd command (the log entry should look something like this: Running phpmd command (php c:\Projects\vscode-phpmd\phpmd\phpmd.phar "c:\Projects\...\src\Config.php" xml "cleancode,codesize,controversial,design,unusedcode,naming")). Than copy that command (the part between the braces in the log entry) to your terminal and run it "manually" to see if its output gives you some pointers as to what went wrong.
Marizza69
@Marizza69
Sorry for asking this very lame question, but: I installed the extension in vscode. PHP is in the path. How do I check files now?! Do I need to start something? Should that be done automatically on opening a PHP file? I switched on Verbose mode but can't see any output
Marizza69
@Marizza69
Please ignore my question: I forgot to select "PHP Mess Detektor" in the filter select list in the output tab. Everything is fine