sfProjectAnalyserPlugin - 0.9.1

The sfProjectAnalyserPlugin allows you to analyse your symfony project, it can
raise several coding standards alerts. A YAML configuration file allows you to
switch what to analyse and also allows you to parameter threshold for each alert.

The sfProjectAnalyserPlugin allows you to analyse your symfony project, it can raise several coding standards alerts. A YAML configuration file allows you to switch what to analyse and also allows you to parameter threshold for each alert.

The sfProjectAnalyserPlugin allows you to analyse your symfony project, it can
raise several coding standards alerts. A YAML configuration file allows you to
switch what to analyse and also allows you to parameter threshold for each alert.

This plugin can be helpful in mainly two situations:

You quickly want to check the volumetry and code quality of a project your
are going to maintain.

While developing a project from scratch, as a continuous integration tool,
to ensure that as the project grows, you keep on following the symfony coding
standards you defined at the very beginning of your project.

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release 0.8.0 - 29/06/2010

sfProjectAnalyserPlugin

The sfProjectAnalyserPlugin allows you to analyse your symfony project, it can
raise several coding standards alerts. A YAML configuration file allows you to
switch what to analyse and also allows you to parameter threshold for each alert.

This plugin can be helpful in mainly two situations:

You quickly want to check the volumetry and code quality of a project your
are going to maintain.

While developing a project from scratch, as a continuous integration tool,
to ensure that as the project grows, you keep on following the symfony coding
standards you defined at the very beginning of your project.

Configuration

The plugin comes with a default configuration, but you can add several ones with
other rules and thresholds:

Copy the /plugins/sfProjectAnalyserPlugin/config/pdf_plugin_sfpa.yml into
the config folder of your application. Then this file will be used instead
of the plugin one.

Now, you can add your own configurations. You should keep the default one witch
is the basic configuration provided by the plugin.

# This is a custom analyser configuration
my_config:
# Global settings
global:
check_functions_docblock: true # Raise an alert if a function does not have its docblock
check_context_get_instance: true # Raise an alert is "sfContext::getInstance()" is encountered in the code
...

Usage

To use your own configuration just pass the config option to the task:

Where my_config is the config key name defined in your YAML file. (like above)

Demo

A demo is now included in the plugin, you can test it with a sandbox project for example.
Activate the plugin, activate the sfProjectAnalyser module in your settings.yml file,
then execute the task.
(Not parsed for now as of 0.9.0, copy it into one of your application to check the results
or use a sandbox)

TODO

1.0.0:

Analyse the layout and partials of an application - LV

Allow to parse custom actions files - LV

Parse activated plugins code

Provide 3 configurations (strict, standart, loose)

Add a Javascript folding system to have a cascade display (+ an "expand all" button) - NL

1.0.1:

Alert for ORM code at the action level

Average action line code length (+with comments)

Total of code lines (excluded from vendor and auto-generated stuff)

Average line code length by action

Number of classes (excluded from vendor and auto-generated stuff)

Number of queries

For now the plugin is quiet basic, so I need feedbacks to include new interesting
statistics and alerts.

PS: You can also send me a contribution request if you have good ideas. :)

Support

Please report bugs on the official plugin post on my symfony blog. (not posted yet :))
I may also answer if you ask on the symfony users mailing list.