Practical code audits
A practical example of needing to perform a code audit (static analysis) to understand the current state of a codebase
In this module we're going to start looking at a practical application of ASTs when needing to maintain and refactor a codebase. Specifically, we want to create a new Button
component that will handle all of the button styles and functionality. It will make buttons consistent and allow making global button changes in a single component. However, there are already many usages of button
elements.
This module will cover performing a code audit to understand the existing usages of button
elements so we can create a Button
component that handles all existing functionality.
The following modules will cover how to transform those existing button
elements into Button
components, and then how to prevent future usages of button
elements.
For the remainder of this course we'll work with the codebase of a small sample app. We can then apply AST-based tooling to refactor it.
Intro to a sample codebase#
This page is a preview of Practical Abstract Syntax Trees