awesome-slash 2.8.3 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +7 -7
- package/.claude-plugin/plugin.json +10 -1
- package/CHANGELOG.md +40 -0
- package/README.md +8 -1
- package/lib/patterns/pipeline.js +183 -26
- package/lib/patterns/slop-analyzers.js +535 -33
- package/lib/patterns/slop-patterns.js +9 -50
- package/mcp-server/index.js +1 -1
- package/package.json +1 -1
- package/plugins/deslop-around/.claude-plugin/plugin.json +1 -1
- package/plugins/deslop-around/commands/deslop-around.md +97 -172
- package/plugins/deslop-around/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/deslop-around/lib/enhance/agent-patterns.js +569 -0
- package/plugins/deslop-around/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/deslop-around/lib/enhance/docs-patterns.js +671 -0
- package/plugins/deslop-around/lib/enhance/fixer.js +468 -0
- package/plugins/deslop-around/lib/enhance/index.js +78 -0
- package/plugins/deslop-around/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/deslop-around/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/deslop-around/lib/enhance/projectmemory-analyzer.js +541 -0
- package/plugins/deslop-around/lib/enhance/projectmemory-patterns.js +470 -0
- package/plugins/deslop-around/lib/enhance/prompt-analyzer.js +429 -0
- package/plugins/deslop-around/lib/enhance/prompt-patterns.js +783 -0
- package/plugins/deslop-around/lib/enhance/reporter.js +1310 -0
- package/plugins/deslop-around/lib/enhance/security-patterns.js +284 -0
- package/plugins/deslop-around/lib/enhance/tool-patterns.js +373 -0
- package/plugins/deslop-around/lib/index.js +2 -0
- package/plugins/deslop-around/lib/patterns/pipeline.js +183 -26
- package/plugins/deslop-around/lib/patterns/slop-analyzers.js +535 -33
- package/plugins/deslop-around/lib/patterns/slop-patterns.js +9 -50
- package/plugins/deslop-around/lib/reality-check/collectors.js +1 -0
- package/plugins/deslop-around/references/slop-categories.md +107 -0
- package/plugins/deslop-around/scripts/detect.js +131 -0
- package/plugins/enhance/.claude-plugin/plugin.json +1 -1
- package/plugins/next-task/.claude-plugin/plugin.json +1 -1
- package/plugins/next-task/agents/ci-fixer.md +10 -0
- package/plugins/next-task/agents/ci-monitor.md +10 -0
- package/plugins/next-task/agents/worktree-manager.md +10 -0
- package/plugins/next-task/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/next-task/lib/enhance/agent-patterns.js +569 -0
- package/plugins/next-task/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/next-task/lib/enhance/docs-patterns.js +671 -0
- package/plugins/next-task/lib/enhance/fixer.js +468 -0
- package/plugins/next-task/lib/enhance/index.js +78 -0
- package/plugins/next-task/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/next-task/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/next-task/lib/enhance/projectmemory-analyzer.js +541 -0
- package/plugins/next-task/lib/enhance/projectmemory-patterns.js +470 -0
- package/plugins/next-task/lib/enhance/prompt-analyzer.js +429 -0
- package/plugins/next-task/lib/enhance/prompt-patterns.js +783 -0
- package/plugins/next-task/lib/enhance/reporter.js +1310 -0
- package/plugins/next-task/lib/enhance/security-patterns.js +284 -0
- package/plugins/next-task/lib/enhance/tool-patterns.js +373 -0
- package/plugins/next-task/lib/index.js +2 -0
- package/plugins/next-task/lib/patterns/pipeline.js +183 -26
- package/plugins/next-task/lib/patterns/slop-analyzers.js +535 -33
- package/plugins/next-task/lib/patterns/slop-patterns.js +9 -50
- package/plugins/next-task/lib/reality-check/collectors.js +1 -0
- package/plugins/project-review/.claude-plugin/plugin.json +1 -1
- package/plugins/project-review/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/project-review/lib/enhance/agent-patterns.js +569 -0
- package/plugins/project-review/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/project-review/lib/enhance/docs-patterns.js +671 -0
- package/plugins/project-review/lib/enhance/fixer.js +468 -0
- package/plugins/project-review/lib/enhance/index.js +78 -0
- package/plugins/project-review/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/project-review/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/project-review/lib/enhance/projectmemory-analyzer.js +541 -0
- package/plugins/project-review/lib/enhance/projectmemory-patterns.js +470 -0
- package/plugins/project-review/lib/enhance/prompt-analyzer.js +429 -0
- package/plugins/project-review/lib/enhance/prompt-patterns.js +783 -0
- package/plugins/project-review/lib/enhance/reporter.js +1310 -0
- package/plugins/project-review/lib/enhance/security-patterns.js +284 -0
- package/plugins/project-review/lib/enhance/tool-patterns.js +373 -0
- package/plugins/project-review/lib/index.js +2 -0
- package/plugins/project-review/lib/patterns/pipeline.js +183 -26
- package/plugins/project-review/lib/patterns/slop-analyzers.js +535 -33
- package/plugins/project-review/lib/patterns/slop-patterns.js +9 -50
- package/plugins/project-review/lib/reality-check/collectors.js +1 -0
- package/plugins/reality-check/.claude-plugin/plugin.json +1 -1
- package/plugins/reality-check/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/reality-check/lib/enhance/agent-patterns.js +569 -0
- package/plugins/reality-check/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/reality-check/lib/enhance/docs-patterns.js +671 -0
- package/plugins/reality-check/lib/enhance/fixer.js +468 -0
- package/plugins/reality-check/lib/enhance/index.js +78 -0
- package/plugins/reality-check/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/reality-check/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/reality-check/lib/enhance/projectmemory-analyzer.js +541 -0
- package/plugins/reality-check/lib/enhance/projectmemory-patterns.js +470 -0
- package/plugins/reality-check/lib/enhance/prompt-analyzer.js +429 -0
- package/plugins/reality-check/lib/enhance/prompt-patterns.js +783 -0
- package/plugins/reality-check/lib/enhance/reporter.js +1310 -0
- package/plugins/reality-check/lib/enhance/security-patterns.js +284 -0
- package/plugins/reality-check/lib/enhance/tool-patterns.js +373 -0
- package/plugins/reality-check/lib/index.js +2 -0
- package/plugins/reality-check/lib/patterns/pipeline.js +183 -26
- package/plugins/reality-check/lib/patterns/slop-analyzers.js +535 -33
- package/plugins/reality-check/lib/patterns/slop-patterns.js +9 -50
- package/plugins/reality-check/lib/reality-check/collectors.js +1 -0
- package/plugins/ship/.claude-plugin/plugin.json +1 -1
- package/plugins/ship/lib/enhance/agent-analyzer.js +421 -0
- package/plugins/ship/lib/enhance/agent-patterns.js +569 -0
- package/plugins/ship/lib/enhance/docs-analyzer.js +325 -0
- package/plugins/ship/lib/enhance/docs-patterns.js +671 -0
- package/plugins/ship/lib/enhance/fixer.js +468 -0
- package/plugins/ship/lib/enhance/index.js +78 -0
- package/plugins/ship/lib/enhance/plugin-analyzer.js +402 -0
- package/plugins/ship/lib/enhance/plugin-patterns.js +326 -0
- package/plugins/ship/lib/enhance/projectmemory-analyzer.js +541 -0
- package/plugins/ship/lib/enhance/projectmemory-patterns.js +470 -0
- package/plugins/ship/lib/enhance/prompt-analyzer.js +429 -0
- package/plugins/ship/lib/enhance/prompt-patterns.js +783 -0
- package/plugins/ship/lib/enhance/reporter.js +1310 -0
- package/plugins/ship/lib/enhance/security-patterns.js +284 -0
- package/plugins/ship/lib/enhance/tool-patterns.js +373 -0
- package/plugins/ship/lib/index.js +2 -0
- package/plugins/ship/lib/patterns/pipeline.js +183 -26
- package/plugins/ship/lib/patterns/slop-analyzers.js +535 -33
- package/plugins/ship/lib/patterns/slop-patterns.js +9 -50
- package/plugins/ship/lib/reality-check/collectors.js +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "awesome-slash",
|
|
3
3
|
"description": "Professional-grade slash commands for Claude Code with cross-platform support (OpenCode, Codex CLI)",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.1",
|
|
5
5
|
"owner": {
|
|
6
6
|
"name": "Avi Fenesh",
|
|
7
7
|
"url": "https://github.com/avifenesh"
|
|
@@ -13,42 +13,42 @@
|
|
|
13
13
|
"name": "next-task",
|
|
14
14
|
"source": "./plugins/next-task",
|
|
15
15
|
"description": "Master workflow orchestrator: autonomous workflow with model optimization (opus/sonnet/haiku), two-file state management, workflow enforcement gates, 14 specialist agents",
|
|
16
|
-
"version": "2.
|
|
16
|
+
"version": "2.9.1",
|
|
17
17
|
"category": "productivity"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"name": "ship",
|
|
21
21
|
"source": "./plugins/ship",
|
|
22
22
|
"description": "Complete PR workflow: commit to production, skips review when called from next-task, removes task from registry on cleanup, automatic rollback",
|
|
23
|
-
"version": "2.
|
|
23
|
+
"version": "2.9.1",
|
|
24
24
|
"category": "deployment"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"name": "deslop-around",
|
|
28
28
|
"source": "./plugins/deslop-around",
|
|
29
29
|
"description": "3-phase AI slop detection: regex patterns (HIGH), multi-pass analyzers (MEDIUM), CLI tools (LOW)",
|
|
30
|
-
"version": "2.
|
|
30
|
+
"version": "2.9.1",
|
|
31
31
|
"category": "development"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"name": "project-review",
|
|
35
35
|
"source": "./plugins/project-review",
|
|
36
36
|
"description": "Multi-agent iterative code review until zero issues remain",
|
|
37
|
-
"version": "2.
|
|
37
|
+
"version": "2.9.1",
|
|
38
38
|
"category": "development"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"name": "reality-check",
|
|
42
42
|
"source": "./plugins/reality-check",
|
|
43
43
|
"description": "Deep repository analysis to realign project plans with code reality - detects drift, gaps, and creates prioritized reconstruction plans",
|
|
44
|
-
"version": "2.
|
|
44
|
+
"version": "2.9.1",
|
|
45
45
|
"category": "productivity"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"name": "enhance",
|
|
49
49
|
"source": "./plugins/enhance",
|
|
50
50
|
"description": "Master enhancement orchestrator: parallel analyzer execution for plugins, agents, docs, CLAUDE.md, and prompts with unified reporting",
|
|
51
|
-
"version": "2.
|
|
51
|
+
"version": "2.9.1",
|
|
52
52
|
"category": "development"
|
|
53
53
|
}
|
|
54
54
|
],
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "awesome-slash",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "Professional-grade slash commands for Claude Code with cross-platform support",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"workflow",
|
|
7
|
+
"automation",
|
|
8
|
+
"code-review",
|
|
9
|
+
"ci-cd",
|
|
10
|
+
"deployment",
|
|
11
|
+
"slop-detection",
|
|
12
|
+
"task-management"
|
|
13
|
+
],
|
|
5
14
|
"author": {
|
|
6
15
|
"name": "Avi Fenesh",
|
|
7
16
|
"url": "https://github.com/avifenesh"
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.9.1] - 2025-01-23
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **deslop-around skill** - Refactored to follow skill best practices
|
|
14
|
+
- Added `scripts/detect.js` CLI runner to invoke pipeline (instead of describing logic for LLM)
|
|
15
|
+
- Added `references/slop-categories.md` for progressive disclosure
|
|
16
|
+
- Moved constraints to top with explicit priority order (addresses "lost-in-the-middle")
|
|
17
|
+
- Added `<output_format>` XML tags for explicit output specification
|
|
18
|
+
- Reduced skill from 240 lines to 165 lines (~31% smaller)
|
|
19
|
+
|
|
20
|
+
## [2.9.0] - 2025-01-23
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- **Gitignore Support** - File scanning now respects `.gitignore` patterns
|
|
24
|
+
- New `parseGitignore()` function parses gitignore files and creates matcher
|
|
25
|
+
- `countSourceFiles()` respects gitignore by default (disable with `respectGitignore: false`)
|
|
26
|
+
- Supports all standard patterns: globs, directories, negation, globstar (`**`), anchored
|
|
27
|
+
|
|
28
|
+
- **Multi-Language Stub Detection** - New multi-pass analyzer replaces regex-based detection
|
|
29
|
+
- Python: `return None`, `pass`, `...`, `raise NotImplementedError`
|
|
30
|
+
- Rust: `todo!()`, `unimplemented!()`, `panic!()`, `None`, `Vec::new()`
|
|
31
|
+
- Java: `return null`, `throw UnsupportedOperationException`, `Collections.emptyList()`
|
|
32
|
+
- Go: `return nil`, `panic()`, empty returns, typed slice/map literals
|
|
33
|
+
- 95% reduction in false positives compared to previous regex patterns
|
|
34
|
+
|
|
35
|
+
- **Java Dead Code Support** - Extended `analyzeDeadCode` to detect unreachable code in Java
|
|
36
|
+
- Supports Java-specific patterns: `throw`, `return`, `break`, `continue`
|
|
37
|
+
- Respects Java block structures (try/catch/finally, switch/case)
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- **Function Name Extraction** - Fixed bug where `export` and `async` keywords were captured as function names instead of actual function names in doc/code ratio analyzer
|
|
41
|
+
- **TypeScript Language Matching** - Added fallback to ensure TypeScript files match JavaScript patterns
|
|
42
|
+
- **Stub Pattern Exclude Globs** - Pattern exclude globs now properly honored in stub detection
|
|
43
|
+
- **Multi-line Statement Detection** - Improved bracket balance tracking for all bracket types
|
|
44
|
+
- **minConsecutiveLines Enforcement** - Block patterns now correctly require minimum consecutive lines
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- **Disabled placeholder_stub_returns_js** - Replaced with multi-pass `analyzeStubFunctions` (95% false positive rate in regex version)
|
|
48
|
+
- **Removed generic_naming patterns** - Removed 4 patterns (JS, Python, Rust, Go) based on feedback that they weren't detecting real problems
|
|
49
|
+
|
|
10
50
|
## [2.8.3] - 2025-01-23
|
|
11
51
|
|
|
12
52
|
### Fixed
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ A cross-platform plugin providing powerful, zero-configuration slash commands fo
|
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/awesome-slash)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
|
-
[](https://github.com/avifenesh/awesome-slash/releases)
|
|
10
10
|
[](https://github.com/avifenesh/awesome-slash/stargazers)
|
|
11
11
|
[](https://docs.anthropic.com/en/docs/claude-code)
|
|
12
12
|
[](https://developers.openai.com/codex/cli)
|
|
@@ -16,6 +16,13 @@ A cross-platform plugin providing powerful, zero-configuration slash commands fo
|
|
|
16
16
|
|
|
17
17
|
> **💡 Model Recommendation**: Using **Opus** as the main agent model produces significantly better results and follows workflow phases more tightly. While Sonnet works for simpler tasks, Opus is recommended for complex multi-step workflows.
|
|
18
18
|
|
|
19
|
+
## What's New in v2.9.0
|
|
20
|
+
|
|
21
|
+
- **Gitignore Support** - File scanning now respects `.gitignore` patterns automatically
|
|
22
|
+
- **Multi-Language Stub Detection** - Python, Rust, Java, Go support with 95% false positive reduction
|
|
23
|
+
- **Java Dead Code Analysis** - Extended dead code detection to Java codebases
|
|
24
|
+
- **Critical Bug Fixes** - Function name extraction, TypeScript matching, bracket balance tracking
|
|
25
|
+
|
|
19
26
|
## What's New in v2.8.0
|
|
20
27
|
|
|
21
28
|
- **Complete /enhance Suite** - 7 enhancement analyzers for plugins, agents, prompts, docs, and project memory
|
package/lib/patterns/pipeline.js
CHANGED
|
@@ -149,9 +149,11 @@ function runPhase1(repoPath, targetFiles, language) {
|
|
|
149
149
|
: slopPatterns.slopPatterns;
|
|
150
150
|
|
|
151
151
|
for (const file of targetFiles) {
|
|
152
|
+
// Detect file language once per file
|
|
153
|
+
const fileLanguage = analyzers.detectLanguage(file);
|
|
154
|
+
|
|
152
155
|
// Skip if language filter doesn't match file extension
|
|
153
156
|
if (language) {
|
|
154
|
-
const fileLanguage = analyzers.detectLanguage(file);
|
|
155
157
|
// For JS/TS language filter, accept both 'javascript' and 'js' detection results
|
|
156
158
|
const isJsFamily = (language === 'javascript' || language === 'typescript') && fileLanguage === 'js';
|
|
157
159
|
if (fileLanguage !== language && !isJsFamily) continue;
|
|
@@ -178,21 +180,72 @@ function runPhase1(repoPath, targetFiles, language) {
|
|
|
178
180
|
// Skip if file matches exclude patterns
|
|
179
181
|
if (slopPatterns.isFileExcluded(file, pattern.exclude)) continue;
|
|
180
182
|
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
183
|
+
// Skip language-specific patterns that don't match file's language
|
|
184
|
+
if (pattern.language) {
|
|
185
|
+
const patternLang = pattern.language;
|
|
186
|
+
// Map detection results to pattern language names
|
|
187
|
+
// Note: 'js' from detectLanguage covers both JavaScript and TypeScript
|
|
188
|
+
const langMatch = (patternLang === 'javascript' && fileLanguage === 'js') ||
|
|
189
|
+
(patternLang === 'python' && fileLanguage === 'python') ||
|
|
190
|
+
(patternLang === 'rust' && fileLanguage === 'rust') ||
|
|
191
|
+
(patternLang === 'go' && fileLanguage === 'go') ||
|
|
192
|
+
(patternLang === 'java' && fileLanguage === 'java') ||
|
|
193
|
+
patternLang === fileLanguage; // Direct match fallback
|
|
194
|
+
if (!langMatch) continue;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Handle patterns requiring consecutive line blocks
|
|
198
|
+
if (pattern.minConsecutiveLines) {
|
|
199
|
+
const minLines = pattern.minConsecutiveLines;
|
|
200
|
+
let consecutiveStart = -1;
|
|
201
|
+
let consecutiveCount = 0;
|
|
202
|
+
|
|
203
|
+
for (let i = 0; i <= lines.length; i++) {
|
|
204
|
+
const line = i < lines.length ? lines[i] : ''; // Empty line at end to flush
|
|
205
|
+
const matches = i < lines.length && pattern.pattern.test(line);
|
|
206
|
+
|
|
207
|
+
if (matches) {
|
|
208
|
+
if (consecutiveStart === -1) {
|
|
209
|
+
consecutiveStart = i;
|
|
210
|
+
}
|
|
211
|
+
consecutiveCount++;
|
|
212
|
+
} else {
|
|
213
|
+
// End of consecutive block - check if it meets threshold
|
|
214
|
+
if (consecutiveCount >= minLines) {
|
|
215
|
+
findings.push({
|
|
216
|
+
file,
|
|
217
|
+
line: consecutiveStart + 1,
|
|
218
|
+
patternName,
|
|
219
|
+
severity: pattern.severity,
|
|
220
|
+
certainty: CERTAINTY.HIGH,
|
|
221
|
+
description: `${pattern.description} (${consecutiveCount} consecutive lines)`,
|
|
222
|
+
autoFix: pattern.autoFix,
|
|
223
|
+
content: `Lines ${consecutiveStart + 1}-${consecutiveStart + consecutiveCount}`,
|
|
224
|
+
phase: 1,
|
|
225
|
+
details: { startLine: consecutiveStart + 1, endLine: consecutiveStart + consecutiveCount, lineCount: consecutiveCount }
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
consecutiveStart = -1;
|
|
229
|
+
consecutiveCount = 0;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
} else {
|
|
233
|
+
// Standard per-line matching
|
|
234
|
+
for (let i = 0; i < lines.length; i++) {
|
|
235
|
+
const line = lines[i];
|
|
236
|
+
if (pattern.pattern.test(line)) {
|
|
237
|
+
findings.push({
|
|
238
|
+
file,
|
|
239
|
+
line: i + 1,
|
|
240
|
+
patternName,
|
|
241
|
+
severity: pattern.severity,
|
|
242
|
+
certainty: CERTAINTY.HIGH,
|
|
243
|
+
description: pattern.description,
|
|
244
|
+
autoFix: pattern.autoFix,
|
|
245
|
+
content: line.trim().substring(0, 100),
|
|
246
|
+
phase: 1
|
|
247
|
+
});
|
|
248
|
+
}
|
|
196
249
|
}
|
|
197
250
|
}
|
|
198
251
|
}
|
|
@@ -214,12 +267,14 @@ function runMultiPassAnalyzers(repoPath, targetFiles) {
|
|
|
214
267
|
// Get multi-pass pattern definitions for thresholds
|
|
215
268
|
const multiPassPatterns = slopPatterns.getMultiPassPatterns();
|
|
216
269
|
|
|
270
|
+
// Supported languages for doc/code and verbosity analysis
|
|
271
|
+
const docCodeLangs = /\.(js|jsx|ts|tsx|mjs|cjs|py|rs|java|go)$/i;
|
|
272
|
+
|
|
217
273
|
for (const file of targetFiles) {
|
|
218
|
-
|
|
219
|
-
|
|
274
|
+
if (!file.match(docCodeLangs)) continue;
|
|
275
|
+
if (analyzers.isTestFile(file)) continue;
|
|
220
276
|
|
|
221
|
-
|
|
222
|
-
if (lang !== 'js') continue;
|
|
277
|
+
const filePath = path.isAbsolute(file) ? file : path.join(repoPath, file);
|
|
223
278
|
|
|
224
279
|
let content;
|
|
225
280
|
try {
|
|
@@ -228,31 +283,32 @@ function runMultiPassAnalyzers(repoPath, targetFiles) {
|
|
|
228
283
|
continue;
|
|
229
284
|
}
|
|
230
285
|
|
|
231
|
-
// Doc/code ratio analysis
|
|
286
|
+
// Doc/code ratio analysis (multi-language)
|
|
232
287
|
const docCodePattern = multiPassPatterns.doc_code_ratio_js;
|
|
233
288
|
if (docCodePattern) {
|
|
234
289
|
const docRatioViolations = analyzers.analyzeDocCodeRatio(content, {
|
|
235
290
|
minFunctionLines: docCodePattern.minFunctionLines || 3,
|
|
236
|
-
maxRatio: docCodePattern.maxRatio || 3.0
|
|
291
|
+
maxRatio: docCodePattern.maxRatio || 3.0,
|
|
292
|
+
filePath: file
|
|
237
293
|
});
|
|
238
294
|
|
|
239
295
|
for (const v of docRatioViolations) {
|
|
240
296
|
findings.push({
|
|
241
297
|
file,
|
|
242
298
|
line: v.line,
|
|
243
|
-
patternName: '
|
|
299
|
+
patternName: 'doc_code_ratio',
|
|
244
300
|
severity: docCodePattern.severity,
|
|
245
301
|
certainty: CERTAINTY.MEDIUM,
|
|
246
302
|
description: `${docCodePattern.description} (${v.docLines} doc lines / ${v.codeLines} code lines = ${v.ratio}x)`,
|
|
247
303
|
autoFix: docCodePattern.autoFix,
|
|
248
|
-
content: `Function at line ${v.line}`,
|
|
304
|
+
content: v.functionName ? `${v.functionName}()` : `Function at line ${v.line}`,
|
|
249
305
|
phase: 1,
|
|
250
|
-
details: { docLines: v.docLines, codeLines: v.codeLines, ratio: v.ratio }
|
|
306
|
+
details: { docLines: v.docLines, codeLines: v.codeLines, ratio: v.ratio, functionName: v.functionName }
|
|
251
307
|
});
|
|
252
308
|
}
|
|
253
309
|
}
|
|
254
310
|
|
|
255
|
-
// Verbosity ratio analysis
|
|
311
|
+
// Verbosity ratio analysis (multi-language)
|
|
256
312
|
const verbosityPattern = multiPassPatterns.verbosity_ratio;
|
|
257
313
|
if (verbosityPattern) {
|
|
258
314
|
const verbosityViolations = analyzers.analyzeVerbosityRatio(content, {
|
|
@@ -347,6 +403,107 @@ function runMultiPassAnalyzers(repoPath, targetFiles) {
|
|
|
347
403
|
}
|
|
348
404
|
}
|
|
349
405
|
|
|
406
|
+
// Dead code analysis (per-file)
|
|
407
|
+
const deadCodePattern = multiPassPatterns.dead_code;
|
|
408
|
+
if (deadCodePattern) {
|
|
409
|
+
for (const file of targetFiles) {
|
|
410
|
+
// Skip test files
|
|
411
|
+
if (analyzers.isTestFile(file)) continue;
|
|
412
|
+
|
|
413
|
+
const filePath = path.isAbsolute(file) ? file : path.join(repoPath, file);
|
|
414
|
+
let content;
|
|
415
|
+
try {
|
|
416
|
+
content = fs.readFileSync(filePath, 'utf8');
|
|
417
|
+
} catch {
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const deadCodeViolations = analyzers.analyzeDeadCode(content, { filePath: file });
|
|
422
|
+
|
|
423
|
+
for (const v of deadCodeViolations) {
|
|
424
|
+
findings.push({
|
|
425
|
+
file,
|
|
426
|
+
line: v.line,
|
|
427
|
+
patternName: 'dead_code',
|
|
428
|
+
severity: deadCodePattern.severity,
|
|
429
|
+
certainty: CERTAINTY.MEDIUM,
|
|
430
|
+
description: `${deadCodePattern.description}: ${v.terminationType} at line ${v.terminationLine}`,
|
|
431
|
+
autoFix: deadCodePattern.autoFix,
|
|
432
|
+
content: v.content,
|
|
433
|
+
phase: 1,
|
|
434
|
+
details: { terminationType: v.terminationType, terminationLine: v.terminationLine }
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// Stub function analysis (per-file, multi-language)
|
|
441
|
+
const stubPattern = multiPassPatterns.placeholder_stub_returns_js;
|
|
442
|
+
if (stubPattern) {
|
|
443
|
+
// Supported extensions for stub detection
|
|
444
|
+
const stubExtensions = /\.(js|jsx|ts|tsx|mjs|cjs|py|rs|java|go)$/i;
|
|
445
|
+
|
|
446
|
+
for (const file of targetFiles) {
|
|
447
|
+
if (analyzers.isTestFile(file)) continue;
|
|
448
|
+
if (!file.match(stubExtensions)) continue;
|
|
449
|
+
// Honor pattern exclude globs (e.g., *.config.*)
|
|
450
|
+
if (slopPatterns.isFileExcluded(file, stubPattern.exclude)) continue;
|
|
451
|
+
|
|
452
|
+
const filePath = path.isAbsolute(file) ? file : path.join(repoPath, file);
|
|
453
|
+
let content;
|
|
454
|
+
try {
|
|
455
|
+
content = fs.readFileSync(filePath, 'utf8');
|
|
456
|
+
} catch {
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const stubViolations = analyzers.analyzeStubFunctions(content, { filePath: file });
|
|
461
|
+
|
|
462
|
+
for (const v of stubViolations) {
|
|
463
|
+
findings.push({
|
|
464
|
+
file,
|
|
465
|
+
line: v.line,
|
|
466
|
+
patternName: 'placeholder_stub_returns',
|
|
467
|
+
severity: v.hasTodo ? 'high' : stubPattern.severity,
|
|
468
|
+
certainty: v.certainty,
|
|
469
|
+
description: `${stubPattern.description}: ${v.functionName}() returns ${v.returnValue}`,
|
|
470
|
+
autoFix: stubPattern.autoFix,
|
|
471
|
+
content: v.content,
|
|
472
|
+
phase: 1,
|
|
473
|
+
details: { functionName: v.functionName, returnValue: v.returnValue, hasTodo: v.hasTodo }
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// Shotgun surgery analysis (git history)
|
|
480
|
+
const shotgunPattern = multiPassPatterns.shotgun_surgery;
|
|
481
|
+
if (shotgunPattern) {
|
|
482
|
+
try {
|
|
483
|
+
const shotgunResult = analyzers.analyzeShotgunSurgery(repoPath, {
|
|
484
|
+
commitLimit: shotgunPattern.commitLimit || 100,
|
|
485
|
+
clusterThreshold: shotgunPattern.clusterThreshold || 5
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
for (const v of shotgunResult.violations) {
|
|
489
|
+
findings.push({
|
|
490
|
+
file: 'project-level',
|
|
491
|
+
line: 0,
|
|
492
|
+
patternName: 'shotgun_surgery',
|
|
493
|
+
severity: shotgunPattern.severity,
|
|
494
|
+
certainty: CERTAINTY.MEDIUM,
|
|
495
|
+
description: `${shotgunPattern.description}: ${v.files.length} files change together ${v.count} times`,
|
|
496
|
+
autoFix: shotgunPattern.autoFix,
|
|
497
|
+
content: v.files.join(', ').substring(0, 100),
|
|
498
|
+
phase: 1,
|
|
499
|
+
details: { files: v.files, changeCount: v.count }
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
} catch {
|
|
503
|
+
// Git not available or not a git repo - skip silently
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
350
507
|
return findings;
|
|
351
508
|
}
|
|
352
509
|
|