Diving into the world of code modernization can often feel like navigating a maze without a map, especially when it comes to refactoring and ensuring that your codebase is up to date and aligned.
Enter OpenRewrite—a tool that lets developers automate tedious code changes, framework migrations, and security upgrades. OpenRewrite was created to make effortless code management a reality for developers.
But why stop there? Scaling up the OpenRewrite concept to handle the vast expanses of enterprise-level codebases, we developed Moderne. The Moderne Platform is not just about upgrading a repository here and there; it's about taking on thousands at a time, giving developers the power they need to analyze, transform, and secure their code faster than ever before.
With OpenRewrite and Moderne, our goal has been to revolutionize the daunting task of code refactoring and analysis. Let's explore how OpenRewrite and Moderne each turn the chaos of code modernization and maintenance into straight-forward, automated tasks.
OpenRewrite: Automating developer refactoring
OpenRewrite is an open-source project that offers automated semantic analysis and refactoring of code, accessible to anyone to use and contribute to. It enables individual developers to perform type-aware searches and code changes in one repository at a time. OpenRewrite is integrated with build tooling and can be plugged into different workflows, including CI integrations.
OpenRewrite originated at Netflix, where Jonathan Schneider, creator and founder of OpenRewrite, worked in engineering tools. Netflix’s culture of freedom and responsibility led to code that didn’t conform to any single style. This culture also prevented a central team from imposing gates on product engineers, who could break the build when they saw a pattern they didn’t like.
Requests from the central team were too often met with: “I do not have time to deal with this, but if you do it for me, I’ll merge in the changes.” So eventually, Jonathan took it literally and built a tool to automate key changes. Prior to OpenRewrite, Jonathan created the Gradle Lint plugin, a popular plugin that manipulates Groovy build files and upgrades dependencies. Since it manipulated Groovy code backing build configuration, why not also source code?
The use of OpenRewrite expanded to Java when the central team wanted to stop maintaining an internal logging library, which originated before SLF4J, and replace it with standard SLF4J. At the time, it had been deprecated for six years, but because of Netflix’s culture, there were still countless references to this library in the Netflix codebase. With the adoption of OpenRewrite automation, it was removable at scale.


In the years since, OpenRewrite’s capabilities have been expanded from simple API changes to more complex framework migrations and CVE patching.
How OpenRewrite works: LSTs and recipes
OpenRewrite manipulates a Lossless Semantic Tree (LST) representation of code. LSTs are a foundational piece of what makes OpenRewrite so powerful. An LST goes beyond abstract syntax trees (ASTs). It is type-attributed, so it can accurately find and update code—with no false positives. Furthermore, it is format preserving, so it can make changes while keeping styles and format aligned with the surrounding code.

OpenRewrite calls a single code search or transformation operation a recipe. OpenRewrite provides a lot of building block recipes like “find method,” “change method,” “find transitive dependency,” “upgrade dependency,” or “exclude dependency.” These recipes, in turn, can be composed into more complex recipes by grouping them together into a composite recipe.
When the building blocks are not enough, developers can customize and write their own recipes. They can then share that recipe with others so many people can run it against their code.
There currently are more than 3,000 recipes in the OpenRewrite catalog of both free and proprietary recipes. Many recipes are available for individual users and companies to openly consume and customize for their own code. There is a group of OpenRewrite recipes that are created and maintained by Moderne specifically for multi-repo code analysis, security, and transformation that are commercially available.
OpenRewrite recipes were initially focused on code transformations. However, users often requested a way to search for issues before refactoring, so search functionality was added to address this need. This search functionality is actually a special code transformation behind the scenes: OpenRewrite adds markers on LST elements that match the search request. From there, the markers can be translated into text based on the developer’s wishes (usually as comments that contain TODOs, Jira issue numbers, etc.).
To identify every method invocation in a whole package of Google’s Guava library, we can instruct the recipe to perform this search:

The results show it isn’t looking for methods with particular names. OpenRewrite can actually prove that these method calls come from the desired package as shown below:

This recipe in plain OpenRewrite YAML looks like:
Give this a try by following the OpenRewrite Quickstart Guide or one of the tutorials, such as "Automatically fix Checkstyle violations" or “Migrate to Java 21.”
Moderne scales OpenRewrite for the enterprise
Moderne is a developer collaboration platform, enabling organizations to understand and evolve large codebases by running OpenRewrite recipes at scale. The platform also provides automated code insights and offers many more features that enable you to secure and maintain source code with speed and accuracy across your entire codebase. It scales horizontally across many repos at once—thousands of repos with millions of lines of code—as opposed to one repo at a time with OpenRewrite.

The Moderne Platform is not built directly on top of OpenRewrite. Instead, it relies on proprietary technology to efficiently apply OpenRewrite recipes to codebases at scale, enabling you to do in minutes what might take you hours, days, or weeks with OpenRewrite.
OpenRewrite is computationally expensive: it takes source code as text, produces LSTs for it using the compiler, applies the recipe, and then produces new source code as text. That means that for each recipe run, the OpenRewrite build tools must start from scratch.
The Moderne Platform batch-builds and serializes LSTs, and stores them on disk, enabling fast, real-time actions and analysis across your codebase all the time. This means that LSTs are built once, and then shared across teams for whatever work they are doing. It results in significant time and infrastructure cost savings.
See the difference here:
Central teams within companies, such as platform teams, are typically responsible for managing the Moderne Platform. They configure Moderne ingest for their organization’s codebase to produce LSTs en masse.
By operating on already produced and cached LSTs, the Moderne Platform produces OpenRewrite recipe results within minutes. Developers can search and transform code, examine diffs, and issue pull requests en masse that can later be reviewed and put through the usual CI/CD pipeline.
When applying recipes to modernize individual repositories, the benefit of running OpenRewrite recipes far outweighs the cost. However, running recipes at scale, especially those driving large-scale migrations, means you have to make sure the recipes will work as expected.
At Moderne, we use the platform when developing and testing such recipes with the open-source community. Moreover, we run and compile them daily to make sure there are no regressions. When you don’t rely on the open-source community to supply you with recipes, and want to build your own custom migrations, the Moderne Platform is essential. Moderne tools are free for open-source maintainers, and Moderne runs a free tenant for open-source software at app.moderne.io.
Read on to learn more about the key benefits and features of the Moderne Platform.
Code impact analysis in a fraction of the time and cost with Moderne
Traditionally, enterprise code impact analyses are expensive, lengthy, labor-intensive endeavors—costing in the millions of dollars, taking weeks or months of multiple engineers’ time to perform difficult, tedious work digging into code. It takes so long that results are typically outdated before the analysis is finished since code is always moving forward. The typical reward? Impact analysis paralysis and a failed code migration or modernization effort.
The Moderne Platform provides a new paradigm for performing large-scale code impact analyses. As a standard, built-in capability of Moderne, impact analyses can now be done in minutes—across any number of repositories and millions or billions of lines of code. The result? Impact analyses that are continuously up-to-date and actionable in real time because the capabilities are always-on.
Two key features of the Moderne Platform aid developers, platform engineers, and data engineers in performing code impact analysis easily and inexpensively:
- Data tables can be created in minutes and collect real-time, insightful data about dependencies, CVEs, licenses, version numbers, API usage—and pretty much any other information you want to know about your source code. You can learn more about data tables in our documentation, our blog, and our demo video.

- Code visualizations provide real-time clarity and insights into code modernization projects by revealing relationships across your codebase. They transform complex code data into meaningful visuals, helping developers analyze migration projects with precision while making code impacts clear and actionable for business leadership. Find out more about code visualizations in our documentation, our blog, and our demo video.

Multi-repo auto-refactoring and analysis with the Moderne CLI
The Moderne CLI (command line interface) enables developers to work locally to examine and auto-remediate code on multiple repositories. Essentially, the Moderne CLI was built to amplify the refactoring automation capacity and control that developers can have at their fingertips. The number of repos in play is only limited by the computing power of a developer’s own machine.
Many of the CLI commands are optimized for parallel execution across multiple repos. For example, it can run OpenRewrite recipes on pre-built LSTs simultaneously, so recipes can be quickly run on not just one repository but whole business units.
The Moderne CLI is also used to batch-build LSTs for mass ingestion into the platform.

By using the Moderne CLI in combination with the Moderne Platform, you can accelerate developer work across your organization plus align with multiple teams and business units to operate on the codebase at unprecedented scale.
Learn more about the Moderne CLI in our documentation and blog.
Collaboration across entire codebases with Moderne DevCenter
The Moderne Platform is designed as the code warehouse for modernization, enabling developers, central teams, and business leaders to always know the state of their codebase and collaborate to move their codebase forward. Two key collaboration features include:
- Moderne DevCenter dashboard allows engineering, security, business, and C-level executives to track and understand the state of code modernization and migration efforts across every level of an enterprise. It can be set to measure coding progress from the engineering-team level for multiple teams within your organization to the business-unit level and to the corporate-wide level.
Areas of the dashboard can be customized to provide business impact and code health metrics of the projects your leadership teams care most about. You can choose the relevant metrics, parameters and visualizations to show for each level of your organization. But just as importantly, the dashboard is the driver of automated upgrades and fixes with just a push of a button.

- Activity View in the Moderne Platform tracks recipe runs, commits, and visualizations produced over time. This creates a more collaborative experience on the platform, saves developers time when working within the platform, and provides better visibility to engineering teams of coding activities happening across the organization. To find out more about using the Moderne Activity View, check out our documentation and demo video.

With the Moderne Platform, organizations with large code bases are now able to be hyper-efficient with code modernization, migration, and security projects. Developers can search and transform code in real-time, ridding code of bad patterns, vulnerable dependencies, and older framework versions at speed—making sure they never come back. This provides greater cost efficiency and better use of developer resources. You can channel your development teams’ energy into creativity and driving innovation for your business and customers.
The Moderne Platform is offered in two editions:
- Moderne Platform Editions - Work on an organization’s codebase with horizontal scalability. Use the secure Moderne SaaS Platform along with the Moderne CLI for mass code refactoring and analytics. Standard and Enterprise editions are available.
- Moderne DX Edition - Work on an organization’s codebase in a fully air-gapped environment. Includes an on-premises Central Service that integrates with local Moderne CLI instances.
To get started with Moderne, you can try the product on open-source code (which is also free for community OSS use) or book a demo with us.
Moderne and OpenRewrite capability quick reference
For quick reference, check out the capabilities matrix comparing OpenRewrite and Moderne:
