This repository contains the artifact of the following two papers:
*Paper I: IntraJ: an On-demand Framework For Intraprocedural Java Code Analysis, Idriss Riouak π, GΓΆrel Hedin π, Niklas Fors π, and Christoph Reichenbach π,. Submitted to the Journal of System and Software.
*Paper II: A Precise Framework for Source-Level Control-Flow Analysis, Idriss Riouak π, Christoph Reichenbach π, GΓΆrel Hedin π and Niklas Fors π. Published at the 21st IEEE International Working Conference on Source Code Analysis & Manipulation, 2021 (SCAM 2021 π).
The repository contains:
-
IntraJ-LSP: an LSP-based plugin for the VSCode editor, which allows you to run IntraJ on Java source code.
-
IntraJ: a static analyser for Java source code and all its submodules:
We provide two different ways of getting and running IntraJ-LSP:
- Install IntraJ-LSP as a VSCode extension from the VSCode Marketplace. (Recommended)
- Build IntraJ-LSP from the artifact source code.
To install IntraJ as a VSCode extension, follow these steps:
- Install the VSCode editor.
- Install the extension from the VSCode Marketplace.
- Alternatively, search for
IntraJin the VSCode Extensions Marketplace.
See instruction video on YouTube
To build IntraJ-LSP the following tools are required:
- Java SDK version 8. (tested with SDK 1.8.0_275. See sdkman).
- VSCode Editor. (tested with 1.79.2. See VSCode).
To clone the IntraJ code, run, in your working directory:
git clone https://github.com/IdrissRio/IntraJ-LSP.git
Move to the IntraJ-LSP directory:
cd IntraJ-LSP
Recusively clone all the submodule
git submodule update --init --recursive
Build the extension using the following command:
./gradlew vsce
See instruction video on YouTube
The directory is structured as follow:
IntraJ-LSP
βββ build # Compiled files
βββ IntraJ # IntraJ source code
βββ src/java # IntraJ source code
| βββ magpiebridge # MagpieBridge source code
| βββ java
| βββ IntraJPlugin.java # Entry point for the plugin (Paper I Β§3)
βββ tools # IntraJ source code
| βββ magpiebridge.jar # Custom version of Jastadd (Paper I Β§3)
βββ vscode # VSCode extension source code (Paper I Β§3)
| βββ intraj.jar # IntraJ jar file
| βββ package.json # VSCode extension manifest
βββ LICENSE
βββ README.md
The directory is structured as follow:
.
βββ build # Compiled files
βββ extendj # ExtendJ source code
βββ resources # Scripts and logo
βββ src # IntraJ source code
| βββ jastadd
| | βββ CFG # CFG spec in Jastadd
| | βββ StaticAnalysis # Folder containing code-smells and data-flow analyses
| | βββ utils # Helpers for IntraJ
| βββ java
| βββ utils # General helpers for visualisation
| βββ test # JUnit test spec
βββ tools # IntraJ source code
| βββ jastadd-2.3.6-custom # Custom version of Jastadd
βββ testfiles # Automated test files
| βββ DataFlow
| βββ CFG
βββ eval.sh # Evaluation entry point
βββ LICENSE
βββ README.md
.
βββ jastadd
βββ CFG
| βββ IntraCFG
| | βββ CFG.ast # Lang-independent nodes
| | βββ IntraCFG.jrag # IntraCFG spec in Jastadd
| βββ java4 # (Paper II Β§3)
| | βββ Cache.jrag # Cache settings
| | βββ Exception.jrag # Exception spec (Paper II Β§3.c)
| | βββ Initializer.jrag # Initializers spec (Paper II Β§3.b)
| | βββ Java4.jrag # Java4 spec
| | βββ ImplictNodes.ast # Reified nodes
| βββ java5 # (Paper II Β§3)
| | βββ Java5.jrag # Java5 spec
| βββ java7 # (Paper II Β§3)
| | βββ Java7.jrag # Java7 spec
| βββ java8 #
| βββ Java8.jrag # Java8 spec
βββ StaticAnalysis # Data flow analyses spec (Paper II Β§4)
βββ CodeSmells # CodeSmells
βββ DataFlow # Dataflow Analyses
βββ DeadAssignment.jrag # (Paper II Β§4.c)
βββ ImplicitDeadAssignment.jrag # (Paper II Β§4.c)
βββ LiveVariableAnalysis.jrag # (Paper II Β§4.c)
βββ NullAnalysis.jrag # (Paper II Β§4.c)
βββ ReachingDefintion.jrag # (Paper II Β§4.c)
To use IntraJ as a standalone tool, visit the IntraJ repository and follow the instructions in the README.md.
Alternatively, from the root of the repository (i.e., IntraJ-LSP), run the following command:
cd IntraJ
and follow the instructions in the README.md.
To use IntraJ in CodeProber, visit the following webpage and follow the following instructions:
- Download the file named
artifact.zipand unzip it. - Follow the instruction in the README.pdf.
Figure 6in the README.pdf shows how to use show visualise the CFGs generated by IntraJ in CodeProber.
- π IntraJ: main repository for IntraJ (control-flow analysis for Java)
- π IntraCFG: main repository for IntraCFG (language-independent framework for control-flow analysis)
- π JastAdd: meta-compilation system that supports Reference Attribute Grammars. We used a custom JastAdd version which better supports interfaces.
- π ExtendJ: extensible Java compiler built using JastAdd. We built IntraJ as an Static Analysis Extension of ExtendJ. More can be found here.
IntraJ was awarded with the Research Object Badge (ROR) and the Open Research Badge
and the Open Research Badge (ORO) at ROSE Track of ICSME 2021.
| Repository | |
|---|---|
| Docker image | |
| Reserarch Object Badge | |
| Open Research Badge | |
