julia intellij idea plugin user manual · this user guide presents the julia plugi for intellij...

8
Julia IntelliJ IDEA Plugin User Manual Version 2.6.0.9

Upload: others

Post on 13-Jan-2020

34 views

Category:

Documents


0 download

TRANSCRIPT

JuliaIntelliJIDEAPluginUserManual

Version 2.6.0.9

IntroductionThis user guide presents the Julia plugi for Intellij Idea/Android Studio. Julia is a sta c analyzer that automa cally performsseman c analysis of Java code. The Intellij plugin allows a user to (i) set up the URL of the Julia Server and her creden als, (ii)select the op ons of the analysis and run it, and (iii) inspect the results. In addi on, this user guide explains step-by-step howto install the plugin.

Installation

First of all, you need to install the plugin by clicking File >Settings.The Settings panel will appear.

From there, choose Plugins from the list on the le and the Browserepositories... button.

Here just click on the Manage repositories... bu on to open theedit window

Julia IntelliJ IDEA Plugin User ManualCopyright © 2019 JuliaSoft. All rights reserved.

3

Click on the green + bu on of the Add Repository panel, and thenenter:http://static.juliasoft.com/intellij-plugin/latest/pluginRepository.xml

Finally, you have to click on the Install bu on to start the downloadand installation of the Julia plugin.

At the end of the installation, you will need to restart the IDE.

Settings

The menu bar will show a new menu Julia

Analyze with Julia will open the wizard to set up and startthe analysisShow Julia Analysis View will open in the view panel theJulia Analysis view (see “Accessing the results” for moredetails)Import Analysis from File... will allow you to load the resultsof previous analyses saved in a .xml fileRetrieve Analysis from Server… will allow you to load theresults of previous analysesPreferences... will open a panel to specify the server and thecredentials to run the analysis (see below).

Julia IntelliJ IDEA Plugin User ManualCopyright © 2019 JuliaSoft. All rights reserved.

4

In the Preferences panel, you can specify the connec on data tothe Julia server (URL, Access Key and Secret Key). You can also saveconnec on data profiles, to reuse them among different projects.A er entering the connec on data, you can acquire your list ofsolutions and select one of them.

Running JuliaYou have two ways to run Julia:

1. From the menu bar, click Julia and then Analyze with Julia

2. From the contextual menu of a module: Julia >Analyze module with Julia Static Analyzer

Either way, the Julia Analysis wizard will appear. Select themodules you want to analyze (le side) and the dependencies toinclude (right side)

Julia IntelliJ IDEA Plugin User ManualCopyright © 2019 JuliaSoft. All rights reserved.

5

Set the analysis op ons: what entry points the analysis shouldconsider, the framework to use, whether to include .properties filesand so on

Select the checkers you want to apply; checkers are represented ina tree view (le part) and many of them have some op ons (theirchildren).Once you select a checker, you may choose to select some of itsop ons too (its children in the tree); the right panel will alwayshelp you showing a brief explana on of the currently selectedchecker/option in the tree.For each op on, you can select a specific value (e.g., true or false)through a drop down menu at the bottom.In the bo om le area you can save or load Configurations, i.e.named templates of the current wizard selec ons, for easily launcha similar analisys at a later time.

We strongly encourage to run only the “Basic” checkers as default, and run more “Advanced” checkers only if needed. Julia’swebsite (https://static.juliasoft.com/docs/latest/checkers.html) contains the exhaustive explanation of all Julia checkers.

Finally, the analysis can be launched by clicking Finish. A dialogwill tell you how many credits the analysis will cost. If you want toproceed, click “Ok” and the credit will be deducted from youaccount. Otherwise, click Cancel and the credits will not bedebited.

During the analysis, in the bo om Julia view you can monitor thestatus of the analysis. It will become green once the analysis willbe finished.

You can monitor the progress of the analysis in the Event log.

Navigating the Results

Julia IntelliJ IDEA Plugin User ManualCopyright © 2019 JuliaSoft. All rights reserved.

6

At the end of the analysis, the view “Julia Analyses” will show theresults. In par cular, in the le area you can access the list ofanalyses you ran. Once chosen one of them, the central area of theview will display all the warnings in a tree structure. You can theninspect the warnings produced by different checkers, on differentpackages, etc… If you double click on a warning, the line of thesource code that produced that warning is displayed. Finally, theright part of the Julia analyses panel shows the details of thewarning. The IntelliJ Idea/Android Studio code editor containsmarkers on the le bar to iden fy the code lines that raised awarning. Different colors represent different severi es (red forhigh, yellow for medium, and green for low severity).

You can decide to group the warnings in the central panel of the

Julia view in different ways. Just click and a dialog showing allthe grouping possibili es will appear. You can decide the order andthe types of categories you want to apply to group warnings.

The warnings will be then displayed with the new grouping in thecentral panel.

Managing analyses’ results

In the le part of the Julia analyses view, you can select among allthe analyses you ran. Each me you click on an analysis, thewarnings’ tree will be loaded, and the markers will be updated tothe ones of the selected analysis. If you right click the name of theanalysis in the le panel, you can “Reload from the server” theanalysis’ results. This feature is par cularly useful if you exit theIDE while the analysis is running, and you want to load the resultslater. In addi on, from this drop-down menu you can copy theanalysis ID, rename or delete the analysis.

You can export the result of the analysis: click and select whereto save the .xml file.

You can import the results of a completed analysis through

Julia IntelliJ IDEA Plugin User ManualCopyright © 2019 JuliaSoft. All rights reserved.

7

1) an .xml file by clicking and selec ng the file you want toimport

2) by clicking “Retrieve Analysis from Server…” from the Julia’sMenu bar, and then inser ng the analysis id you want to load fromthe server for your current “Active Solution”.

The pdf report of the analysis can be downloaded by clicking “Savegenerated files” and then the report you want to download.

Extraction of the application under analysisThe Julia analyzer computes a set of methods and constructors that are assumed to be callable from the user of the programunder analysis. They are called entry points. This means that the sta c analysis is performed as if the entry points were theonly methods that can be called from the user of the code. Of course, if the entry points call other methods, these othermethods are analyzed as well, and so on. Julia selects the set of entry points according to three possible alternatives:

1. Only main. With this modality, Julia automa cally selects as entry points the main() methods and all methods thatoverride a library method, such as run() methods of threads or equals() methods. This also includes eventhandlers of Swing or Android. Moreover, entry points explicitly marked as such by the programmer are considered.

2. All public entries. With this modality, Julia automa cally selects as entry points those selected with the previousmodality, plus all public methods and constructors.

3. All accessible. With this modality, Julia behaves as in the previous modality but assumes that non-final methods can beredefined in subclasses. This allows one to analyze classes that are expected to be subclassed by the user of the code.Note, however, that this reduces the precision of the analysis, since most data flow inferences cannot be performedanymore (the code might change its behavior by subclassing).

Julia IntelliJ IDEA Plugin User ManualCopyright © 2019 JuliaSoft. All rights reserved.

8

JuliaSoft is an innovative technology company specialized inadvanced code analysis solutions. For more information on thetechnology and our solutions please visit our website atwww.juliasoft.com

For any information please don’t hesitate to contact us:

JULIASOFT SRLManagement and Coordination by Corvallis Holding S.p.A.Lungadige Galtarossa, 2137133 Verona, ItalyTel +39 045 [email protected]

For technical support please write [email protected]

Julia IntelliJ IDEA Plugin User ManualCopyright © 2019 JuliaSoft. All rights reserved.

9