/
Static Analysis Plug-ins

Static Analysis Plug-ins

Korean

 

How to delegate "static analysis" action to the static analysis plug-ins

eg) dexter-findbugs plug-in

  • a static analysis plug-in should implements "IDexterPlugin" interface
  • and should add JSPF "@PluginImplementation" annotation.
  • Dexter PluginManager in dexter-executor project will use the static analysis plug-in by the IDexterPlugin interface.

IDexterPlug-in Interface

com.samsung.sec.dexter.core.plugin.IDexterPlugin.java in the dexter-core project

Two ways

  • JSPF Libraries(Dexter CLI) : add @PluginImplementation annotation
  • Eclipse Plug-in Extension Point (Eclipse Plugin) : implements IDexterPlugin

1) JSPF Libraries

2) Eclipse Plug-in Extension

refer to below example

 

How to create a static analysis plug-in

a sample plug-in : dexter-opensource.zip

1) Create Plugin Project

New > Plug-in Project

 

2) Edit MANIFEST.MF file

Overview tab

Dependencies tab

Runtime tab

Build tab

Extensions tab

  • add 'dexter-executor.DexterPlugin extension point
  • then, create your own XxxDexterPlugin class

3) Implements IDexterPlugin interface

this java file is create by "Extensions" tab in the previous step.

eg) counting number of ';' in a source file.

4) Run

eg) after creating a sample java file, the result looks like the below:

 

Sample Class Diagram for dexter-vd-cpp plug-in

init() Method

  • called only once when the static analysis is loading
  • CheckerConfig object should be initialized at that time

 

 

Related content