What is Moose?
Moose is a platform to analyze software systems. It helps you answer questions about your code, such as “Which deprecated classes are still used?”, “What depends on this module?”, or “Where is this database table accessed?”.
To do so, Moose does not work directly on your source code: it works on a model of it.
How an analysis works
Section titled “How an analysis works”-
Parse your source code with a parser dedicated to its language (for example VerveineJ for Java). The parser produces a model file, usually in JSON.
-
Import this model file into Moose.
-
Explore and query the model using the Moose IDE browsers, or by writing small scripts.
Key concepts
Section titled “Key concepts”Model : A representation of your system as entities (packages, classes, methods, attributes, invocations, accesses…) and the relations between them.
Famix
: The family of meta-models used by Moose to describe models.
There is one meta-model per language: FamixJava, FamixTypeScript, FamixPython, FamixSQL…
When you import a model, you tell Moose which meta-model it follows (for example FamixJavaModel for a Java project).
Pharo : Moose is built on top of Pharo, a live programming environment. The scripts you write in Moose are written in Pharo (a Smalltalk dialect).
Pharo vocabulary you will meet
Section titled “Pharo vocabulary you will meet”Image : A Pharo environment saved as a file. A Moose image is a Pharo image with all the Moose tools installed. You can have several images side by side.
Pharo Launcher : The application used to download, create and launch images.
Playground : A window to write and execute code. Open it with Ctrl + O, Ctrl + W.
Inspector : A tool to look at any object, including a model or a list of entities, and to run scripts on it.