pumuki-ast-hooks 5.5.54 → 5.5.55
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki-ast-hooks",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.55",
|
|
4
4
|
"description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -145,27 +145,30 @@ function runCommonIntelligence(project, findings) {
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
148
|
+
// Skip Swift files - they should only be analyzed by iOS-specific detectors
|
|
149
|
+
if (!/\.swift$/i.test(filePath)) {
|
|
150
|
+
sf.getDescendantsOfKind(SyntaxKind.CatchClause).forEach((clause) => {
|
|
151
|
+
const block = typeof clause.getBlock === 'function' ? clause.getBlock() : null;
|
|
152
|
+
const statements = block && typeof block.getStatements === 'function' ? block.getStatements() : [];
|
|
153
|
+
|
|
154
|
+
if ((statements || []).length === 0) {
|
|
155
|
+
const blockText = block ? block.getText() : '';
|
|
156
|
+
const hasTestAssertions = /XCTFail|XCTAssert|guard\s+case|expect\(|assert/i.test(blockText);
|
|
157
|
+
const hasErrorHandling = /throw|console\.|logger\.|log\(|print\(/i.test(blockText);
|
|
158
|
+
|
|
159
|
+
if (!hasTestAssertions && !hasErrorHandling) {
|
|
160
|
+
pushFinding(
|
|
161
|
+
'common.error.empty_catch',
|
|
162
|
+
'critical',
|
|
163
|
+
sf,
|
|
164
|
+
clause,
|
|
165
|
+
'Empty catch block detected - always handle errors (log, rethrow, wrap, or return Result)',
|
|
166
|
+
findings
|
|
167
|
+
);
|
|
168
|
+
}
|
|
166
169
|
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
169
172
|
|
|
170
173
|
sf.getDescendantsOfKind(SyntaxKind.AnyKeyword).forEach((node) => {
|
|
171
174
|
|