Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 SonarQube Runner.

...

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

Unit Tests

...

and Code Coverage Reports

If you want to display unit test results on dashboards, execute your unit tests before running the SonarQube analysis and set the:

...

To navigate the AST, download the SSLR Flex Toolkit.

Troubleshooting

The FlexPMD engine - that , which is embedded in the Flex plugin, suffers from some bugs which can break the SonarQube analysesSonarQube analysis. 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 makes 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; 
    } 
} 

...