Skip to main content

Find code smells

io.moderne.prethink.quality.FindCodeSmells

Detect code smells including God Class, Feature Envy, and Data Class using composite metric thresholds with severity ratings.

Recipe source

This recipe is only available to users of Moderne.

This recipe is available under the Moderne Proprietary License.

Used by

This recipe is used as part of the following composite recipes:

Usage

This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI.

You will need to have configured the Moderne CLI on your machine before you can run the following command.

shell
mod run . --recipe FindCodeSmells

If the recipe is not available locally, then you can install it using:

mod config recipes jar install io.moderne.recipe:rewrite-prethink:0.4.1

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Code smells

io.moderne.prethink.table.CodeSmells

Detected code smells including God Class, Feature Envy, and Data Class with severity ratings and the metric evidence that triggered detection.

Column NameDescription
Source pathThe path to the source file containing the smell.
Class nameThe fully qualified name of the class.
Method nameThe method name, if the smell is method-level (e.g., Feature Envy). Null for class-level smells.
Smell typeThe type of code smell: GOD_CLASS, FEATURE_ENVY, or DATA_CLASS.
SeveritySeverity based on how far metrics exceed thresholds: LOW, MEDIUM, HIGH, or CRITICAL.
EvidenceThe metric values that triggered detection, e.g., 'WMC=52, TCC=0.21, ATFD=8'.