Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Framework concepts

Gabor Szarnyas edited this page Nov 17, 2017 · 8 revisions

Framework concepts

Several concepts of this description are heavily in WIP state in the project.

Basic operational process

Codemodel-Rifle analyses ECMAScript 6 code repositories incrementally. The ultimate goal of the project is to give insights of ECMAScript 6 code repositories by performing static analysis on not only individual modules, but on several related JavaScript-modules connected to each other, providing a wider range of finding human errors.

Rifle begins the repository analysis procedure with parsing every .js-extensioned file (henceforth: Module or mainly CompilationUnit) with the Shift Java ES2016 parser into an AST. The given AST is then processed according to our custom logic defined in the ASTScopeProcessor class, transforming the AST into an ASG (Abstract Syntax Graph), and loading it into a Neo4j graph database. This way, we can define Cypher graph queries to manipulate the ASG and to find error-patterns in it.

At the beginning, every CompilationUnit of the analysed repository is a separate graph. At every repository check, we connect these separate graphs according to ECMAScript 6 import and export statements, so related CompilationUnits will be ASG-connected, enabling us to run queries involving multiple CompilationUnits. See Processing modules with Codemodel-Rifle.

Incrementality

One of the project's main points is to analyse repositories incrementally, reducing several minutes or even hours per repository analysis to several seconds. This is planned to be done via Git diffs: at every repository analysis, only the changed files are updated in the graph.

The analysis queries are planned to be run with FTSRG's ingraph Neo4j driver, which is incremental itself: it evaluates standing queries over a continously changing graph very effectively.