← All recipes
Moderne licensed

DevCenter card from a data table column

Recipe IDio.moderne.devcenter.BucketedMetricCard
Artifactio.moderne.recipe:rewrite-devcenter

Read rows from a previously emitted data table, aggregate a numeric column across all rows for this repository, and bucket the result into ordinal DevCenter measures.

Single recipeMSAL

Usage

You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe io.moderne.devcenter.BucketedMetricCard --recipe-option "inputDataTable=io.moderne.organizations.table.ClassCohesion" --recipe-option "cardName=Class cohesion (LCOM4)" --recipe-option "column=lcom4" --recipe-option "aggregation=AVERAGE" --recipe-option "buckets=[{"name": "LOW", "moreThan": 10}, {"name": "MEDIUM", "moreThan": 3}, {"name": "HIGH", "moreThan": 0}]"

If the recipe isn’t available locally, install it with:

mod config recipes jar install io.moderne.recipe:rewrite-devcenter:1.30.0

Options

NameTypeDescription
inputDataTablerequiredStringThe fully qualified class name of the data table to read rows from. This data table is expected to be populated by another recipe earlier in the same recipe list.
e.g. io.moderne.organizations.table.ClassCohesion
cardNamerequiredStringThe display name of this DevCenter card.
e.g. Class cohesion (LCOM4)
columnrequiredStringThe numeric column of the input data table to feed into the aggregation function.
e.g. lcom4
aggregationrequiredAggregationFunctionHow to reduce the column's values across all rows in the repository to a single representative value before bucketing. MIN, MAX, SUM, and AVERAGE operate on numeric values of the column. COUNT returns the number of rows the upstream data table emitted for this repository, regardless of column value. UNIQUE returns the number of distinct non-null values of the column. Matching is case-insensitive.
e.g. AVERAGE
bucketsrequiredBucket[]Ordered list of buckets. Each bucket has a name and an inclusive lower bound moreThan — a value is considered to fall into the bucket when value >= moreThan. When multiple buckets apply, the one with the largest moreThan wins. The list order defines the DevCenter measure ordinal: the first bucket maps to ordinal 0, the last to ordinal size - 1. This lets callers control which end of the scale the visualization renders as "worst" (lowest ordinal) versus "best" (highest ordinal).
e.g. [{"name": "LOW", "moreThan": 10}, {"name": "MEDIUM", "moreThan": 3}, {"name": "HIGH", "moreThan": 0}]

Data tables

Structured output this recipe can produce.

  • Upgrades and migrationsProgress towards organizational objectives on library or language migrations and upgrades.io.moderne.devcenter.table.UpgradesAndMigrations
  • 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
  • Source files that errored on a recipeThe details of all errors produced by a recipe run.org.openrewrite.table.SourcesFileErrors
  • Recipe performanceStatistics used in analyzing the performance of recipes.org.openrewrite.table.RecipeRunStats