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

...

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

...

Code Coverage Reports

If you want to display unit test results on dashboards, code coverage data, prior to the SonarQube analysis execute your unit tests before running the SonarQube analysis and set theand generate the Cobertura report. Import this report while running the SonarQube analysis by setting:

  • sonar.dynamicAnalysis property to reuseReports
  • sonar.surefire.reportsPath property to the path to the directory containing the XML reportssonar.cobertura.reportPath property to the path to the Cobertura XML report

...

To navigate the AST, download the SSLR Flex Toolkit.

Troubleshooting

The FlexPMD engine, which is embedded in the Flex plugin, suffers from some bugs which can break SonarQube analysis. Here are some you might encounter if FlexPMD rules are activated in the Flex quality profile 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 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; 
    } 
}