Code-checker

Local plugins ::: 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:
686 sites
464 downloads
64 fans

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

Vis kommentarer
  • One poor developer...
    tir., 11 aug. 2015, 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 smiler
  • Nguyễn Tuấn Anh
    tir., 1 des. 2015, 22:30
    I don't understand, used plugins like?
  • Ruslan Kabalin
    tir., 1 mar. 2016, 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
    ons., 5 okt. 2016, 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...
    man., 21 nov. 2016, 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
    tir., 1 aug. 2017, 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
    tir., 1 aug. 2017, 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
    tir., 26 jun. 2018, 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
    tir., 26 jun. 2018, 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
    fre., 18 jan. 2019, 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...
    fre., 18 jan. 2019, 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
    fre., 18 jan. 2019, 06:44
    Consider yourself repented and forgiven, Eloy. Happy New Year 2019!
  • One poor developer...
    fre., 18 jan. 2019, 07:05
    Best wishes there too! Thanks! smiler
  • xvlcw zero
    tir., 12 mar. 2019, 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