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 2808733.patch4.04 KBjosephdpurcell

Comments

josephdpurcell created an issue. See original summary.

josephdpurcell’s picture

Status: Active » Needs review
StatusFileSize
new4.04 KB

This PR adds the code climate yml as well as mess detector config.

josephdpurcell’s picture

josephdpurcell’s picture

Issue summary: View changes

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

Status: Needs review » Fixed

Thanks Joseph!

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/57f3ce1fee997a6796000705/feed (though I may need to add you to see the results here)

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

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/57f3ce1fee997a6796000705/feed"><img src="https://codeclimate.com/repos/57f3ce1fee997a6796000705/badges/db65ec88c3bc8bfae7ad/gpa.svg" /></a>
[![Code Climate](https://codeclimate.com/repos/57f3ce1fee997a6796000705/badges/db65ec88c3bc8bfae7ad/gpa.svg)](https://codeclimate.com/repos/57f3ce1fee997a6796000705/feed)

Instead you could use the github.com badges:

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

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 /timmillwood/drupal-workspace/settings/installations and selecting "Code Climate".

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

Status: Fixed » Needs work

The last submitted patch, 2: 2808733.patch, failed testing.

The last submitted patch, 2: 2808733.patch, failed testing.

The last submitted patch, 2: 2808733.patch, failed testing.

jeqq’s picture

Status: Needs work » Closed (works as designed)