sfProjectAnalyserPlugin
0.8.0beta
for sf 1.4sf 1.3sf 1.2sf 1.1 MIT
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.
Features list:
Stats
- Count/list of applications, modules, actions (by project, application, module)
- Count/list of number of templates and partials (by module)
Alerts
- Alert for actions code length
- Alert for public non action methods in a module
- Alert for modules including too much actions
- Alert for functions without docblock
- Alert for calls of "sfContext::getInstance()
- Alert for templates and partials code length
- Alert for empty templates and partials
Developers
| Name |
Status |
Email |
Vernet Loïc |
lead |
rf.oohay <<ta>> lioc_frq
|
License
Plugin by Vernet Loïc aka COil. (qrf_coil[at]yahoo[dot]fr)
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.
Releases for sf 1.4
| Version |
License |
API |
Released |
|
1.0.3stable
|
MIT license |
1.0.3stable
|
10/05/2011 |
|
1.0.2stable
|
MIT license |
1.0.2stable
|
07/01/2011 |
|
1.0.1stable
|
MIT license |
1.0.1stable
|
21/12/2010 |
|
0.9.1beta
|
MIT license |
0.9.1beta
|
01/07/2010 |
|
0.8.0beta
|
MIT license |
0.8.0beta
|
29/06/2010 |
Releases for sf 1.3
| Version |
License |
API |
Released |
|
1.0.3stable
|
MIT license |
1.0.3stable
|
10/05/2011 |
|
1.0.2stable
|
MIT license |
1.0.2stable
|
07/01/2011 |
|
1.0.1stable
|
MIT license |
1.0.1stable
|
21/12/2010 |
|
0.9.1beta
|
MIT license |
0.9.1beta
|
01/07/2010 |
|
0.8.0beta
|
MIT license |
0.8.0beta
|
29/06/2010 |
Releases for sf 1.2
| Version |
License |
API |
Released |
|
1.0.3stable
|
MIT license |
1.0.3stable
|
10/05/2011 |
|
1.0.2stable
|
MIT license |
1.0.2stable
|
07/01/2011 |
|
1.0.1stable
|
MIT license |
1.0.1stable
|
21/12/2010 |
|
0.9.1beta
|
MIT license |
0.9.1beta
|
01/07/2010 |
|
0.8.0beta
|
MIT license |
0.8.0beta
|
29/06/2010 |
Releases for sf 1.1
| Version |
License |
API |
Released |
|
1.0.3stable
|
MIT license |
1.0.3stable
|
10/05/2011 |
|
1.0.2stable
|
MIT license |
1.0.2stable
|
07/01/2011 |
|
1.0.1stable
|
MIT license |
1.0.1stable
|
21/12/2010 |
|
0.9.1beta
|
MIT license |
0.9.1beta
|
01/07/2010 |
|
0.8.0beta
|
MIT license |
0.8.0beta
|
29/06/2010 |
Changelog for release 0.8.0 - 29/06/2010
- This is the 1st version of the plugin.
Other releases
Release 1.0.3 - 10/05/2011
- Fixed bug when having a module extending a base actions class but not overriding all its methods
- Modified the error message when a class is not found
Release 1.0.2 - 07/01/2011
- Fixed the return code values
- Fixed color for ignored objects
- Deleted the sfProjectAnanlyserPlugin from the default config
- Fixed wrong count of alerts when using the XML output
- Fixed the color reporting for modules
- Added the possibility to ignore files or objects
- Fixed symfony CS ! :-)
- Added plugin config controls so the user know its custom config file must be upgraded
- Added alert for $this->executeXXX code at action level
- Cleanup
Release 1.0.1 - 21/12/2010
- Added a config option 'output' that allows to render the output as XML instead of HTML
- Fixed missing files in Package.xml :|
Release 0.9.1 - 01/07/2010
- Added alerts for modules empty templates or partials
- Added alerts for too big modules templates or partials
- A demo module is now provided, it includes an example of each kind of alert
- Added count of modules templates and partials
- Refactored the way alerts are processed
- Switch percent to two digits
- Transfered the TODO list in the README file
- Added an alert for functions with "sfContext::getInstance" calls
- The parsing of the same named modules into different applications is now possible
- Added an alert for functions without docblock
- Corrected docblock length calculation
Release 0.8.0 - 29/06/2010
- This is the 1st version of the plugin.
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 alerts.
Features list:
- Count applications, modules, actions (by project, application, module)
- Alert for actions code length
- Alert for methods visibility in the actions classes
- Alert for modules including too much actions
Installation
Install the plugin
$ symfony plugin:install sfProjectAnalyserPlugin
- You can also checkout the svn repository
Clear you cache
$ symfony cc
Publish the assets of the plugin to have the alerts logos
$ symfony plugin:publish-assets
Run the analysis (using the default configuration)
$ php symfony project:analyse --application="frontend" --env="dev" > analysis.html
Then browse (locally) the generated html file "analysis.html"
Configuration
The plugin comes with a default configuration, but you can add several 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.
my_config:
# Global settings
global:
check_functions_docblock: true # Raise an alert if a function does not have its docblock
forbid_context_get_instance: false # 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:
$ php symfony project:analyse --application="frontend" --env="dev" --config="my_config" > analysis.html
Where my_config is the config key name defined in your YAML file. (like above)
Demo
(todo)
TODO
- Alert for functions without docblock (on/off)
- Alert for sfContext::getInstance (on/off)
- Alert for ORM code at the action level (on/off)
- A demo module witch will include an examples for all kinds of alerts
For now the plugin is quiet basic, so I need feedback to include new interesting
statistics and alerts.
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.
Have fun, COil ;)
Changelog
Check the changelog TAB of the plugin
This plugin is sponsored by SQL-Technologies
