erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.74k stars 1.12k forks source link

Code analyzation #679

Closed kminchev closed 5 years ago

kminchev commented 5 years ago

Greetings,

recently I've come across https://github.com/squizlabs/PHP_CodeSniffer and used it against Parsedown.php. It reported a lot of errors and warnings. I don't know much of PHP coding and its standards to verify the errors. Someone more skilled should do that.

Hint: that tool has option to automatically fix most of the errors.

PS: if anyone heard of a similar tool, it would be nice to compare the results.

aidantwoods commented 5 years ago

PHP_CodeSniffer enforces coding standards (read: coding conventions, or stylistic preferences) so the "errors" it reports are likely due to it's default standard having opinions about things like comment styles, line length, variable capitalisation, or brace placement etc... but these aren't errors in the sense that the code is broken. Please re-open if there is a specific functional error you noticed though :)

aidantwoods commented 5 years ago

On another note, from a static (type) analysis perspective there are quite a few improvements that can be made. I was planning on including vimeo/psalm as part of the travis test suit in the next version of Parsedown.

kminchev commented 5 years ago

You can tell Sniffer to check against another standard than the default.