Moose tools
Moose comes with many tools. This page lists them, grouped by the step of an analysis they help with: getting a model, exploring it, querying it, visualizing it, running specialized analyses, and extending Moose.
Each tool is marked with how you get it:
- Default the tool is part of the default Moose image. Most tools are opened from the Moose menu of the menu bar.
- Load the tool must be loaded first, from the Library menu, under Famix > Load additional modules.
When a tool has its own documentation, its name links to it.
1. Getting a model into Moose
Section titled “1. Getting a model into Moose”Before any analysis you need a model of your system. It can be produced by a parser outside of Moose (for example VerveineJ for Java), then imported. See also Importing and exporting models.
| Tool | What it does | Availability |
|---|---|---|
| Models browser | The entry point of Moose. Lists the models in the image, imports new ones, and propagates the selected model. Imports from a JSON or MSE file, from a folder of files, or from Pharo code already in the image. | Default |
| Github Importer | Searches GitHub for a project, downloads the versions you choose, parses them with VerveineJ, and imports one model per version. Java projects only for now. Also available from the Models browser toolbar. | Default |
| Moose Nexus | Build automation and dependency management for models, similar to Maven or Gradle. Resolves the dependencies of a Java project (Maven, Gradle), runs VerveineJ, and keeps versioned models. | Load |
| Famix Java Fusionner | Scripting API (FamixFusionnerJava). Merges two Java models by replacing the stub entities of one model with their full definition from another model (for example a library). | Default |
2. Exploring a model
Section titled “2. Exploring a model”General-purpose tools to navigate a model, look at its entities and script on it.
| Tool | What it does | Input | Availability |
|---|---|---|---|
| MooseIDE Overview | Shows all open browsers and the buses they listen to. Use it to manage buses. | — | Default |
| Moose Inspector | The Pharo inspector connected to the buses. Navigates any entity and its relations. | A Moose entity | Default |
| Moose Playground | The Pharo playground connected to the buses. Write scripts on your models. Each model of the image is available as a variable, and the last received entity as receivedEntity. | Anything | Default |
| Notebook | A notebook mixing text cells (Microdown) and code cells, to document an analysis and export it as a report. | An entity of a model | Default |
| Source code | Shows the source code of an entity, with highlighting. | An entity with a source anchor | Default |
| Files | Explores the root folder of a model and shows the entities defined in each file. | A model with a root folder | Default |
| Aggregator Browser | Collects entities propagated from several tools, then propagates them all together. | Entities | Default |
| Logger | Shows the history of what was propagated on each bus. | — | Default |
| Spotter | The Pharo Spotter (Shift + Enter), extended to search entities in the models. | — | Default |
3. Querying and checking rules
Section titled “3. Querying and checking rules”Select the entities that answer your question, and check rules on a model. See also MooseQuery and Typical queries.
| Tool | What it does | Input | Availability |
|---|---|---|---|
| Queries Browser | Builds queries step by step, without code: filter by type, property, name, navigate relations, combine queries. Propagates the result. | A group of entities | Default |
| Queries dashboard | Shows predefined queries that apply to a model, with their results. | An entity of a model | Default |
| Moose Critic Browser | Defines rules as queries and lists their violations on a model. Rules can be exported and imported. | Entities | Default |
| MoTion | Declarative pattern matching on objects. Describes the shape of the entities you look for instead of writing navigation code. Scripting only. | — | Load |
4. Tagging
Section titled “4. Tagging”Tags let you mark entities by hand (or by script) to record what you learn during an analysis: “to remove”, “UI layer”, “checked”… Many visualizations can color entities by tag.
| Tool | What it does | Input | Availability |
|---|---|---|---|
| Tag browser | Creates tags, gives them a name and a color, puts them in a hierarchy, and adds or removes tagged entities. Tags can be exported and imported. | An entity of a model | Default |
5. Visualizing
Section titled “5. Visualizing”Structure of the system
Section titled “Structure of the system”| Tool | What it does | Input | Availability |
|---|---|---|---|
| Architectural map | Shows the containment hierarchy of entities (packages, classes, methods…) as nested boxes, with their tags. | Entities | Default |
| Distribution map | Shows how a property (for example a tag) is distributed over parts of the system (for example packages). | Entities | Default |
| Heat map | Like the distribution map, with entities colored by a numeric property. | Entities | Default |
| System complexity | Shows the class hierarchies, each class drawn as a box whose size and color show metrics (attributes, methods, lines of code). | A group of classes | Default |
| Class Blueprint | Shows the internal structure of one class: its methods and attributes, how they call each other, and which are dead. | A class | Default |
| UML | Draws a UML class diagram of the received types. Found under Moose > Old browsers. | Types | Default |
| Layer visualization | Partitions a model into layers and shows the links between them. Each system must describe its layers by subclassing MiLayerVisualizationModel. Not in the menu. | An entity of a model | Default |
| ClassName Distribution | Shows how the words used in class names (the concepts) are distributed over class hierarchies, for Java and Pharo. Opened from the Library menu once loaded. | A model | Load |
Dependencies
Section titled “Dependencies”| Tool | What it does | Input | Availability |
|---|---|---|---|
| Butterfly map | Shows the clients (left) and the providers (right) of a central entity, over several levels. | An entity | Default |
| Dependency Structural Matrix | Shows the dependencies between entities as a matrix and highlights the cycles. | Entities depending on each other | Default |
| Co Usage Map | Shows which containers (for example methods) use which used entities (for example attributes). Useful to split a class or to find cohesive groups. | A group of entities | Default |
| API Browser | Shows the dependencies between two subsystems: what a client subsystem uses from a provider subsystem. Listens to two buses, one per subsystem. | Methods or classes, on each bus | Load |
| Java call graph | Builds the call graph of Java methods, solving polymorphic calls. Also loads FAST Java. | Java methods | Load |
| Java call graph v2 | Second version of the Java call graph builder. Work in progress. | Java methods | Load |
6. Specialized analyses
Section titled “6. Specialized analyses”| Tool | What it does | Input | Availability |
|---|---|---|---|
| Dead code browser | Finds dead methods or functions, with a choice of heuristics. A first run finds the dead entities, and a recursion then adds the entities called only by dead ones. | Methods or functions | Default |
| Duplication browser | Finds code clones and shows the duplicated fragments side by side. | Entities with source code | Default |
| Bulk editor | Scripting API (MiBulkEditor). Rewrites Java source files in bulk, for example to comment out or remove a list of dead methods. | — | Default |
| Moose Security | Finds possible security vulnerabilities in a system, tags them and shows them. Work in progress. | — | Load |
7. Exporting results
Section titled “7. Exporting results”| Tool | What it does | Input | Availability |
|---|---|---|---|
| Entities exporter | Exports entities as a CSV file, with a comment per entity. | Entities | Default |
| Model Report | Generates a statistical report on a model in Markdown. You can edit it before exporting. | An entity of a model | Default |
| Model export | Exports a whole model as JSON or MSE, from the Models browser or by script. | A model | Default |
The Notebook and the Model Report (above) also produce documents you can export.
8. Meta-models (languages)
Section titled “8. Meta-models (languages)”A model follows a meta-model, which depends on the language of the analyzed system. Moose includes some meta-models by default, and others can be loaded.
Famix meta-models
Section titled “Famix meta-models”| Meta-model | Language | Availability |
|---|---|---|
| Famix Java | Java | Default |
| Famix Smalltalk | Pharo code, imported directly from the image. | Default |
| MoosePy | Python | Load |
| Famix-Fortran | Fortran | Load |
| Famix-Cpp | C++ | Load |
| Famix-SQL | SQL | Loaded by script |
FAST meta-models (abstract syntax trees)
Section titled “FAST meta-models (abstract syntax trees)”Famix models stop at the level of methods. FAST models describe what is inside them: statements and expressions. See FAST.
| Meta-model | Language | Availability |
|---|---|---|
| FAST Java | Java | Load |
| FAST Pharo | Pharo | Load |
| FAST Python | Python, with analyses such as control flow graphs, SSA and local resolution. | Load |
| FAST Fortran | Fortran | Load |
9. Extending Moose
Section titled “9. Extending Moose”Tools for people who build new meta-models, parsers or tools. See the Developers section.
| Tool | What it does | Availability |
|---|---|---|
| Famix meta-model builder | Defines a new meta-model by describing its entities and relations, and generates its code. | Default |
| Fame | The meta-meta-model below Famix. Also handles reading and writing models (JSON, MSE). | Default |
| Meta Browser | Browses a meta-model: its entities, their properties and their relations. Found under Moose > Old browsers. | Default |
| Famix UML Documentor | Scripting API (FamixUMLDocumentor). Generates a UML diagram of a meta-model, exported as PlantUML, Mermaid, LaTeX, text or Roassal. | Default |
| MooseQuery | The query API used by all the tools: navigate containment and dependencies between entities, whatever the meta-model. | Default |
| Roassal | The visualization engine used by the Moose visualizations. Use it to build your own. | Default |
| PetitParser | A framework to build parsers (PetitParser2). | Load |
| SmaCC | A parser generator, used for example to write importers for new languages. | Load |