Skip to content

IdrissRio/IntraJ-LSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


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:

    • IntraCFG: a language-independent framework for control-flow analysis
    • ExtendJ: a Java compiler implemented using JastAdd
    • JastAdd: a metacompiler supporting reference attribute grammars

Get the IntraJ-LSP artifact

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.

Install IntraJ as a VSCode extension (i.e., IntraJ-LSP)

To install IntraJ as a VSCode extension, follow these steps:

  1. Install the VSCode editor.
    1. Install the extension from the VSCode Marketplace.
    2. Alternatively, search for IntraJ in the VSCode Extensions Marketplace.

See instruction video on YouTube

Build IntraJ-LSP from the source code

Prerequisites

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).

Build

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 IntraJ-LSP folder

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 IntraJ folder

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

The jastadd folder

.
└── 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)

Other IntraJ's Use Cases

Use IntraJ as a standalone tool

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.

Integration of IntraJ in CodeProber

To use IntraJ in CodeProber, visit the following webpage and follow the following instructions:

  • Download the file named artifact.zip and unzip it.
  • Follow the instruction in the README.pdf.
  • Figure 6 in the README.pdf shows how to use show visualise the CFGs generated by IntraJ in CodeProber.

Related repository repositories/links πŸ”—

  • πŸ—„ 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.

Awards

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 DOI
Docker image DOI
Reserarch Object Badge
Open Research Badge

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors