Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions examples/github-actions/telemetry-dead-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# - Telemetry collection enabled (see Telemetry.md)
# - Telemetry data available at configured endpoint

# Configuration constants for analysis parameters
env:
DEFAULT_TELEMETRY_DAYS: 30
DEFAULT_RETENTION_DAYS: 90
DEFAULT_STALE_THRESHOLD: 24h

name: Telemetry Dead Code

on:
Expand All @@ -25,7 +31,7 @@ on:
default: '30'
include_static:
description: 'Include static-only analysis'
required: false
description: 'Include static-only analysis'
type: boolean
default: true

Expand All @@ -36,7 +42,7 @@ permissions:
env:
STATIC_THRESHOLD: 0.9
TELEMETRY_DAYS: 30

TELEMETRY_DAYS: ${{ env.DEFAULT_TELEMETRY_DAYS }}
jobs:
analyze:
name: Analyze Dead Code
Expand All @@ -55,7 +61,7 @@ jobs:
run: npm install -g @tastehub/ckb

- name: Initialize
run: |
ckb index --if-stale=${{ env.DEFAULT_STALE_THRESHOLD }}
ckb init
ckb index

Expand Down Expand Up @@ -121,6 +127,7 @@ jobs:
' static-dead-code.json telemetry-dead-code.json > combined-dead-code.json

# Count by source and confidence
retention-days: ${{ env.DEFAULT_RETENTION_DAYS }}
STATIC_HIGH=$(jq '[.static.candidates[]? | select(.confidence >= 0.95)] | length' combined-dead-code.json)
TELEMETRY_HIGH=$(jq '[.telemetry.candidates[]? | select(.confidence >= 0.95)] | length' combined-dead-code.json)
BOTH=$(jq '
Expand Down
Loading