Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 91 Next »

Live example


If you want to see a live example of the capabilities of the Flex plugin, you can have a look at the analysis of the AS3 Core Lib project on Nemo.

Description / Features

The plugin enables analysis of ActionScript projects within Sonar.

It is compatible with the Issues Report plugin to run pre-commit local analysis.


  1. Install the Flex plugin through the Update Center or download it into the SONAR_HOME/extensions/plugins directory
  2. Restart the Sonar server


Run a Sonar Analysis with the Sonar Runner (Recommended Way)

To launch a Sonar analysis of your Flex project, use the Sonar Runner.

A sample project is available on github that can be browsed or downloaded: /projects/languages/flex/flex-sonar-runner.

Run a Sonar Analysis with the other Analyzers

Maven and Ant can also be used to launch analysis on Flex projects.

Unit Tests an Code Coverage Reports

If you want to have unit test results in your Sonar dashboard, execute your unit tests before running the Sonar analysis and use the "sonar.dynamicAnalysis=reuseReports" property along with the "sonar.surefire.reportsPath" one to specify where Sonar should retrieve the XML reports.

You can provide the path to the code coverage report (in cobertura xml format) using the "sonar.cobertura.reportPath" property (the value must point to the file location, not its folder).


See Metrics documentation page.

Extending Coding Rules using XPath

New coding rules can be added using XPath. See the related documentation.

To navigate the AST, download the SSLR Flex Toolkit.


FlexPMD engine - that is embedded in the Flex plugin, suffers from some bugs which can break Sonar analyses. Here are some of them you might encounter if FlexPMD rules are activated in the Flex quality profile that you are using:

  • "fb:purpose="styling" attribute in MXML files causes OutOfMemory errors (see SONARPLUGINS-2400). 
    • Removing it fixes the issue.
  • the following code snippet make FlexPMD engine crash:
    • in MXML files:



    • in AS files:



Change Log


Version 1.2 (29 issues)

T Key Summary P
New Feature SONARPLUGINS-2076 Support ActionScript 2 Major
Bug SONARPLUGINS-2072 Unable to parse some files Major
Bug SONARPLUGINS-2207 flex pmd mxml file incorrectly identifies script and metadata blocks Major
Bug SONARPLUGINS-2206 Flex grammar is incorrect Major
Task SONARPLUGINS-2199 Remove metric comment_blank_lines Major
Bug SONARPLUGINS-2195 Grammar: incorrect AST for expression statement "b = a- 1" (no space between identifier and minus) Major
New Feature SONARPLUGINS-2181 Make the Flex plugin support the Developer Cockpit plugin by providing the measures comments and loc by line Major
Improvement SONARPLUGINS-2281 Severity of rule CommentedCode should be major by default, but not blocker Major
Bug SONARPLUGINS-2279 Grammar: ActionScript 3 syntactic keywords can be used as identifiers Major
Bug SONARPLUGINS-2280 Rule NestedIfDepthCheck should not produce false-positive in case of 'if-else-if' Major
Bug SONARPLUGINS-2277 Labelled statement should not be included into metric 'statements' Major
Improvement SONARPLUGINS-2275 Grammar: support "set variable" statement Major
Bug SONARPLUGINS-2273 Grammar: Should be possible to use xml namespaces Major
Bug SONARPLUGINS-2272 Grammar: Should be possible to use keyword as a name of xml node or attribute Major
Improvement SONARPLUGINS-2274 Grammar: support "intrinsic" keyword Major
Bug SONARPLUGINS-2271 Grammar: "include" / "import" and "use namespace" directives can be used as a statement Major
Bug SONARPLUGINS-2270 Grammar: semicolon can be omitted at the end of import/use namespace/include as for any other statement Major
New Feature SONARPLUGINS-2252 Rule: Do not use statements, operators and keywords specific to ActionScript 2 Major
Improvement SONARPLUGINS-2251 Grammar: support deprecated operators Major
Bug SONARPLUGINS-2246 Grammar: xml binding should be allowed for tag name and for attribute Major
Showing 20 out of 29 issues Refresh



Version 1.1 (26 issues)

Showing 20 out of 26 issues Refresh



Version 1.0.1 (2 issues)



Version 1.0 (12 issues)



Version 0.4 (3 issues)



Version 0.3.1 (1 issues)



Version 0.3 (8 issues)



Version 0.2 (1 issues)



Version 0.1 (11 issues)

  • No labels