Files
2nd/10_Wiki/Topics/DevOps_and_Security/코드 품질 관리 및 자동화 (Code Quality Management and Automation).md
T
Antigravity Agent f8b21af4be Wiki cleanup: error-doc removal, dedup merge, link normalization
10_Wiki/Topics 대규모 정리:
- 오류 캡처/미완성 stub 문서 227개 제거
- 교차폴더 중복 43클러스터 병합 (63파일 → redirect)
- 링크명 정규화: 깨진 링크 수정·redirect 직결·개념 매핑 ~2,400건
- 카테고리 MOC 6개 신규 생성
- Graph 섹션 미해결 related-keyword 링크 10,058건 제거

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 23:52:15 +09:00

6.8 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-코드-품질-관리-및-자동화-code-quality-mana 코드 품질 관리 및 자동화 (Code Quality Management and Automation) 10_Wiki/Topics verified self
Code Quality Management
Code Quality Automation
CI Quality Gates
none A 0.9 applied
code-quality
automation
ci-cd
devops
sast
2026-05-10 pending
language framework
typescript github-actions

코드 품질 관리 및 자동화 (Code Quality Management and Automation)

매 한 줄

"매 quality 의 의 의 의 manual review 의 의 의 X, 매 pipeline 의 의 의 의 의 enforce". 매 lint / format / type / test / coverage / security / performance 의 의 의 의 한 의 의 의 PR pipeline 의 의 의 의 의 의 quality gate. 매 2026 — 매 SonarQube + Semgrep + Claude review 의 의 의 의 standard.

매 핵심

매 Quality dimensions (ISO 25010)

  1. Functional suitability — 매 correctness, 매 completeness.
  2. Reliability — 매 fault tolerance, 매 availability.
  3. Performance — 매 response time, 매 throughput.
  4. Usability — 매 UX, 매 accessibility.
  5. Security — 매 confidentiality, 매 integrity.
  6. Maintainability — 매 modularity, 매 testability.
  7. Portability — 매 adaptability, 매 installability.

매 Automation pyramid

  • Pre-commit — 매 fast (sec) — format, lint, secret scan.
  • PR — 매 medium (min) — type, unit test, SAST, LLM review.
  • Main / nightly — 매 slow (hour) — integration, E2E, perf, DAST.
  • Production — 매 continuous — RUM, error tracking, drift.

매 Key metrics

  • Cyclomatic complexity — 매 path count.
  • Cognitive complexity (SonarSource) — 매 readability.
  • Test coverage — 매 line / branch / mutation.
  • Tech debt ratio — 매 SQALE method.
  • Code smells — 매 ESLint, SonarQube rule.
  • Duplicated lines — 매 PMD CPD.

매 2026 standard stack

  • Format: Prettier, Biome, Black, Ruff format, gofmt.
  • Lint: ESLint, Biome, Ruff, golangci-lint, Clippy.
  • Type: TypeScript, Pyright, mypy.
  • Test: Vitest, Jest, pytest, go test.
  • Coverage: c8, Istanbul, coverage.py.
  • SAST: Semgrep, CodeQL, Snyk.
  • Quality: SonarQube / SonarCloud.
  • AI: Claude Code Action, CodeRabbit, Greptile.

💻 패턴

매 Pre-commit (full)

# .pre-commit-config.yaml
default_install_hook_types: [pre-commit, commit-msg]
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-merge-conflict
  - repo: https://github.com/biomejs/pre-commit
    rev: v0.6.0
    hooks: [{id: biome-check}]
  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.20.0
    hooks: [{id: gitleaks}]
  - repo: https://github.com/commitizen-tools/commitizen
    rev: v4.0.0
    hooks: [{id: commitizen, stages: [commit-msg]}]

매 GitHub Actions — quality gate

name: Quality
on: [pull_request]
jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: actions/setup-node@v4
        with: { node-version: 22, cache: pnpm }
      - run: pnpm install --frozen-lockfile
      - run: pnpm exec biome ci .
      - run: pnpm exec tsc --noEmit
      - run: pnpm test --coverage
      - uses: codecov/codecov-action@v5
      - uses: returntocorp/semgrep-action@v1
      - uses: SonarSource/sonarcloud-github-action@v3
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
      - uses: anthropics/claude-code-action@v1
        with:
          model: claude-opus-4-7

매 SonarQube quality gate

# sonar-project.properties
sonar.projectKey=myorg_myrepo
sonar.organization=myorg
sonar.sources=src
sonar.tests=tests
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.qualitygate.wait=true

# 매 PR 의 의 의 의 의 fail 의 의 의 의:
# - new code coverage < 80%
# - new bugs > 0
# - new vulnerabilities > 0
# - new code smells > 5

매 Mutation testing (StrykerJS)

{
  "packageManager": "pnpm",
  "testRunner": "vitest",
  "coverageAnalysis": "perTest",
  "thresholds": { "high": 80, "low": 60, "break": 50 }
}

매 Performance budget (Lighthouse CI)

{
  "ci": {
    "collect": { "url": ["https://staging.example.com"] },
    "assert": {
      "assertions": {
        "categories:performance": ["error", { "minScore": 0.9 }],
        "interactive": ["error", { "maxNumericValue": 3000 }]
      }
    }
  }
}

매 Dependency audit

pnpm audit --prod --audit-level=high
trivy fs --severity HIGH,CRITICAL .
osv-scanner -r .

매 Visual regression (Playwright)

test("homepage matches snapshot", async ({ page }) => {
  await page.goto("/");
  await expect(page).toHaveScreenshot("homepage.png", {
    maxDiffPixelRatio: 0.01,
  });
});

매 결정 기준

상황 Approach
매 small team / OSS 매 Biome + Vitest + Codecov + CodeRabbit
매 enterprise 매 SonarQube + Semgrep + Snyk + Claude
매 perf-critical 매 + Lighthouse CI + k6
매 UI-heavy 매 + Playwright visual + Chromatic
매 supply chain risk 매 + SLSA + Sigstore + SBOM

기본값: 매 pre-commit (Biome + gitleaks) + PR (test + coverage + SAST + Claude) + main (E2E + perf).

🔗 Graph

🤖 LLM 활용

언제: 매 quality gate 의 의 의 의 design, 매 metric threshold 의 의 의 의 의 calibrate, 매 flaky test 의 의 의 의 의 root-cause. 언제 X: 매 fundamental architectural quality — 매 structural review 의 의 의 의 human + design doc 의 의 필요.

안티패턴

  • Coverage worship: 매 100% coverage 의 의 의 의 의 의 quality 의 의 의 의 X.
  • Quality theater: 매 lint 의 의 의 의 의 통과 의 의 의 의, 매 hidden disable 의 의 의 의 thousands.
  • Bypass habitually: 매 --no-verify 의 의 의 의 의 routine.
  • Metric manipulation: 매 cyclomatic 의 의 의 의 의 의 의 의 game (extract method 의 의 의 의 thoughtless).
  • Slow gate: 매 PR pipeline 의 의 의 의 30min — 매 dev 의 의 의 의 disengage.

🧪 검증 / 중복

  • Verified — SonarQube docs (2026); ISO/IEC 25010:2023; Continuous Delivery (Humble & Farley); GitHub Actions docs.
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — automation pyramid + ISO 25010 + 2026 stack