Language composition report
Recipe ID
org.openrewrite.LanguageCompositionArtifactorg.openrewrite.recipe:rewrite-allCounts the number of lines of the various kinds of source code and data formats parsed by OpenRewrite. Comments are not included in line counts. This recipe emits its results as two data tables, making no changes to any source file. One data table is per-file, the other is per-repository.
Single recipeApache 2.0
Add to your build
Get a download tokenSign in with GitHub or Google, and your token replaces YOUR_DOWNLOAD_TOKEN below. Free for open source recipes like this one.
~/.gradle/gradle.properties
codeGenomeUsername=you@example.com
codeGenomeToken=YOUR_DOWNLOAD_TOKEN
build.gradle.kts
plugins {
id("org.openrewrite.rewrite") version("latest.release")
}
rewrite {
activeRecipe("org.openrewrite.LanguageComposition")
}
repositories {
mavenCentral()
maven {
url = uri("https://artifacts.codegenomeproject.org/maven")
credentials {
username = providers.gradleProperty("codeGenomeUsername").get()
password = providers.gradleProperty("codeGenomeToken").get()
}
}
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-all:1.30.1")
}
Then run
./gradlew rewriteRunUsage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.LanguageCompositionIf the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-all:RELEASEData tables
Structured output this recipe can produce.
- Language composition reportCounts the number of files and lines of source code in the various formats OpenRewrite knows how to parse.
org.openrewrite.table.LanguageCompositionPerRepository - Per-folder language composition reportA list of folders and the language composition and line counts of their contents.
org.openrewrite.table.LanguageCompositionPerFolder - Per-file language composition reportA list of individual files and their language composition.
org.openrewrite.table.LanguageCompositionPerFile - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats