Dynamic Web Development with Seaside

14.2Slime at Work

Slime is not available on all Smalltalk platforms. To run Slime on Pharo follow these steps:

1. Open a scoped Browser. In most cases, you don’t want to run Slime in the default System Browser, as this would run the checks on the complete image. To open Slime on a specific package, you need to open a scoped browser. Click on a class of your package and select refactoring scope, then select the menu item package.

You should obtain a browser that only shows the contents of the package. Any tool or analysis of the refactoring browser is scoped to the visible context. Other than that, this is a normal code browser that you can use to edit your code. Figure 95 shows that the analysis will be performed on the classes contained in the Store package.

A scoped browser onto the Store package

2. Start the Code Checker. In the scoped browser, select refactor and then code critics. This opens a new window that starts to run all the Code Critics and Slime rules on the selected code.

The progress of the search is shown in the title bar of the Code Critics browser, depending on the size of the selected code the analyze might take a while. After a while the tool should update and display some categories and rules in bold, showing the number of detected problems as shown in Section 14.1.

The Code Critics Result Browser

3. Displaying the Problems. You can now start to walk through the list of detected problems. Note that this does not only list the Seaside specific problems, but also other more general problems. Most rules have a detailed description explaining the issue. When you select a bold entry and click on the open open, you can navigate to the actual problem in the code.

Copyright © 19 March 2024 Stéphane Ducasse, Lukas Renggli, C. David Shaffer, Rick Zaccone
This book is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

This book is published using Seaside, Magritte and the Pier book publishing engine.