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

[suggestion] Code quality #612

Open
ftwbzhao opened this issue Nov 19, 2015 · 3 comments
Open

[suggestion] Code quality #612

ftwbzhao opened this issue Nov 19, 2015 · 3 comments
Assignees
Labels
feedback-needed We need feedback on this issue

Comments

@ftwbzhao
Copy link
Contributor

@ftwbzhao ftwbzhao changed the title Suggested Topic "Code Quantity" Suggested Topic "Code Quality" Nov 19, 2015
@codeguy
Copy link
Owner

codeguy commented Jun 20, 2018

Agreed. Will work on getting this started shortly.

@codeguy codeguy self-assigned this Jun 20, 2018
@codeguy codeguy added in-progress feedback-needed We need feedback on this issue and removed priority feedback-needed We need feedback on this issue unassigned Task is not assigned yet labels Jun 20, 2018
@codeguy codeguy changed the title Suggested Topic "Code Quality" [suggestion] Code quality Aug 18, 2019
@codeguy codeguy added feedback-needed We need feedback on this issue and removed in-progress labels Aug 18, 2019
@ariaieboy
Copy link

any update about this ?
i think in modern PHP era we should use static analyzers for having a really better code quality.
some of the great packagees in this section is :

https://github.com/phpstan/phpstan
https://github.com/nunomaduro/larastan
https://github.com/vimeo/psalm
https://github.com/phan/phan

@JonisoftGermany
Copy link

JonisoftGermany commented Jul 10, 2022

Hi everybody,
code quality is a very important topic. It contains so many more aspects than mentioned here before.

For me it starts with an IDE, which provides syntax highlighting. Many of you might not think that there are some people around, which still use an unmodified VIM or editor (windows) or textedit (mac os) without any hinting. But there are! Many! I do not know if you want to mention commercial products besides open source IDE. So I will not go into detail, which IDE I am using to not influence this discussion to one direction.

IDE usually allows plug-ins. They can provide so much more detailed checking than just syntax checking. The plug-in I really really recommend is PHP Inspections EA ( https://github.com/kalessil/phpinspectionsea ). Also PhpClean is on my list ( https://plugins.jetbrains.com/plugin/11272-phpclean ).

The problem with deep code inspection tools in IDE or static analyzers is that it provides good feedback for experienced developers. Beginners might enable all levels and try to fight all notices. By clearing issue by issue beginners might not solve the architectural mistakes behind it. Personally I am struggling with naming a static analyzer "a tool for everybody". They are easy to use - Yes. They provide helpful hints for everybody - Yes. But the conclusion of using a static analyzer cannot be to solve every displayed error without architectural changes.

Here is my recommendation for changes:

  • Add a section "Code Editors" to the chapter "Getting Started"
    • Name a few popular open source editors which provide tools for PHP
    • Name a few popular commercial source editors which are specialized for/in PHP
  • Add a chapter "Code Quality" between chapters "Errors and Exceptions" and "Security" (because code quality has an effect on security, it should appear before security)
    • Plug-ins for IDE, which provide a simple code inspection detecting obvious problems (like an enhanced syntax checker)
    • (Static) Metric analyzers for analyzing code quality and detecting mess
    • (Static) Code analyzers for detecting imperfect code

If you consider these or familiar changes, I would love to support you by writing a draft. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback-needed We need feedback on this issue
Projects
None yet
Development

No branches or pull requests

4 participants