npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codacy/tools-detekt-1

v0.2.1

Published

detekt adapter — CLI-mode Kotlin static analyzer

Readme

@codacy/tools-detekt-1

Table of Contents


Overview

Kotlin static analyzer using the detekt CLI JAR. Uses the CLI execution strategy -- spawns java -jar detekt-cli-all.jar via spawnTool() and parses its Checkstyle XML output.

| Property | Value | |----------|-------| | Tool ID | detekt | | Codacy UUID | cb36c32d-fc0d-4b4c-8f21-66e536ef4513 | | Strategy | CLI | | Languages | Kotlin | | Binary | detekt-cli-1.23.8-all.jar (downloaded from GitHub) | | File patterns | **/*.kt, **/*.kts |

Updating patterns

# Re-fetch pattern metadata from the Codacy API
pnpm prefetch

# Commit the result
git add src/patterns.json

Pattern IDs are bare rule names (no prefix): LongMethod, MagicNumber, ComplexCondition, etc.

Updating the detekt version

  1. Update DETEKT_VERSION and JAR_NAME in src/adapter.ts
  2. Update JAR_URL to point to the new release
  3. Run pnpm prefetch to check for new/removed rules
  4. Run pnpm test to verify compatibility
  5. If the major version changes, create a new adapter package (detekt-2/)

Development

pnpm build    # Build with tsup
pnpm test     # Run tests (requires java in PATH + detekt JAR)

To install detekt locally for testing:

# Download the all-in-one JAR
curl -L -o /tmp/codacy-detekt-test-tools/detekt-cli-1.23.8-all.jar \
  https://github.com/detekt/detekt/releases/download/v1.23.8/detekt-cli-1.23.8-all.jar

Notes for maintainers

  • detekt requires Java 8+ as a runtime. The adapter uses ensureJre() to download Adoptium Temurin JDK 17 if no system Java is found.
  • The detekt CLI JAR is an all-in-one fat JAR downloaded from GitHub releases to ctx.toolInstallDir.
  • Output format is Checkstyle 4.3 XML written to a temp file via --report xml:<path>.
  • --base-path <repoRoot> ensures file paths in the XML are relative to the repository root.
  • --parallel enables multi-threaded analysis for performance.
  • The source attribute in XML has format detekt.RuleName or detekt.ruleset.RuleName. The adapter strips the detekt. prefix and any ruleset prefix to get just the rule name.
  • Pattern IDs in patterns.json have no prefix -- they are bare rule names (e.g. LongMethod, not detekt_LongMethod).
  • Exit codes: 0 = no findings, 1 = findings found (build failure threshold), 2 = findings found, 3 = invalid config.
  • Config file detection supports detekt.yml and default-detekt-config.yml. When a local config is found, it is passed via --config <path>.
  • Pattern filtering is post-hoc: detekt runs with all default rules, then output is filtered by the enabled patterns set.