能力标签
🛠
AI工具

AI代码质量检测

基于 Python · 开源免费,本地部署,数据完全自主可控
英文名:AI-SLOP-Detector
⭐ 61 Stars 🍴 6 Forks 💻 Python 📄 MIT 🏷 AI 8.0分
8.0AI 综合评分
ai-code-qualityai-detectioncode-analyzer
✦ AI Skill Hub 推荐

AI代码质量检测 是 AI Skill Hub 本期精选AI工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

AI代码质量检测 是一款基于 Python 的开源工具,在 GitHub 上收获 0k+ Star,是ai-code-quality、ai-detection、code-analyzer领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
AI代码质量检测 依赖 Python 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Python 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 AI代码质量检测 的版本更新,及时通知重要功能变化。

📋 工具概览

AI代码质量检测 是一款基于 Python 开发的开源工具,专注于 ai-code-quality、ai-detection、code-analyzer 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 61
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
MIT
AI 综合评分
8.0 分
工具类型
AI工具
Forks
6

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

AI代码质量检测 是一款基于 Python 开发的开源工具,专注于 ai-code-quality、ai-detection、code-analyzer 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:pip 安装(推荐)
pip install ai-slop-detector

# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install ai-slop-detector

# 方式三:从源码安装(获取最新功能)
git clone https://github.com/flamehaven01/AI-SLOP-Detector
cd AI-SLOP-Detector
pip install -e .

# 验证安装
python -c "import ai_slop_detector; print('安装成功')"
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
ai-slop-detector --help

# 基本用法
ai-slop-detector input_file -o output_file

# Python 代码中调用
import ai_slop_detector

# 示例
result = ai_slop_detector.process("input")
print(result)
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# ai-slop-detector 配置文件示例(config.yml)
app:
  name: "ai-slop-detector"
  debug: false
  log_level: "INFO"

# 运行时指定配置文件
ai-slop-detector --config config.yml

# 或通过环境变量配置
export AI_SLOP_DETECTOR_API_KEY="your-key"
export AI_SLOP_DETECTOR_OUTPUT_DIR="./output"
📑 README 深度解析 真实文档 完整度 81/100 含工作流图 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

<p align="center"> <img src="https://raw.githubusercontent.com/flamehaven01/AI-SLOP-Detector/main/docs/assets/AI%20SLop%20DETECTOR.png" alt="AI-SLOP Detector Logo" width="400"/> </p>

AI-SLOP Detector

<p align="center"> <a href="https://pypi.org/project/ai-slop-detector/"><img src="https://img.shields.io/pypi/v/ai-slop-detector.svg" alt="PyPI version"/></a> <a href="https://pepy.tech/project/ai-slop-detector"><img src="https://static.pepy.tech/badge/ai-slop-detector/month" alt="Downloads/month"/></a> <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="Python 3.8+"/></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT License"/></a> <br/> <a href="https://github.com/flamehaven01/AI-SLOP-Detector/actions"><img src="https://github.com/flamehaven01/AI-SLOP-Detector/actions/workflows/ci.yml/badge.svg" alt="CI"/></a> <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Black"/></a> <a href="https://github.com/flamehaven01/AI-SLOP-Detector/issues"><img src="https://img.shields.io/github/issues/flamehaven01/AI-SLOP-Detector.svg" alt="Issues"/></a> </p>

<p align="center"><b>Find AI-generated code that looks finished but isn't.</b></p>

<p align="center"> Catches what a normal linter passes over: empty functions with real-looking bodies, imports of things that don't exist, pipelines wired to nothing, copy-pasted logic, and docs that oversell what the code actually does.<br/> <b>Runs fully offline &middot; deterministic core scoring &middot; no API key, no model download, nothing leaves your machine.</b> </p>

Release track - Stable tag: v3.8.5 - Previous stable tag: v3.8.4 - v3.8.4 rewrites the documentation entry point in plain language (benefit-first README, "Why Not Just Use a Linter?" / "When NOT to Use This" sections, an acronym glossary in HOW_IT_WORKS, plain-meaning comments in CONFIGURATION) without changing any code or contracts. - v3.8.5 makes output dual-audience: the human summary hides internal algorithm names (no more vr_structural (exact MST)), while the JSON / agent / MCP output gains next_steps and metric_guide so AI agents receive the same actionable plan and metric semantics. JSON coherence_level is unchanged; new keys are additive.

---

Navigation: What Is It?Why Not a Linter?When Not to UseQuick StartVerificationBoundariesHow It WorksDocument MapWhat It DetectsScoringKey FeaturesCalibrationSecurityCI/CDConfigVS CodeRoadmapChangelogRelease NotesSchema Validation

---

Key Features

Bootstrap — domain-aware, one command to start

slop-detector --init                   # auto-detect domain, generate .slopconfig.yaml
slop-detector --init --domain web/api       # explicit domain override
slop-detector --init --adaptive-init --init-preview
slop-detector --init --adaptive-init --apply-init-suggestions
--init detects your project domain from file patterns (8 built-in profiles: general, scientific/ml, scientific/numerical, web/api, library/sdk, cli/tool, bio, finance) and pre-seeds the weight profile accordingly. Also secures .slopconfig.yaml in .gitignore by default.

Adaptive init is now a separate safety layer:

  • --init --adaptive-init --init-preview
  • scans the repository
  • prints evidence-backed config suggestions
  • writes nothing
  • --init --adaptive-init --apply-init-suggestions
  • opt-in merge path
  • preserves unknown handwritten keys
  • only applies conservative suggestions

---

JS/TS Analysis — optional tree-sitter path

pip install "ai-slop-detector[js]"
slop-detector --project ./src         # now includes .js/.jsx/.ts/.tsx files
Activates JSAnalyzer v2.8.0 with tree-sitter AST (regex fallback when not installed). Results appear under js_file_results in ProjectAnalysis and JSON output.

---

Go Analysis — regex-based, optional tree-sitter-go path

pip install "ai-slop-detector[go]"
slop-detector --project ./src         # now includes .go files
Activates GoAnalyzer v1.0.0. Detects: empty function stubs, panic() as error handling, fmt.Println/Printf debug prints, _ = ignored errors, TODO/FIXME comments, god functions (> 60 lines). Results appear under go_file_results in JSON output.

---

Self-Calibration — the tool learns your codebase

slop-detector . --self-calibrate               # see what your history recommends
slop-detector . --self-calibrate --apply-calibration  # write to .slopconfig.yaml
4D grid-search (ldr / inflation / ddc / purity) over your run history. Optimizes all four weight dimensions simultaneously. - Project-scopedhistory.db tags every record with a project_id (sha256 of cwd); calibration signal never mixes across different projects - Domain-anchored — grid search is constrained to ±0.15 around the current domain weights, preventing drift outside the domain's meaningful weight region - Drift warningsCalibrationResult.warnings flags any dimension that shifted > 0.25 from the anchor - Only applies when confidence gap between top two candidates exceeds 0.10 - Milestone is triggered by files re-scanned (not raw record count), avoiding false triggers on first-time project scans

docs/SELF_CALIBRATION.md →

---

History Tracking — longitudinal quality analysis

slop-detector mycode.py --show-history   # per-file trend
slop-detector --history-trends           # 7-day project aggregate
slop-detector --export-history data.jsonl
Every run auto-recorded to ~/.slop-detector/history.db. The history database is the training signal for ML self-calibration. docs/HISTORY_TRACKING.md →

---

Release Highlights

VersionHighlights
**v3.8.3**human-friendly metric output (value / healthy direction / what it means + deficit bands) and deterministic Next Steps across rich/text/markdown; VS Code webview surfaces (4D breakdown, cleanup plan, pulse, diff-aware review); fixes for dead-code semantics, adaptive-init config preservation, and unused-deps stdlib / dev-tool false positives
**v3.8.2**adaptive --init adds bounded repo-signal suggestions and preview/merge flows; npm wrapper adds typed contracts, Node API, and agent workflow docs; local impact tracking and opt-in telemetry become first-class observability surfaces
**v3.8.1**cleanup-family outputs become confidence-ranked action plans; unused-deps grows manifest hygiene for pyproject.toml / package.json; boundary-violations gains opt-in layered architecture review with explicit rule evidence
**v3.7.9****Governance gate**: verify-governance fail-closed CLI, deterministic governance-record verification, and a formal split between scoring math and enforcement
**v3.7.3****Hotfix**: pydantic import wrapped in try/except ImportError — package imports cleanly in stripped environments; test_api_models.py guard corrected to fastapi; CI Docker login continue-on-error, quality gate pinned to >=3.7.3
**v3.7.2****Core schema validation**: config.py Pydantic guards catch bad .slopconfig.yaml at load time (wrong weight types, domain_overrides non-int thresholds); LDRResult / DDCResult / InflationResult __post_init__ clamps protect GQG math.log(); HistoryEntry sanitises all LEDA calibration inputs + validates fired_rules JSON; **VS Code**: schema.ts ISlopReport interfaces + parseSlopReport() handwritten discriminated-union guard — schema mismatch surfaces exact field path before silent NaN
**v3.7.1**LintEscapePattern docstring FP fix; self-scan avg_deficit 13.85 → 9.80; global_injector.py Patch 1 removed; .slopconfig.yaml domain_overrides expanded; **Skill**: 3-Phase Pipeline (Triage → Deep-Dive → Action Plan), /slop-delta before/after comparison, Confidence Routing by status band, → Next: guidance per command; **VS Code**: P1 monolith → 8 focused modules, P2 SlopCodeActionProvider (QuickFix for phantom_import/god_function/lint_escape), P3 TreeView sidebar (3-level hierarchy), P4 SlopCodeLensProvider (file summary + per-function hints)
**v3.7.0**Dogfooding calibration + SKILL.md OSOT repair (10 violations); cli_renderer.py split (730 lines → 4 renderer modules); python_advanced.py split (1150 lines → 5 modules); BUG-1 ddc weight 0.30→0.20; BUG-2 findings filter threshold fix; BUG-3 AST-accurate test counts; BUG-5 block-scoped YAML rewrite in self_calibrator; 314 tests GREEN
**v3.6.0**Claude Code Skill (/slop, /slop-file, /slop-gate, /slop-spar); CI gate bugfix (--ci-mode hard now exits non-zero without --ci-report); pre-commit hooks rewritten (python -m entry, 3 hook variants); VS Code Extension v3.6.0 VSIX; docs: Purity row, weight normalization note, [go] extra; 311 tests GREEN
**v3.5.0**Domain-aware --init (8 profiles, --domain flag); JS/TS analysis via JSAnalyzer v2.8.0 + [js]; Go analysis via GoAnalyzer v1.0.0 + [go]; self-calibration patches: project-scoped history (project_id), re-scan milestone trigger, domain-anchored grid search (±0.15), CalibrationResult.warnings (drift > 0.25); 308 tests GREEN
**v3.4.1**FileRole.STUB (Protocol/ABC stubs skip ldr+patterns); auto-discover .slopconfig.yaml; Python 3.8 CI compat; mypy attr-defined fix
**v3.4.0**Per-rule FP rate tracking (LEDA Phase 2A); purity weight ceiling MAX_PURITY_WEIGHT=0.25 (Phase 2B)
**v3.3.0**File role classifier (SOURCE/INIT/RE_EXPORT/TEST/MODEL/CORPUS); DDC annotation-only import fix; # noqa: F401 + __all__ re-export recognition
**v3.2.1**Auto-calibration at every 10-scan milestone (no manual cmd); P2 git noise filter; P3 per-class thresholds (5+5); calibrate() min_events bugfix; 11/11 e2e GREEN
**v3.2.0**4D calibration (purity dimension); --init bootstrap; auto-calibration hints; 44/44 self-scan CLEAN
**v3.1.2**data_collector refactor; slopconfig gap fill; 43/43 self-scan CLEAN
**v3.1.1**Clone Detection in Core Metrics table; table style unification; VS Code UX
**v3.1.0**3 new adversarial patterns (function_clone_cluster, placeholder_variable_naming, return_constant_stub); GQG calibrator alignment; fhval SPAR-Code
**v3.0.2**Phantom import 3-tier classification; __init__.py LDR fix; god_function LOW demotion
**v3.0.0**Geometric mean scorer (GQG); purity dimension; DCF per-file; structural coherence
**v2.9.3**Self-calibration engine; weight grid-search from usage history
**v2.9.0**phantom_import CRITICAL detection; history auto-tracking

Full Release Notes → · Changelog →

---

No install required

uvx ai-slop-detector mycode.py ```

The npm surface is intentionally thin:

- it does not reimplement analysis logic - it delegates into the Python CLI/runtime - it exists for Node-first teams that want npx-style entry without changing product semantics - it requires a Python backend and discovers it in this order: AI_SLOP_DETECTOR_EXECUTABLE -> active VIRTUAL_ENV -> PATH executables -> python -m slop_detector.cli - it ships version-pinned TypeScript interfaces at ai-slop-detector/types - it exports a small async Node API for scanProject, reviewChanges, computeHealth, and runCleanupFamily

Windows / PowerShell tip: PowerShell > redirection writes UTF-16 LE or UTF-8 with BOM by default, which breaks json.load(..., encoding='utf-8'). Use --output <path> instead — it writes UTF-8 bytes (no BOM) directly, skipping the shell.

<p align="center"> <img src="docs/assets/cli-output.png" alt="CLI Output Example" width="800"/> </p>

---

Quick Start

```bash pip install "ai-slop-detector>=3.8.2"

slop-detector scan . # canonical analysis entry slop-detector review . --json # canonical changed-code review slop-detector pulse . --json # canonical repo health view slop-detector sweep dead-code . --json # canonical cleanup family

Optional extras

pip install "ai-slop-detector[js]" # JS/TS tree-sitter analysis pip install "ai-slop-detector[go]" # Go tree-sitter analysis

`.slopconfig.yaml` sensitivity

Your .slopconfig.yaml contains domain_overrides — a precise map of which functions are exempt from complexity rules. This is effectively a codebase weakness surface: it reveals which areas are too complex to refactor right now.

Best practice: - Run slop-detector --init to generate .slopconfig.yaml and auto-add it to .gitignore - To share governance config with your team, explicitly remove .slopconfig.yaml from .gitignore - Open-source repos committing it is fine (transparency over obscurity — see this project's own .slopconfig.yaml)

.pre-commit-config.yaml

repos: - repo: https://github.com/flamehaven01/AI-SLOP-Detector rev: v3.7.3 hooks: - id: slop-detector # hard gate — fails on CRITICAL_DEFICIT >= 70 # - id: slop-detector-warn # soft mode — reports only, never blocks # - id: slop-detector-patterns # fast per-file pattern scan


**GitHub Actions** (runs on every PR):
yaml

Configuration

```yaml

.slopconfig.yaml

weights: ldr: 0.40 inflation: 0.30 ddc: 0.20 purity: 0.10

patterns: god_function: domain_overrides: - function_pattern: "check_node" # AST walker — complex by design complexity_threshold: 30 lines_threshold: 200

ignore: - "tests/" - "/init.py"

advanced: exact_topology_ceiling: 300 topology_mode_above_ceiling: deterministic_approximate analysis_cache_enabled: true analysis_cache_db: "" churn_commit_window: 200 coverage_data_file: ".coverage" hotspot_limit: 10 hotspot_weights: deficit: 0.50 churn: 0.30 coverage_gap: 0.20

architecture: enabled: true preset: layered layers: [] ```

Full Configuration Guide → · Config Examples →

---

Programmatic Node API

import { scanProject, reviewChanges, computeHealth, runCleanupFamily } from "ai-slop-detector"

Claude Code Integration

```bash cp -r claude-skills/slop-detector ~/.claude/skills/

CI/CD Integration

pre-commit (runs on every commit): ```yaml

.github/workflows/quality-gate.yml

- name: AI-SLOP Gate run: | pip install "ai-slop-detector>=3.7.3" slop-detector --project . --ci-mode hard --ci-report


**Enforcement modes:**
bash --ci-mode soft # informational, never fails build --ci-mode hard # fails: deficit_score >= 70, critical_patterns >= 3, inflation >= 1.5, ddc < 0.5 --ci-mode quarantine # escalates repeat offenders after 3 violations ```

Full CI/CD Integration Guide →

---

VS Code Extension

Real-time inline diagnostics, debounced lint-on-type, ML score and purity signal in status bar. v3.7.1 rebuilt from a single 855-line monolith into eight focused modules.

What you see:

SurfaceDetail
Status bar$(error) SLOP 45.2 — severity icon + deficit score, updates on save
Inline diagnosticsPattern issues with line references — phantom imports, god functions, lint escapes
**TreeView sidebar**Activity bar panel: files sorted by deficit score, metric rows (LDR/DDC/Purity/Inflation), issue list with click-to-navigate
**CodeLens**Line 0: file summary (SLOP 45.2 — 3 CRITICAL); per-function: top severity icon + pattern IDs
**QuickFix (CodeAction)**Lightbulb on phantom_import/god_function/lint_escape diagnostics — show output or add to .slopconfig.yaml ignore
ML signalML: 73% [slop] in summary diagnostic when [ml] extra is installed

Commands (Ctrl+Shift+P > "SLOP"):

CommandDescription
Analyze Current FileOn-demand single-file scan
Analyze WorkspaceProject-wide scan, populates TreeView
Show 4D BreakdownWebview: penalty attribution — why a file is not 0.0
Show Cleanup PlanWebview: confidence-ranked sweep family (safe/needs/unsafe)
Show Pulse DashboardWebview: project health + priority hotspots
Show Changed-Code ReviewWebview: diff-aware review, new-vs-inherited slop
Auto-Fix Detected IssuesApply (or dry-run preview) auto-fixable patterns
Show Gate Decision (SNP)PASS/HALT with sr9/di2/jsd/ove metrics
Run Cross-File AnalysisDependency + clone graph across project
Show File HistoryPer-file deficit score trend
Show History Trends7-day project-wide daily trend table
Export History to JSONLDump history.db records for external analysis
Bootstrap .slopconfig.yamlDomain-aware config generation (--init)
Run Self-CalibrationLEDA 4D weight optimizer with one-click Apply

Install from the VS Code Marketplace or build locally:

cd vscode-extension
npm install
npx vsce package          # produces vscode-slop-detector-3.7.3.vsix
code --install-extension vscode-slop-detector-3.7.3.vsix

Settings (slopDetector.*): pythonPath, lintOnSave, lintOnType, failThreshold (default 50), warnThreshold (default 30), recordHistory, enableCodeLens (default true).

---

🎯 aiskill88 AI 点评 A 级 2026-06-07

高质量的AI代码质量检测工具

⚡ 核心功能

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

参考README.md
💡 AI Skill Hub 点评

经综合评估,AI代码质量检测 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

📚 深入学习 AI代码质量检测
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 AI-SLOP-Detector
Topics ai-code-qualityai-detectioncode-analyzer
GitHub https://github.com/flamehaven01/AI-SLOP-Detector
License MIT
语言 Python
🔗 原始来源
🐙 GitHub 仓库  https://github.com/flamehaven01/AI-SLOP-Detector 🌐 官方网站  https://flamehaven.space/work/ai-slop-detector/

收录时间:2026-06-07 · 更新时间:2026-06-07 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。