🔍 Duplicate Code Detected: Skip Gate Mirror Logic
Analysis of commit bd0c249
Assignee : @copilot
Summary
check_skip_if_match.cjs and check_skip_if_no_match.cjs implement the same 47-line gate with only threshold direction and output/message names changed.
Duplication Details
Pattern: mirror-image skip query gate
Severity : High
Occurrences : 2
Locations :
actions/setup/js/check_skip_if_match.cjs (lines 9-54)
actions/setup/js/check_skip_if_no_match.cjs (lines 9-54)
Code Sample :
const searchQuery = buildSearchQuery ( skipQuery , skipScope ) ;
const { data : { total_count : totalCount } } = await github . rest . search . issuesAndPullRequests ( { q : searchQuery , per_page : 1 } ) ;
if ( totalCount >= maxMatches ) { ... }
Impact Analysis
Maintainability : Threshold parsing, validation, search execution, and denial reporting must be fixed in two places.
Bug Risk : Any change to search behavior or summary text can drift between the two gates.
Code Bloat : Nearly identical control flow is duplicated across sibling workflow guards.
Refactoring Recommendations
Extract a shared runSkipQueryGate helper that accepts comparator, threshold name, output key, and message template.
Keep only the policy-specific wrapper in each file.
Analysis Metadata
Analyzed Files : 2
Detection Method : Serena semantic code analysis
Commit : bd0c249
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
network :
allowed :
- defaults
- " awmgmcpg"
See Network Configuration for more information.
Generated by 🔍 Duplicate Code Detector · 13 AIC · ⌖ 6.29 AIC · ⊞ 13.3K · ◷
🔍 Duplicate Code Detected: Skip Gate Mirror Logic
Analysis of commit bd0c249
Assignee:
@copilotSummary
check_skip_if_match.cjsandcheck_skip_if_no_match.cjsimplement the same 47-line gate with only threshold direction and output/message names changed.Duplication Details
Pattern: mirror-image skip query gate
actions/setup/js/check_skip_if_match.cjs(lines 9-54)actions/setup/js/check_skip_if_no_match.cjs(lines 9-54)Impact Analysis
Refactoring Recommendations
runSkipQueryGatehelper that accepts comparator, threshold name, output key, and message template.Analysis Metadata
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpgSee Network Configuration for more information.