Code-checker

General plugins (Local) ::: local_codechecker
Maintained by One poor developer...Eloy Lafuente (stronk7), TimTim Hunt, Víctor Déniz Falcón, Sara Arjona Téllez
Part of set Moodle development.
A tool for developers that helps them follow Moodle's coding style.
Latest release:
633 sites
718 downloads
60 fans
Current versions available: 8

This Moodle plugin uses the PHP CodeSniffer tool to check that code follows the Moodle coding styleIt implements and reuses a set of 'sniffs' that check many aspects of the code, including the awesome PHPCompatibility ones.

They also present a nice web interface for viewing the results.

Screenshots

Screenshot #0
Screenshot #1

Contributors

One poor developer...
Eloy Lafuente (stronk7) (Lead maintainer)
Víctor Déniz Falcón
Sara Arjona Téllez
Please login to view contributors details and/or to contact them

Comments RSS

显示评论
  • One poor developer...
    2015年08月11日 星期二 00:27
    LOL, Urs.

    I don't recommend to ignore warnings. In fact, I do recommend to check both errors and warnings. More yet, I do check both always.

    I only say that, while errors are clear violations, warnings can be understood as recommendations. If you decide to follow or ignore them it's up to you. Personally I follow them, it's not so hard, really. But your choice, anyway.

    Ciao 微笑
  • Nguyễn Tuấn Anh
    2015年12月1日 星期二 22:30
    I don't understand, used plugins like?
  • Gareth J Barnard
    2015年12月18日 星期五 07:44
  • Ruslan Kabalin
    2016年03月1日 星期二 22:50
    "More documentation" link above should probably point to https://docs.moodle.org/dev/CodeSniffer rather than style documentation. Not sure though.
  • Derek Henderson
    2016年10月5日 星期三 23:16
    Would it be possible to include the latest version of the PHPCompatibility sniff and also add in the ability to pass in versions, so the code can be tested against different versions?
  • One poor developer...
    2016年11月21日 星期一 05:19
    Hi Derek, just for reference, there is https://tracker.moodle.org/browse/CONTRIB-5158 about that. It's old, but any movement towards that feature should happen there.
  • Dasu Gunathunga
    2017年08月1日 星期二 10:59
    Hi Tim,
    This doesn't check the column names in install.xml file. There is a coding standard for the column names as well. "Column names should be always lowercase, simple and short, following the same rules as for variable names. (https://docs.moodle.org/dev/Database)".
  • Tim
    2017年08月1日 星期二 15:28
    You should be using the XMLDB editor built in to Moodle, to edit your database definitions (Admin -> Development -> XMLDB editor). That checks the rules for you. I agree it would be nice to have the same checks in codechecker, but not essential.
  • This is a picture of me
    2018年06月26日 星期二 03:38
    Hi there,

    What are the thoughts of having the code checker ignore code folding? Does code folding need to be defined in the Moodle coding style before being allowed in the code checker?

    /// <editor-fold desc="This is a bunch of code that does stuff">
    /// </editor-fold>
  • Tim
    2018年06月26日 星期二 05:43
    If you want a 'bunch of code that does stuff' (with documentation, code folding, etc.) surely that is a function, and refactoring Moodle code to make it more understandable is encouraged.

    I don't know which editor you are using for that syntax to work. I have never seen it before, but doing something just for one editor is less likely to be a sensible decision.

    So, given we want to encourage well-factored code, not long sprawling blocks of code, and we want to be editor-neutral, I am not enthusiastic about your suggestion.
  • Joseph Rézeau
    2019年01月18日 星期五 01:41
    Cannot install latest version 2019011500 on my localhost moodle box. It keeps telling me "There is a new version 2019011500 available!
    Release 2.9.2 - Selectivenesses"
  • One poor developer...
    2019年01月18日 星期五 01:53
    Yeah, you're right Joseph!

    I did forget to bump version.php and just discovered it when publishing the new version in the Plugins directory. Expect a new release soon (2.9.3) fixing that. Sorry for the troubles!
  • Joseph Rézeau
    2019年01月18日 星期五 06:44
    Consider yourself repented and forgiven, Eloy. Happy New Year 2019!
  • One poor developer...
    2019年01月18日 星期五 07:05
    Best wishes there too! Thanks! 微笑
  • xvlcw zero
    2019年03月12日 星期二 23:18
    Can you run Code-checker via the command line (e.g. for CI)? Following the README didn't work: https://moodle.org/mod/forum/discuss.php?d=383557
1 2 3
Please login to post comments