Drupal has coding standards as well as a tool to check for adherence, i.e. Coder.

However, Drupal.org does not provide a way to view this information.

Proposed Resolution

Use Code Climate (a free and open source platform, http://github.com/codeclimate/codeclimate) to generate this information.

This means adding a .codeclimate.yml file.

In addition to having Code Climate run PHPCS (coder) check, may I suggest also running PHPMD checks? There are some valuable checks, such as access to globals, complexity, and coupling.

CommentFileSizeAuthor
#2 2808731.patch616 bytesjosephdpurcell

Comments

josephdpurcell created an issue. See original summary.

josephdpurcell’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new616 bytes

It turns out there already is a code climate yml in 8.x-1.x. This patch just tweaks it to be similar to https://www.drupal.org/node/2808733.

josephdpurcell’s picture

  • jeqq committed a99696d on 8.x-1.x authored by josephdpurcell
    Issue #2808731 by josephdpurcell, jeqq: Add Code Climate config for...
jeqq’s picture

Status: Needs review » Fixed
josephdpurcell’s picture

Great! I've added the drupal.org link to Code Climate and you should be able to see results here: https://codeclimate.com/repos/57f26181e15679303d001016/feed (though I may need to add you to see them)

Also, the GitHub repo results should be able to be seen here: https://codeclimate.com/github/relaxedws/drupal-replication

As far as badges go, perhaps best to use the results from the drupal.org repo, which would be either of these:

<a href="https://codeclimate.com/repos/57f26181e15679303d001016/feed"><img src="https://codeclimate.com/repos/57f26181e15679303d001016/badges/3be3196507e8345b0573/gpa.svg" /></a>
[![Code Climate](https://codeclimate.com/repos/57f26181e15679303d001016/badges/3be3196507e8345b0573/gpa.svg)](https://codeclimate.com/repos/57f26181e15679303d001016/feed)

Instead you could use the github.com badges:

<a href="https://codeclimate.com/github/relaxedws/drupal-replication"><img src="https://codeclimate.com/github/relaxedws/drupal-replication/badges/gpa.svg" /></a>
[![Code Climate](https://codeclimate.com/github/relaxedws/drupal-replication/badges/gpa.svg)](https://codeclimate.com/github/relaxedws/drupal-replication)

Next step

You could add the badges to the README or to the d.o project page.

You can also now tie in pull requests to Code Climate. I believe you do this by going to /relaxedws/drupal-replication/settings/installations and selecting "Code Climate".

I'm excited to see how improvements evolve over time!

jeqq’s picture

Thank you Joseph! I've added the badge.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.