pumuki-ast-hooks 5.5.55 → 5.5.57
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.57",
|
|
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": {
|
package/scripts/hooks-system/infrastructure/ast/ios/detectors/ios-ast-intelligent-strategies.js
CHANGED
|
@@ -232,15 +232,19 @@ function analyzeClassAST(analyzer, node, filePath) {
|
|
|
232
232
|
analyzer.pushFinding('ios.naming.god_naming', 'medium', filePath, line, `Suspicious class name '${name}' - often indicates SRP violation`);
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
235
|
+
// Skip ISP validation for test files - spies/mocks are allowed to have unused properties
|
|
236
|
+
const isTestFile = /Tests?\/|Spec|Mock|Spy|Stub|Fake|Dummy/.test(filePath);
|
|
237
|
+
if (!isTestFile) {
|
|
238
|
+
const unusedProps = findUnusedPropertiesAST(analyzer, properties, methods);
|
|
239
|
+
for (const prop of unusedProps) {
|
|
240
|
+
analyzer.pushFinding(
|
|
241
|
+
'ios.solid.isp.unused_dependency',
|
|
242
|
+
'high',
|
|
243
|
+
filePath,
|
|
244
|
+
line,
|
|
245
|
+
`Unused property '${prop}' in '${name}' - ISP violation`
|
|
246
|
+
);
|
|
247
|
+
}
|
|
244
248
|
}
|
|
245
249
|
|
|
246
250
|
checkDependencyInjectionAST(analyzer, properties, filePath, name, line);
|
|
@@ -658,6 +662,17 @@ function checkDependencyInjectionAST(analyzer, properties, filePath, className,
|
|
|
658
662
|
continue;
|
|
659
663
|
}
|
|
660
664
|
|
|
665
|
+
// Skip generic type parameters (e.g., "Client" in LoginUseCaseImpl<Client: APIClientProtocol>)
|
|
666
|
+
// These are not concrete dependencies - they are constrained by protocols
|
|
667
|
+
const propName = prop['key.name'] || '';
|
|
668
|
+
const isGenericTypeParameter = typename.length === 1 ||
|
|
669
|
+
(typename.match(/^[A-Z][a-z]*$/) && !typename.includes('Impl') &&
|
|
670
|
+
(className.includes('<') || propName === 'apiClient' || propName === 'client'));
|
|
671
|
+
|
|
672
|
+
if (isGenericTypeParameter) {
|
|
673
|
+
continue;
|
|
674
|
+
}
|
|
675
|
+
|
|
661
676
|
const isConcreteService = /Service$|Repository$|UseCase$|Client$/.test(typename) && !typename.includes('Protocol') && !typename.includes('any ') && !typename.includes('some ');
|
|
662
677
|
|
|
663
678
|
if (isConcreteService) {
|