Skip to main content

Detekt

Detekt is a static code analysis tool for Kotlin used in Android development. It identifies issues, enforces standards, and improves code quality by checking for code smells, performance issues, bugs, and adherence to best practices, with configurable rules and plugins for customization. Its integration into workflows promotes clean and efficient Kotlin codebases.

The Appcircle Detekt step executes the Detekt Gradle task. For further details, please refer to the Run detekt using the Detekt Gradle Plugin documentation.

Prerequisites

Below are the prerequisite workflow steps required before running the Detekt step, along with their reasons:

Prerequisite Workflow StepDescription
Git CloneThe Git Clone step is necessary to fetch the repository before conducting code checks and must precede the Detekt step.
Screenshot

Input Variables

Each component requires specific input variables for its operation. The input variables necessary for the Detekt step are:

Screenshot
Variable NameDescriptionStatus
$AC_DETEKT_TASKSpecifies the name of the Detekt task. The default value is detekt.Required
$AC_DETEKT_EXTRA_PARAMETERSAdditional command-line parameters for Detekt.Optional
$AC_DETEKT_SAVE_REPORTSpecifies whether the Detekt report will be saved. If set to true, report files will be saved into the artifacts folder. The default value is false.Optional
$AC_DETEKT_OUTPUT_PATHSpecifies the Detekt output path. If the AC_DETEKT_SAVE_REPORT input is set to true and this value is not defined, then <ac_module>/build/reports will be used as the default path.Optional
danger

If $AC_DETEKT_SAVE_REPORT is set to true, place the Export Build Artifacts step after the Detekt step to ensure proper transfer of outputs to the Download Artifacts section.

Output Variables

The output is not stored in any variable. If AC_DETEKT_SAVE_REPORT is set to true, the file output will be saved in the $AC_PROJECT_PATH/$AC_MODULE/build/reports directory (check these variables on the Appcircle-Specific Environment Variables page). If you've added the Export Build Artifacts step after the Detekt step, this output will also be accessible in the Download Artifacts section.


To access the source code of this component, please use the following link:

Preview of GitHub - appcircleio/appcircle-detekt-component