sfProjectAnalyserPlugin - 0.8.0

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

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

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
    
  • 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

SQL Technologies