Code Analysis in Studio
Before analyzing the source code in Studio, make sure you have either
|
On The Fly Results:
On The Fly Results
table/view will display the issues related to the project that user is working on. Project is determined based on the current active file (i.e. the file that user is working on) in Anypoint Studio.
Issues will be detected and reported as and when the connectors are configured in the editor. With this, the issues can be fixed even before they exists.
Follow the below steps to explore On The Fly Results
view.
-
Go to
Window
→Show View
→other
→Falcon Scan
→ selectOn the Fly Results
-
Open any mule project xml, the issues will be automatically detected and the results can be seen in
On the Fly Results
panel.-
NOTE:
On The Fly Results
scans the whole project corresponding to current mule project xml and displays the results
-
On The Fly Results Tab Features
The Results tab provides options such as start or stop analysis, sync rules from the server, reload on the fly results and helps us to quickly sort through the results based on file type, componenty type and severity.
-
Navigate to
Window
→Show View
→other
→Falcon Scan
→ selectOn the Fly Results
. The options are displayed at the top right corner. -
By default the analysis is active and will immediately report any issues it sees fit. Clicking on the
Stop Button
will stop the analysis. You can start it at a later time once a part of your development is completed. -
Your organization might have added new rules or updated the rules in server. By clicking on the
Sync Rules
option, you will be importing these updated rules onto anypoint studio. -
By Clicking on
Reload on the fly results
option, your project will be validated against the rules to refresh the tab so as to display any new issues along with the previously displayed issues. -
The Issues seen in the On The Fly Results tab can be grouped based on file type, component type and severity.
-
Grouping based on
File Type
. -
Grouping based on
Component Type
. -
Grouping based on
Severity
.
-
Issue Fix Recommendation
On The Fly Results
precisely point out the problem in each file with line number, but many users might not be aware of issue fix.
Issue fix recommendation helps to deal with this scenario with detailed description and examples on how to fix the issue.
-
Double click on any issue that need a fix to open up the
Rule Description
view. -
Rule Description
view provides information about:-
Type of Issue. Eg:
Code Smell
,Bug
-
Detaild description of the violated rule/issue
-
Non Compliant Code Example
-
Compliant Code Example, which guides developers on how to fix the issue
-
Optionally, an external link to any official documentation for further information about the fix
-
Upload to Server
After development is complete, users might want to upload the project to server and save the analysis results or for any other purposes.
IZ Analyzer provides an easy option to upload project to server from Anypoint Studio.
This step assumes that the server details are configured well in advance as mentioned in Installing Studio Plugin SonarQube version 9.x and above requires Java version 11 to scan the projects. It is recommended to use Anypoint Studio version greater than 7.9.0 to use this feature with latest versions of SonarQube. |
-
Right click on the project that needs to be uploaded to server, click on
Falcon Scan - Server Upload
-
Fill in the values required for server upload and click on
Finish
:-
Project Key - Unique key of the project
-
Project Name - Display name of the project
-
Project version - Version of the project
-
-
Detailed logs of upload/scanner process will be displayed in
console
view -
Results of analysis can be further explored in web application dashboard