Using Codemod Insights
1
Create a dashboard
Dashboards help you keep your insights’ widgets organized.For example, you can create a dashboard called 
i18n migration
to organize all widgets related to your i18n migration.To create a new dashboard, go to Insights -> Create Dashboard
.
2
Create a widget
Once you’re in your new dashboard, you can create a new widget.Widgets help you get useful insights about a variety of patterns in your codebase.Currently, you can create 
Timeseries chart
, Single number
, or Table
widgets.
3
Setting up your widget
Widgets allow you to track and visualize insights by running queries over your codebase. Each query represents an
ast-grep
YAML rule that is applied to your repository.Start by specifying a code pattern you would like to track and visualize. You can generate ast-grep rules with the help of AI using Codemod Studio.For each quer, you can specify:ast-grep
rule (generate rules easily with codemod studio)- match type, can be occurrence counts or file counts
- target repository
- query label
- group options
- date/commit hash (for Single number and Table widgets)
When configuring widgets, you can add multiple queries to extend the information a widget provides. Additionally, you can aggregate the results of multiple queries by specifying a formula. To refer to a query’s value in a formula, use the query’s name (alphabetical order index).
