Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{iframe:src=http://update.sonarsource.org/plugins/flex-confluence.html|width=700|height=250300|frameborder=0}
Your browser does not support iframes.
{iframe}

...

The plugin enables analysis of ActionScript projects ActionScrip within SonarQube.It is compatible with the Issues Report plugin to run pre-commit local analysis.

  

Include Page
Include - Plugin Installation
Include - Plugin Installation

Usage

Run an Analysis with the SonarQube Runner (Recommended

...

method)

To run an analysis of your Flex project, use the the SonarQube Runner.

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

Run an Analysis with the other Analyzers

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

...

Code Coverage

...

To display code coverage data:

  1. Prior to the SonarQube analysis execute your unit tests

...

  1. and

...

  1. generate the Cobertura report.
  2. Import this report while running the SonarQube analysis by setting the sonar.flex.cobertura.reportPath property to the path to the Cobertura XML report. The path may be absolute or relative to the project base directory.

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

Metrics

See Metrics documentation page.

...

To navigate the AST, download the SSLR Flex Toolkit.

Troubleshooting

FlexPMD engine - that is embedded in the Flex plugin, suffers from some bugs which can break the SonarQube 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:

 

Code Block
        <!-- this crashes FlexPMD --> 
        <fx:Metadata> 
                <![CDATA[[HostComponent("spark.components.ToggleButton")]]]> 
        </fx:Metadata>      
        <!-- this crashes FlexPMD as well (note the space between the 2 opening brackets --> 
        <fx:Metadata> 
                <![CDATA[ [HostComponent("spark.components.ToggleButton")]]]> 
        </fx:Metadata>
        
        <!-- this does not crash --> 
        <!--fx:Metadata> 
                <![CDATA[ 
                [HostComponent("spark.components.ToggleButton")] 
                ]]> 
        </fx:Metadata--> 

 

    • in AS files:

 

Code Block
private function foo(partName:String):void 
{ 
  switch (partName) 
  { 
    /*comment*/ 
    case "test": 
      trace("foo"); 
      break; 
    case "foo": 
      trace("foo"); 
      break; 
    case "bar": 
      trace("foo"); 
      break; 
    } 
} 

 

Change Log

JIRA Issues
anonymoustrue
titleVersion 1.2
renderModestatic
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=18594&pid=11911&sorter/field=priority&sorter/order=DESC&tempMax=1000

 

JIRA Issues
anonymoustrue
titleVersion 1.1
renderModestatic
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=18370&pid=11911&sorter/field=priority&sorter/order=DESC&tempMax=1000

 

JIRA Issues
anonymoustrue
titleVersion 1.0.1
renderModestatic
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=18428&pid=11911&sorter/field=priority&sorter/order=DESC&tempMax=1000

Release Notes

Version 2.0

It is no longer possible to:

  • Let SonarQube drive the execution of unit tests.
  • Import unit test execution reports (feel free to vote for 
    JIRA
    serverjira.codehaus.org
    keySONARPLUGINS-3541
     to reintroduce this feature).