agent-ide 0.2.0 → 0.4.0
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/README.md +29 -355
- package/dist/application/events/event-bus.d.ts.map +1 -1
- package/dist/application/events/event-bus.js.map +1 -1
- package/dist/application/index.d.ts +3 -1
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +10 -5
- package/dist/application/index.js.map +1 -1
- package/dist/application/services/cache-coordinator.service.d.ts.map +1 -1
- package/dist/application/services/cache-coordinator.service.js.map +1 -1
- package/dist/application/services/error-handler.service.d.ts.map +1 -1
- package/dist/application/services/error-handler.service.js.map +1 -1
- package/dist/application/services/module-coordinator.service.d.ts +5 -14
- package/dist/application/services/module-coordinator.service.d.ts.map +1 -1
- package/dist/application/services/module-coordinator.service.js +15 -108
- package/dist/application/services/module-coordinator.service.js.map +1 -1
- package/dist/application/services/session-manager.service.d.ts.map +1 -1
- package/dist/application/services/session-manager.service.js.map +1 -1
- package/dist/application/services/workflow-engine.service.d.ts +1 -1
- package/dist/application/services/workflow-engine.service.d.ts.map +1 -1
- package/dist/application/services/workflow-engine.service.js.map +1 -1
- package/dist/application/state/state-manager.d.ts +3 -3
- package/dist/application/state/state-manager.d.ts.map +1 -1
- package/dist/application/state/state-manager.js +3 -3
- package/dist/application/state/state-manager.js.map +1 -1
- package/dist/application/types.d.ts.map +1 -1
- package/dist/application/workflows/analysis-workflow.d.ts +1 -1
- package/dist/application/workflows/analysis-workflow.d.ts.map +1 -1
- package/dist/application/workflows/analysis-workflow.js +1 -1
- package/dist/application/workflows/analysis-workflow.js.map +1 -1
- package/dist/application/workflows/base-workflow.d.ts.map +1 -1
- package/dist/application/workflows/base-workflow.js.map +1 -1
- package/dist/application/workflows/index.d.ts +2 -2
- package/dist/application/workflows/index.d.ts.map +1 -1
- package/dist/application/workflows/index.js +2 -2
- package/dist/application/workflows/index.js.map +1 -1
- package/dist/application/workflows/refactor-workflow.d.ts +1 -1
- package/dist/application/workflows/refactor-workflow.d.ts.map +1 -1
- package/dist/application/workflows/refactor-workflow.js +1 -1
- package/dist/application/workflows/refactor-workflow.js.map +1 -1
- package/dist/core/change-signature/change-signature-service.d.ts +94 -0
- package/dist/core/change-signature/change-signature-service.d.ts.map +1 -0
- package/dist/core/change-signature/change-signature-service.js +544 -0
- package/dist/core/change-signature/change-signature-service.js.map +1 -0
- package/dist/core/change-signature/index.d.ts +10 -0
- package/dist/core/change-signature/index.d.ts.map +1 -0
- package/dist/core/change-signature/index.js +12 -0
- package/dist/core/change-signature/index.js.map +1 -0
- package/dist/core/change-signature/signature-parser.d.ts +76 -0
- package/dist/core/change-signature/signature-parser.d.ts.map +1 -0
- package/dist/core/change-signature/signature-parser.js +387 -0
- package/dist/core/change-signature/signature-parser.js.map +1 -0
- package/dist/core/change-signature/types.d.ts +244 -0
- package/dist/core/change-signature/types.d.ts.map +1 -0
- package/dist/core/change-signature/types.js +73 -0
- package/dist/core/change-signature/types.js.map +1 -0
- package/dist/core/dependency/cycle-detector.d.ts +1 -1
- package/dist/core/dependency/cycle-detector.d.ts.map +1 -1
- package/dist/core/dependency/cycle-detector.js +1 -1
- package/dist/core/dependency/cycle-detector.js.map +1 -1
- package/dist/core/dependency/dependency-analyzer.d.ts +3 -1
- package/dist/core/dependency/dependency-analyzer.d.ts.map +1 -1
- package/dist/core/dependency/dependency-analyzer.js +25 -24
- package/dist/core/dependency/dependency-analyzer.js.map +1 -1
- package/dist/core/dependency/types.d.ts.map +1 -1
- package/dist/core/indexing/file-index.d.ts.map +1 -1
- package/dist/core/indexing/file-index.js +1 -1
- package/dist/core/indexing/file-index.js.map +1 -1
- package/dist/core/indexing/index-engine.d.ts +3 -1
- package/dist/core/indexing/index-engine.d.ts.map +1 -1
- package/dist/core/indexing/index-engine.js +25 -17
- package/dist/core/indexing/index-engine.js.map +1 -1
- package/dist/core/indexing/index.d.ts +1 -9
- package/dist/core/indexing/index.d.ts.map +1 -1
- package/dist/core/indexing/index.js +2 -12
- package/dist/core/indexing/index.js.map +1 -1
- package/dist/core/indexing/symbol-index.d.ts.map +1 -1
- package/dist/core/indexing/types.d.ts +12 -0
- package/dist/core/indexing/types.d.ts.map +1 -1
- package/dist/core/indexing/types.js +12 -0
- package/dist/core/indexing/types.js.map +1 -1
- package/dist/core/move-file/import-resolver.d.ts.map +1 -0
- package/dist/core/{move → move-file}/import-resolver.js +9 -10
- package/dist/core/move-file/import-resolver.js.map +1 -0
- package/dist/core/{move → move-file}/index.d.ts +2 -2
- package/dist/core/move-file/index.d.ts.map +1 -0
- package/dist/core/{move → move-file}/index.js +2 -2
- package/dist/core/move-file/index.js.map +1 -0
- package/dist/core/{move → move-file}/move-service.d.ts +3 -1
- package/dist/core/move-file/move-service.d.ts.map +1 -0
- package/dist/core/{move → move-file}/move-service.js +66 -84
- package/dist/core/move-file/move-service.js.map +1 -0
- package/dist/core/move-file/types.d.ts.map +1 -0
- package/dist/core/move-file/types.js.map +1 -0
- package/dist/core/move-member/index.d.ts +10 -0
- package/dist/core/move-member/index.d.ts.map +1 -0
- package/dist/core/move-member/index.js +12 -0
- package/dist/core/move-member/index.js.map +1 -0
- package/dist/core/move-member/member-extractor.d.ts +96 -0
- package/dist/core/move-member/member-extractor.d.ts.map +1 -0
- package/dist/core/move-member/member-extractor.js +439 -0
- package/dist/core/move-member/member-extractor.js.map +1 -0
- package/dist/core/move-member/move-member-service.d.ts +87 -0
- package/dist/core/move-member/move-member-service.d.ts.map +1 -0
- package/dist/core/move-member/move-member-service.js +412 -0
- package/dist/core/move-member/move-member-service.js.map +1 -0
- package/dist/core/move-member/types.d.ts +182 -0
- package/dist/core/move-member/types.d.ts.map +1 -0
- package/dist/core/move-member/types.js +75 -0
- package/dist/core/move-member/types.js.map +1 -0
- package/dist/core/rename/index.d.ts +3 -3
- package/dist/core/rename/index.d.ts.map +1 -1
- package/dist/core/rename/index.js +5 -3
- package/dist/core/rename/index.js.map +1 -1
- package/dist/core/rename/reference-updater.d.ts +3 -1
- package/dist/core/rename/reference-updater.d.ts.map +1 -1
- package/dist/core/rename/reference-updater.js +9 -6
- package/dist/core/rename/reference-updater.js.map +1 -1
- package/dist/core/rename/rename-engine.d.ts +3 -1
- package/dist/core/rename/rename-engine.d.ts.map +1 -1
- package/dist/core/rename/rename-engine.js +8 -5
- package/dist/core/rename/rename-engine.js.map +1 -1
- package/dist/core/rename/scope-analyzer.d.ts.map +1 -1
- package/dist/core/rename/scope-analyzer.js.map +1 -1
- package/dist/core/rename/types.d.ts.map +1 -1
- package/dist/core/shared/call-hierarchy-analyzer.d.ts +102 -0
- package/dist/core/shared/call-hierarchy-analyzer.d.ts.map +1 -0
- package/dist/core/shared/call-hierarchy-analyzer.js +328 -0
- package/dist/core/shared/call-hierarchy-analyzer.js.map +1 -0
- package/dist/core/shared/index.d.ts +7 -0
- package/dist/core/shared/index.d.ts.map +1 -0
- package/dist/core/shared/index.js +7 -0
- package/dist/core/shared/index.js.map +1 -0
- package/dist/core/shared/symbol-finder.d.ts +154 -0
- package/dist/core/shared/symbol-finder.d.ts.map +1 -0
- package/dist/core/shared/symbol-finder.js +433 -0
- package/dist/core/shared/symbol-finder.js.map +1 -0
- package/dist/core/snapshot/index.d.ts +3 -19
- package/dist/core/snapshot/index.d.ts.map +1 -1
- package/dist/core/snapshot/index.js +2 -23
- package/dist/core/snapshot/index.js.map +1 -1
- package/dist/core/snapshot/snapshot-generator.d.ts +66 -0
- package/dist/core/snapshot/snapshot-generator.d.ts.map +1 -0
- package/dist/core/snapshot/snapshot-generator.js +258 -0
- package/dist/core/snapshot/snapshot-generator.js.map +1 -0
- package/dist/core/snapshot/types.d.ts +41 -190
- package/dist/core/snapshot/types.d.ts.map +1 -1
- package/dist/core/snapshot/types.js +13 -67
- package/dist/core/snapshot/types.js.map +1 -1
- package/dist/infrastructure/cache/cache-manager.d.ts +1 -1
- package/dist/infrastructure/cache/cache-manager.d.ts.map +1 -1
- package/dist/infrastructure/cache/cache-manager.js +1 -1
- package/dist/infrastructure/cache/cache-manager.js.map +1 -1
- package/dist/infrastructure/cache/memory-cache.js +1 -1
- package/dist/infrastructure/cache/memory-cache.js.map +1 -1
- package/dist/infrastructure/cache/strategies.d.ts +1 -1
- package/dist/infrastructure/cache/strategies.d.ts.map +1 -1
- package/dist/infrastructure/cache/strategies.js +1 -1
- package/dist/infrastructure/cache/strategies.js.map +1 -1
- package/dist/infrastructure/formatters/diff-generator.d.ts +11 -0
- package/dist/infrastructure/formatters/diff-generator.d.ts.map +1 -0
- package/dist/infrastructure/formatters/diff-generator.js +227 -0
- package/dist/infrastructure/formatters/diff-generator.js.map +1 -0
- package/dist/infrastructure/formatters/index.d.ts +11 -0
- package/dist/infrastructure/formatters/index.d.ts.map +1 -0
- package/dist/infrastructure/formatters/index.js +13 -0
- package/dist/infrastructure/formatters/index.js.map +1 -0
- package/dist/infrastructure/formatters/preview-converter.d.ts +85 -0
- package/dist/infrastructure/formatters/preview-converter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/preview-converter.js +209 -0
- package/dist/infrastructure/formatters/preview-converter.js.map +1 -0
- package/dist/infrastructure/formatters/preview-formatter.d.ts +61 -0
- package/dist/infrastructure/formatters/preview-formatter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/preview-formatter.js +208 -0
- package/dist/infrastructure/formatters/preview-formatter.js.map +1 -0
- package/dist/infrastructure/formatters/query-formatter.d.ts +83 -0
- package/dist/infrastructure/formatters/query-formatter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/query-formatter.js +349 -0
- package/dist/infrastructure/formatters/query-formatter.js.map +1 -0
- package/dist/infrastructure/formatters/query-types.d.ts +238 -0
- package/dist/infrastructure/formatters/query-types.d.ts.map +1 -0
- package/dist/infrastructure/formatters/query-types.js +29 -0
- package/dist/infrastructure/formatters/query-types.js.map +1 -0
- package/dist/infrastructure/formatters/types.d.ts +163 -0
- package/dist/infrastructure/formatters/types.d.ts.map +1 -0
- package/dist/infrastructure/formatters/types.js +27 -0
- package/dist/infrastructure/formatters/types.js.map +1 -0
- package/dist/infrastructure/parser/base.d.ts +1 -33
- package/dist/infrastructure/parser/base.d.ts.map +1 -1
- package/dist/infrastructure/parser/base.js +1 -65
- package/dist/infrastructure/parser/base.js.map +1 -1
- package/dist/infrastructure/parser/index.d.ts +0 -2
- package/dist/infrastructure/parser/index.d.ts.map +1 -1
- package/dist/infrastructure/parser/index.js +1 -2
- package/dist/infrastructure/parser/index.js.map +1 -1
- package/dist/infrastructure/parser/interface.d.ts +2 -59
- package/dist/infrastructure/parser/interface.d.ts.map +1 -1
- package/dist/infrastructure/parser/interface.js +1 -11
- package/dist/infrastructure/parser/interface.js.map +1 -1
- package/dist/infrastructure/parser/registry.d.ts +1 -1
- package/dist/infrastructure/parser/registry.d.ts.map +1 -1
- package/dist/infrastructure/parser/registry.js +1 -1
- package/dist/infrastructure/parser/registry.js.map +1 -1
- package/dist/infrastructure/parser/types.d.ts.map +1 -1
- package/dist/infrastructure/storage/file-system.d.ts +2 -1
- package/dist/infrastructure/storage/file-system.d.ts.map +1 -1
- package/dist/infrastructure/storage/file-system.interface.d.ts +69 -0
- package/dist/infrastructure/storage/file-system.interface.d.ts.map +1 -0
- package/dist/infrastructure/storage/file-system.interface.js +6 -0
- package/dist/infrastructure/storage/file-system.interface.js.map +1 -0
- package/dist/infrastructure/storage/file-system.js.map +1 -1
- package/dist/infrastructure/storage/index.d.ts +2 -4
- package/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/dist/infrastructure/storage/index.js +1 -8
- package/dist/infrastructure/storage/index.js.map +1 -1
- package/dist/infrastructure/storage/mem-file-system.d.ts +44 -0
- package/dist/infrastructure/storage/mem-file-system.d.ts.map +1 -0
- package/dist/infrastructure/storage/mem-file-system.js +105 -0
- package/dist/infrastructure/storage/mem-file-system.js.map +1 -0
- package/dist/interfaces/cli/cli.d.ts +13 -94
- package/dist/interfaces/cli/cli.d.ts.map +1 -1
- package/dist/interfaces/cli/cli.js +47 -2450
- package/dist/interfaces/cli/cli.js.map +1 -1
- package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.js +161 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.js.map +1 -0
- package/dist/interfaces/cli/commands/change-signature.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/change-signature.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/change-signature.command.js +290 -0
- package/dist/interfaces/cli/commands/change-signature.command.js.map +1 -0
- package/dist/interfaces/cli/commands/cycles.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/cycles.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/cycles.command.js +87 -0
- package/dist/interfaces/cli/commands/cycles.command.js.map +1 -0
- package/dist/interfaces/cli/commands/find-references.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/find-references.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/find-references.command.js +122 -0
- package/dist/interfaces/cli/commands/find-references.command.js.map +1 -0
- package/dist/interfaces/cli/commands/impact.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/impact.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/impact.command.js +98 -0
- package/dist/interfaces/cli/commands/impact.command.js.map +1 -0
- package/dist/interfaces/cli/commands/index.d.ts +14 -0
- package/dist/interfaces/cli/commands/index.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/index.js +15 -0
- package/dist/interfaces/cli/commands/index.js.map +1 -0
- package/dist/interfaces/cli/commands/move-member.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/move-member.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/move-member.command.js +185 -0
- package/dist/interfaces/cli/commands/move-member.command.js.map +1 -0
- package/dist/interfaces/cli/commands/move.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/move.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/move.command.js +212 -0
- package/dist/interfaces/cli/commands/move.command.js.map +1 -0
- package/dist/interfaces/cli/commands/rename.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/rename.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/rename.command.js +258 -0
- package/dist/interfaces/cli/commands/rename.command.js.map +1 -0
- package/dist/interfaces/cli/commands/snapshot.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/snapshot.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/snapshot.command.js +68 -0
- package/dist/interfaces/cli/commands/snapshot.command.js.map +1 -0
- package/dist/interfaces/cli/commands/types.d.ts +18 -0
- package/dist/interfaces/cli/commands/types.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/types.js +5 -0
- package/dist/interfaces/cli/commands/types.js.map +1 -0
- package/dist/interfaces/cli/index.d.ts +1 -1
- package/dist/interfaces/cli/index.d.ts.map +1 -1
- package/dist/interfaces/cli/index.js +1 -1
- package/dist/interfaces/cli/index.js.map +1 -1
- package/dist/interfaces/cli/preview-output-handler.d.ts +53 -0
- package/dist/interfaces/cli/preview-output-handler.d.ts.map +1 -0
- package/dist/interfaces/cli/preview-output-handler.js +73 -0
- package/dist/interfaces/cli/preview-output-handler.js.map +1 -0
- package/dist/interfaces/cli/unified-output-handler.d.ts +79 -0
- package/dist/interfaces/cli/unified-output-handler.d.ts.map +1 -0
- package/dist/interfaces/cli/unified-output-handler.js +149 -0
- package/dist/interfaces/cli/unified-output-handler.js.map +1 -0
- package/dist/plugins/javascript/index.d.ts +2 -2
- package/dist/plugins/javascript/index.d.ts.map +1 -1
- package/dist/plugins/javascript/index.js +1 -1
- package/dist/plugins/javascript/index.js.map +1 -1
- package/dist/plugins/javascript/types.d.ts.map +1 -1
- package/dist/plugins/javascript/types.js.map +1 -1
- package/dist/plugins/python/dependency-analyzer.d.ts +86 -0
- package/dist/plugins/python/dependency-analyzer.d.ts.map +1 -0
- package/dist/plugins/python/dependency-analyzer.js +252 -0
- package/dist/plugins/python/dependency-analyzer.js.map +1 -0
- package/dist/plugins/python/index.d.ts +9 -0
- package/dist/plugins/python/index.d.ts.map +1 -0
- package/dist/plugins/python/index.js +14 -0
- package/dist/plugins/python/index.js.map +1 -0
- package/dist/plugins/python/parser.d.ts +117 -0
- package/dist/plugins/python/parser.d.ts.map +1 -0
- package/dist/plugins/python/parser.js +414 -0
- package/dist/plugins/python/parser.js.map +1 -0
- package/dist/plugins/python/symbol-extractor.d.ts +108 -0
- package/dist/plugins/python/symbol-extractor.d.ts.map +1 -0
- package/dist/plugins/python/symbol-extractor.js +389 -0
- package/dist/plugins/python/symbol-extractor.js.map +1 -0
- package/dist/plugins/python/tree-sitter-bridge.d.ts +57 -0
- package/dist/plugins/python/tree-sitter-bridge.d.ts.map +1 -0
- package/dist/plugins/python/tree-sitter-bridge.js +267 -0
- package/dist/plugins/python/tree-sitter-bridge.js.map +1 -0
- package/dist/plugins/python/types.d.ts +179 -0
- package/dist/plugins/python/types.d.ts.map +1 -0
- package/dist/plugins/python/types.js +252 -0
- package/dist/plugins/python/types.js.map +1 -0
- package/dist/plugins/swift/dependency-analyzer.d.ts +1 -1
- package/dist/plugins/swift/dependency-analyzer.d.ts.map +1 -1
- package/dist/plugins/swift/dependency-analyzer.js +1 -1
- package/dist/plugins/swift/dependency-analyzer.js.map +1 -1
- package/dist/plugins/swift/parser.d.ts +4 -0
- package/dist/plugins/swift/parser.d.ts.map +1 -1
- package/dist/plugins/swift/parser.js +24 -6
- package/dist/plugins/swift/parser.js.map +1 -1
- package/dist/plugins/swift/symbol-extractor.d.ts +1 -1
- package/dist/plugins/swift/symbol-extractor.d.ts.map +1 -1
- package/dist/plugins/swift/symbol-extractor.js.map +1 -1
- package/dist/plugins/swift/types.d.ts.map +1 -1
- package/dist/plugins/swift/types.js.map +1 -1
- package/dist/plugins/typescript/parser.d.ts +4 -37
- package/dist/plugins/typescript/parser.d.ts.map +1 -1
- package/dist/plugins/typescript/parser.js +29 -331
- package/dist/plugins/typescript/parser.js.map +1 -1
- package/dist/plugins/typescript/symbol-extractor.d.ts.map +1 -1
- package/dist/plugins/typescript/symbol-extractor.js +12 -0
- package/dist/plugins/typescript/symbol-extractor.js.map +1 -1
- package/dist/plugins/typescript/types.d.ts.map +1 -1
- package/dist/plugins/typescript/types.js +10 -0
- package/dist/plugins/typescript/types.js.map +1 -1
- package/dist/shared/errors/config-error.d.ts +1 -1
- package/dist/shared/errors/config-error.d.ts.map +1 -1
- package/dist/shared/errors/config-error.js +1 -1
- package/dist/shared/errors/config-error.js.map +1 -1
- package/dist/shared/errors/file-error.d.ts +1 -1
- package/dist/shared/errors/file-error.d.ts.map +1 -1
- package/dist/shared/errors/file-error.js +1 -1
- package/dist/shared/errors/file-error.js.map +1 -1
- package/dist/shared/errors/index.d.ts +1 -1
- package/dist/shared/errors/index.d.ts.map +1 -1
- package/dist/shared/errors/index.js +4 -4
- package/dist/shared/errors/index.js.map +1 -1
- package/dist/shared/errors/parser-error.d.ts +1 -1
- package/dist/shared/errors/parser-error.d.ts.map +1 -1
- package/dist/shared/errors/parser-error.js +1 -1
- package/dist/shared/errors/parser-error.js.map +1 -1
- package/dist/shared/errors/validation-error.d.ts +1 -1
- package/dist/shared/errors/validation-error.d.ts.map +1 -1
- package/dist/shared/errors/validation-error.js +1 -1
- package/dist/shared/errors/validation-error.js.map +1 -1
- package/dist/shared/types/ast.d.ts +1 -1
- package/dist/shared/types/ast.d.ts.map +1 -1
- package/dist/shared/types/ast.js +1 -1
- package/dist/shared/types/ast.js.map +1 -1
- package/dist/shared/types/symbol.d.ts +3 -2
- package/dist/shared/types/symbol.d.ts.map +1 -1
- package/dist/shared/types/symbol.js +1 -0
- package/dist/shared/types/symbol.js.map +1 -1
- package/dist/shared/utils/index.d.ts +5 -5
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/index.js +5 -5
- package/dist/shared/utils/index.js.map +1 -1
- package/package.json +9 -8
- package/dist/core/analysis/index.d.ts +0 -6
- package/dist/core/analysis/index.d.ts.map +0 -1
- package/dist/core/analysis/index.js +0 -7
- package/dist/core/analysis/index.js.map +0 -1
- package/dist/core/analysis/quality-metrics.d.ts +0 -158
- package/dist/core/analysis/quality-metrics.d.ts.map +0 -1
- package/dist/core/analysis/quality-metrics.js +0 -442
- package/dist/core/analysis/quality-metrics.js.map +0 -1
- package/dist/core/indexing/file-watcher.d.ts +0 -110
- package/dist/core/indexing/file-watcher.d.ts.map +0 -1
- package/dist/core/indexing/file-watcher.js +0 -280
- package/dist/core/indexing/file-watcher.js.map +0 -1
- package/dist/core/move/import-resolver.d.ts.map +0 -1
- package/dist/core/move/import-resolver.js.map +0 -1
- package/dist/core/move/index.d.ts.map +0 -1
- package/dist/core/move/index.js.map +0 -1
- package/dist/core/move/move-service.d.ts.map +0 -1
- package/dist/core/move/move-service.js.map +0 -1
- package/dist/core/move/types.d.ts.map +0 -1
- package/dist/core/move/types.js.map +0 -1
- package/dist/core/refactor/design-patterns.d.ts +0 -178
- package/dist/core/refactor/design-patterns.d.ts.map +0 -1
- package/dist/core/refactor/design-patterns.js +0 -656
- package/dist/core/refactor/design-patterns.js.map +0 -1
- package/dist/core/refactor/extract-function.d.ts +0 -197
- package/dist/core/refactor/extract-function.d.ts.map +0 -1
- package/dist/core/refactor/extract-function.js +0 -730
- package/dist/core/refactor/extract-function.js.map +0 -1
- package/dist/core/refactor/index.d.ts +0 -8
- package/dist/core/refactor/index.d.ts.map +0 -1
- package/dist/core/refactor/index.js +0 -11
- package/dist/core/refactor/index.js.map +0 -1
- package/dist/core/refactor/inline-function.d.ts +0 -175
- package/dist/core/refactor/inline-function.d.ts.map +0 -1
- package/dist/core/refactor/inline-function.js +0 -425
- package/dist/core/refactor/inline-function.js.map +0 -1
- package/dist/core/refactor/swift-extractor.d.ts +0 -98
- package/dist/core/refactor/swift-extractor.d.ts.map +0 -1
- package/dist/core/refactor/swift-extractor.js +0 -283
- package/dist/core/refactor/swift-extractor.js.map +0 -1
- package/dist/core/search/engines/text-engine.d.ts +0 -52
- package/dist/core/search/engines/text-engine.d.ts.map +0 -1
- package/dist/core/search/engines/text-engine.js +0 -376
- package/dist/core/search/engines/text-engine.js.map +0 -1
- package/dist/core/search/index.d.ts +0 -10
- package/dist/core/search/index.d.ts.map +0 -1
- package/dist/core/search/index.js +0 -11
- package/dist/core/search/index.js.map +0 -1
- package/dist/core/search/service.d.ts +0 -105
- package/dist/core/search/service.d.ts.map +0 -1
- package/dist/core/search/service.js +0 -384
- package/dist/core/search/service.js.map +0 -1
- package/dist/core/search/types.d.ts +0 -357
- package/dist/core/search/types.d.ts.map +0 -1
- package/dist/core/search/types.js +0 -47
- package/dist/core/search/types.js.map +0 -1
- package/dist/core/shit-score/grading.d.ts +0 -39
- package/dist/core/shit-score/grading.d.ts.map +0 -1
- package/dist/core/shit-score/grading.js +0 -253
- package/dist/core/shit-score/grading.js.map +0 -1
- package/dist/core/shit-score/index.d.ts +0 -9
- package/dist/core/shit-score/index.d.ts.map +0 -1
- package/dist/core/shit-score/index.js +0 -8
- package/dist/core/shit-score/index.js.map +0 -1
- package/dist/core/shit-score/score-calculator.d.ts +0 -75
- package/dist/core/shit-score/score-calculator.d.ts.map +0 -1
- package/dist/core/shit-score/score-calculator.js +0 -240
- package/dist/core/shit-score/score-calculator.js.map +0 -1
- package/dist/core/shit-score/shit-score-analyzer.d.ts +0 -84
- package/dist/core/shit-score/shit-score-analyzer.d.ts.map +0 -1
- package/dist/core/shit-score/shit-score-analyzer.js +0 -595
- package/dist/core/shit-score/shit-score-analyzer.js.map +0 -1
- package/dist/core/shit-score/types.d.ts +0 -231
- package/dist/core/shit-score/types.d.ts.map +0 -1
- package/dist/core/shit-score/types.js +0 -73
- package/dist/core/shit-score/types.js.map +0 -1
- package/dist/core/snapshot/code-compressor.d.ts +0 -39
- package/dist/core/snapshot/code-compressor.d.ts.map +0 -1
- package/dist/core/snapshot/code-compressor.js +0 -211
- package/dist/core/snapshot/code-compressor.js.map +0 -1
- package/dist/core/snapshot/config.d.ts +0 -60
- package/dist/core/snapshot/config.d.ts.map +0 -1
- package/dist/core/snapshot/config.js +0 -136
- package/dist/core/snapshot/config.js.map +0 -1
- package/dist/core/snapshot/snapshot-differ.d.ts +0 -54
- package/dist/core/snapshot/snapshot-differ.d.ts.map +0 -1
- package/dist/core/snapshot/snapshot-differ.js +0 -262
- package/dist/core/snapshot/snapshot-differ.js.map +0 -1
- package/dist/core/snapshot/snapshot-engine.d.ts +0 -94
- package/dist/core/snapshot/snapshot-engine.d.ts.map +0 -1
- package/dist/core/snapshot/snapshot-engine.js +0 -492
- package/dist/core/snapshot/snapshot-engine.js.map +0 -1
- package/dist/infrastructure/parser/factory.d.ts +0 -141
- package/dist/infrastructure/parser/factory.d.ts.map +0 -1
- package/dist/infrastructure/parser/factory.js +0 -306
- package/dist/infrastructure/parser/factory.js.map +0 -1
- package/dist/infrastructure/storage/file-watcher.d.ts +0 -84
- package/dist/infrastructure/storage/file-watcher.d.ts.map +0 -1
- package/dist/infrastructure/storage/file-watcher.js +0 -249
- package/dist/infrastructure/storage/file-watcher.js.map +0 -1
- package/dist/infrastructure/storage/path-utils.d.ts +0 -96
- package/dist/infrastructure/storage/path-utils.d.ts.map +0 -1
- package/dist/infrastructure/storage/path-utils.js +0 -272
- package/dist/infrastructure/storage/path-utils.js.map +0 -1
- package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts +0 -41
- package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/complexity-analyzer.js +0 -206
- package/dist/plugins/swift/analyzers/complexity-analyzer.js.map +0 -1
- package/dist/plugins/swift/analyzers/duplication-detector.d.ts +0 -89
- package/dist/plugins/swift/analyzers/duplication-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/duplication-detector.js +0 -271
- package/dist/plugins/swift/analyzers/duplication-detector.js.map +0 -1
- package/dist/plugins/swift/analyzers/error-handling-checker.d.ts +0 -34
- package/dist/plugins/swift/analyzers/error-handling-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/error-handling-checker.js +0 -135
- package/dist/plugins/swift/analyzers/error-handling-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/naming-checker.d.ts +0 -47
- package/dist/plugins/swift/analyzers/naming-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/naming-checker.js +0 -161
- package/dist/plugins/swift/analyzers/naming-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/pattern-detector.d.ts +0 -78
- package/dist/plugins/swift/analyzers/pattern-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/pattern-detector.js +0 -247
- package/dist/plugins/swift/analyzers/pattern-detector.js.map +0 -1
- package/dist/plugins/swift/analyzers/security-checker.d.ts +0 -38
- package/dist/plugins/swift/analyzers/security-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/security-checker.js +0 -135
- package/dist/plugins/swift/analyzers/security-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/test-coverage-checker.d.ts +0 -26
- package/dist/plugins/swift/analyzers/test-coverage-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/test-coverage-checker.js +0 -63
- package/dist/plugins/swift/analyzers/test-coverage-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/type-safety-checker.d.ts +0 -41
- package/dist/plugins/swift/analyzers/type-safety-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/type-safety-checker.js +0 -121
- package/dist/plugins/swift/analyzers/type-safety-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts +0 -38
- package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/unused-symbol-detector.js +0 -211
- package/dist/plugins/swift/analyzers/unused-symbol-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts +0 -39
- package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/complexity-analyzer.js +0 -196
- package/dist/plugins/typescript/analyzers/complexity-analyzer.js.map +0 -1
- package/dist/plugins/typescript/analyzers/duplication-detector.d.ts +0 -181
- package/dist/plugins/typescript/analyzers/duplication-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/duplication-detector.js +0 -695
- package/dist/plugins/typescript/analyzers/duplication-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts +0 -26
- package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/error-handling-checker.js +0 -84
- package/dist/plugins/typescript/analyzers/error-handling-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/naming-checker.d.ts +0 -30
- package/dist/plugins/typescript/analyzers/naming-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/naming-checker.js +0 -116
- package/dist/plugins/typescript/analyzers/naming-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/pattern-detector.d.ts +0 -80
- package/dist/plugins/typescript/analyzers/pattern-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/pattern-detector.js +0 -267
- package/dist/plugins/typescript/analyzers/pattern-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/security-checker.d.ts +0 -34
- package/dist/plugins/typescript/analyzers/security-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/security-checker.js +0 -126
- package/dist/plugins/typescript/analyzers/security-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/test-coverage-checker.d.ts +0 -22
- package/dist/plugins/typescript/analyzers/test-coverage-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/test-coverage-checker.js +0 -62
- package/dist/plugins/typescript/analyzers/test-coverage-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts +0 -32
- package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/type-safety-checker.js +0 -86
- package/dist/plugins/typescript/analyzers/type-safety-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts +0 -47
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.js +0 -152
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.js.map +0 -1
- /package/dist/core/{move → move-file}/import-resolver.d.ts +0 -0
- /package/dist/core/{move → move-file}/types.d.ts +0 -0
- /package/dist/core/{move → move-file}/types.js +0 -0
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { PathInfo } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* 路徑工具類別
|
|
4
|
-
* 提供跨平台的路徑處理功能
|
|
5
|
-
*/
|
|
6
|
-
export declare class PathUtils {
|
|
7
|
-
/**
|
|
8
|
-
* 正規化路徑
|
|
9
|
-
*/
|
|
10
|
-
static normalize(filePath: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* 解析為絕對路徑
|
|
13
|
-
*/
|
|
14
|
-
static resolve(...segments: string[]): string;
|
|
15
|
-
/**
|
|
16
|
-
* 組合路徑片段
|
|
17
|
-
*/
|
|
18
|
-
static join(...segments: string[]): string;
|
|
19
|
-
/**
|
|
20
|
-
* 計算相對路徑
|
|
21
|
-
*/
|
|
22
|
-
static relative(from: string, to: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* 檢查是否為絕對路徑
|
|
25
|
-
*/
|
|
26
|
-
static isAbsolute(filePath: string): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 獲取目錄名
|
|
29
|
-
*/
|
|
30
|
-
static dirname(filePath: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* 獲取基礎檔名
|
|
33
|
-
*/
|
|
34
|
-
static basename(filePath: string, ext?: string): string;
|
|
35
|
-
/**
|
|
36
|
-
* 獲取副檔名
|
|
37
|
-
*/
|
|
38
|
-
static extname(filePath: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* 解析路徑為組件
|
|
41
|
-
*/
|
|
42
|
-
static parse(filePath: string): PathInfo;
|
|
43
|
-
/**
|
|
44
|
-
* 從組件格式化路徑
|
|
45
|
-
*/
|
|
46
|
-
static format(pathObj: Partial<PathInfo>): string;
|
|
47
|
-
/**
|
|
48
|
-
* 檢查是否為子路徑
|
|
49
|
-
*/
|
|
50
|
-
static isSubPath(parent: string, child: string): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* 找到路徑的共同前綴
|
|
53
|
-
*/
|
|
54
|
-
static getCommonPath(paths: string[]): string;
|
|
55
|
-
/**
|
|
56
|
-
* 確保檔案有指定副檔名
|
|
57
|
-
*/
|
|
58
|
-
static ensureExtension(filePath: string, extension: string): string;
|
|
59
|
-
/**
|
|
60
|
-
* 變更檔案副檔名
|
|
61
|
-
*/
|
|
62
|
-
static changeExtension(filePath: string, newExtension: string): string;
|
|
63
|
-
/**
|
|
64
|
-
* 移除檔案副檔名
|
|
65
|
-
*/
|
|
66
|
-
static removeExtension(filePath: string): string;
|
|
67
|
-
/**
|
|
68
|
-
* 轉換為 Unix 風格路徑
|
|
69
|
-
*/
|
|
70
|
-
static toUnix(filePath: string): string;
|
|
71
|
-
/**
|
|
72
|
-
* 轉換為 POSIX 路徑
|
|
73
|
-
*/
|
|
74
|
-
static toPosix(filePath: string): string;
|
|
75
|
-
/**
|
|
76
|
-
* 驗證路徑是否有效
|
|
77
|
-
*/
|
|
78
|
-
static isValidPath(filePath: string): boolean;
|
|
79
|
-
/**
|
|
80
|
-
* 獲取路徑深度
|
|
81
|
-
*/
|
|
82
|
-
static getDepth(filePath: string): number;
|
|
83
|
-
/**
|
|
84
|
-
* 檢查兩個路徑是否相等
|
|
85
|
-
*/
|
|
86
|
-
static equals(path1: string, path2: string): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* 建立安全的檔案名稱
|
|
89
|
-
*/
|
|
90
|
-
static sanitizeFilename(filename: string): string;
|
|
91
|
-
/**
|
|
92
|
-
* 獲取唯一檔案路徑(如果檔案已存在,添加數字後綴)
|
|
93
|
-
*/
|
|
94
|
-
static getUniqueFilePath(filePath: string, existsChecker: (path: string) => Promise<boolean>): Promise<string>;
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=path-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/path-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;GAGG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI1C;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM;IAI7C;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM;IAI1C;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;IAIjD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI5C;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIxC;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;IAIvD;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIxC;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ;IAWxC;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM;IAUjD;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,O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(filePath) {
|
|
11
|
-
return path.normalize(filePath);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* 解析為絕對路徑
|
|
15
|
-
*/
|
|
16
|
-
static resolve(...segments) {
|
|
17
|
-
return path.resolve(...segments);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* 組合路徑片段
|
|
21
|
-
*/
|
|
22
|
-
static join(...segments) {
|
|
23
|
-
return path.join(...segments);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 計算相對路徑
|
|
27
|
-
*/
|
|
28
|
-
static relative(from, to) {
|
|
29
|
-
return path.relative(from, to);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* 檢查是否為絕對路徑
|
|
33
|
-
*/
|
|
34
|
-
static isAbsolute(filePath) {
|
|
35
|
-
return path.isAbsolute(filePath);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 獲取目錄名
|
|
39
|
-
*/
|
|
40
|
-
static dirname(filePath) {
|
|
41
|
-
return path.dirname(filePath);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* 獲取基礎檔名
|
|
45
|
-
*/
|
|
46
|
-
static basename(filePath, ext) {
|
|
47
|
-
return path.basename(filePath, ext);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* 獲取副檔名
|
|
51
|
-
*/
|
|
52
|
-
static extname(filePath) {
|
|
53
|
-
return path.extname(filePath);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 解析路徑為組件
|
|
57
|
-
*/
|
|
58
|
-
static parse(filePath) {
|
|
59
|
-
const parsed = path.parse(filePath);
|
|
60
|
-
return {
|
|
61
|
-
root: parsed.root,
|
|
62
|
-
dir: parsed.dir,
|
|
63
|
-
base: parsed.base,
|
|
64
|
-
ext: parsed.ext,
|
|
65
|
-
name: parsed.name,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* 從組件格式化路徑
|
|
70
|
-
*/
|
|
71
|
-
static format(pathObj) {
|
|
72
|
-
return path.format({
|
|
73
|
-
root: pathObj.root,
|
|
74
|
-
dir: pathObj.dir,
|
|
75
|
-
base: pathObj.base,
|
|
76
|
-
ext: pathObj.ext,
|
|
77
|
-
name: pathObj.name,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* 檢查是否為子路徑
|
|
82
|
-
*/
|
|
83
|
-
static isSubPath(parent, child) {
|
|
84
|
-
const normalizedParent = this.normalize(parent);
|
|
85
|
-
const normalizedChild = this.normalize(child);
|
|
86
|
-
// 確保父路徑以分隔符結尾,避免前綴匹配問題
|
|
87
|
-
const parentWithSep = normalizedParent.endsWith(path.sep)
|
|
88
|
-
? normalizedParent
|
|
89
|
-
: normalizedParent + path.sep;
|
|
90
|
-
// 子路徑必須以父路徑開頭,但不能完全相同
|
|
91
|
-
return normalizedChild.startsWith(parentWithSep) &&
|
|
92
|
-
normalizedChild !== normalizedParent;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* 找到路徑的共同前綴
|
|
96
|
-
*/
|
|
97
|
-
static getCommonPath(paths) {
|
|
98
|
-
if (paths.length === 0) {
|
|
99
|
-
throw new Error('至少需要一個路徑');
|
|
100
|
-
}
|
|
101
|
-
if (paths.length === 1) {
|
|
102
|
-
return this.dirname(paths[0]);
|
|
103
|
-
}
|
|
104
|
-
// 正規化所有路徑
|
|
105
|
-
const normalizedPaths = paths.map(p => this.normalize(p));
|
|
106
|
-
// 分割第一個路徑作為基準
|
|
107
|
-
const firstPath = normalizedPaths[0];
|
|
108
|
-
const segments = firstPath.split(path.sep);
|
|
109
|
-
const commonSegments = [];
|
|
110
|
-
// 逐個比較每個路徑段
|
|
111
|
-
for (let i = 0; i < segments.length; i++) {
|
|
112
|
-
const segment = segments[i];
|
|
113
|
-
const isCommon = normalizedPaths.every(p => {
|
|
114
|
-
const pathSegments = p.split(path.sep);
|
|
115
|
-
return pathSegments[i] === segment;
|
|
116
|
-
});
|
|
117
|
-
if (isCommon) {
|
|
118
|
-
commonSegments.push(segment);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
// 如果沒有共同前綴,返回根路徑
|
|
125
|
-
if (commonSegments.length === 0) {
|
|
126
|
-
return path.sep;
|
|
127
|
-
}
|
|
128
|
-
return commonSegments.join(path.sep) || path.sep;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* 確保檔案有指定副檔名
|
|
132
|
-
*/
|
|
133
|
-
static ensureExtension(filePath, extension) {
|
|
134
|
-
const currentExt = this.extname(filePath);
|
|
135
|
-
// 如果已有副檔名,不變更
|
|
136
|
-
if (currentExt) {
|
|
137
|
-
return filePath;
|
|
138
|
-
}
|
|
139
|
-
// 確保副檔名有點
|
|
140
|
-
const normalizedExt = extension.startsWith('.') ? extension : `.${extension}`;
|
|
141
|
-
return filePath + normalizedExt;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* 變更檔案副檔名
|
|
145
|
-
*/
|
|
146
|
-
static changeExtension(filePath, newExtension) {
|
|
147
|
-
const parsed = this.parse(filePath);
|
|
148
|
-
// 確保副檔名有點
|
|
149
|
-
const normalizedExt = newExtension.startsWith('.') ? newExtension : `.${newExtension}`;
|
|
150
|
-
return this.format({
|
|
151
|
-
...parsed,
|
|
152
|
-
ext: normalizedExt,
|
|
153
|
-
base: undefined, // 清除 base,讓 format 使用 name + ext
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* 移除檔案副檔名
|
|
158
|
-
*/
|
|
159
|
-
static removeExtension(filePath) {
|
|
160
|
-
const parsed = this.parse(filePath);
|
|
161
|
-
return this.format({
|
|
162
|
-
...parsed,
|
|
163
|
-
ext: '',
|
|
164
|
-
base: undefined, // 清除 base,讓 format 使用 name
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* 轉換為 Unix 風格路徑
|
|
169
|
-
*/
|
|
170
|
-
static toUnix(filePath) {
|
|
171
|
-
return filePath.replace(/\\/g, '/');
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* 轉換為 POSIX 路徑
|
|
175
|
-
*/
|
|
176
|
-
static toPosix(filePath) {
|
|
177
|
-
return path.posix.normalize(this.toUnix(filePath));
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* 驗證路徑是否有效
|
|
181
|
-
*/
|
|
182
|
-
static isValidPath(filePath) {
|
|
183
|
-
if (!filePath || filePath.trim() === '') {
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
// 檢查無效字元
|
|
187
|
-
const invalidChars = process.platform === 'win32'
|
|
188
|
-
? /[<>:"|?*]/
|
|
189
|
-
: /[<>|]/;
|
|
190
|
-
if (invalidChars.test(filePath)) {
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
193
|
-
// 檢查保留名稱 (Windows)
|
|
194
|
-
if (process.platform === 'win32') {
|
|
195
|
-
const reservedNames = /^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\..*)?$/i;
|
|
196
|
-
const basename = this.basename(filePath);
|
|
197
|
-
if (reservedNames.test(basename)) {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
try {
|
|
202
|
-
// 嘗試解析路徑
|
|
203
|
-
this.parse(filePath);
|
|
204
|
-
return true;
|
|
205
|
-
}
|
|
206
|
-
catch {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* 獲取路徑深度
|
|
212
|
-
*/
|
|
213
|
-
static getDepth(filePath) {
|
|
214
|
-
const normalized = this.normalize(filePath);
|
|
215
|
-
const segments = normalized.split(path.sep).filter(s => s && s !== '.');
|
|
216
|
-
return segments.length;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* 檢查兩個路徑是否相等
|
|
220
|
-
*/
|
|
221
|
-
static equals(path1, path2) {
|
|
222
|
-
const normalized1 = this.normalize(path1);
|
|
223
|
-
const normalized2 = this.normalize(path2);
|
|
224
|
-
// 在 Windows 上忽略大小寫
|
|
225
|
-
if (process.platform === 'win32') {
|
|
226
|
-
return normalized1.toLowerCase() === normalized2.toLowerCase();
|
|
227
|
-
}
|
|
228
|
-
return normalized1 === normalized2;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* 建立安全的檔案名稱
|
|
232
|
-
*/
|
|
233
|
-
static sanitizeFilename(filename) {
|
|
234
|
-
// 移除或替換無效字元
|
|
235
|
-
let sanitized = filename
|
|
236
|
-
.replace(/[<>:"|?*]/g, '_') // Windows 無效字元
|
|
237
|
-
.replace(/[\x00-\x1f\x80-\x9f]/g, '_') // 控制字元
|
|
238
|
-
.replace(/^\.+/, '_') // 避免以點開頭
|
|
239
|
-
.trim();
|
|
240
|
-
// 檢查長度限制
|
|
241
|
-
const maxLength = process.platform === 'win32' ? 255 : 255;
|
|
242
|
-
if (sanitized.length > maxLength) {
|
|
243
|
-
const ext = this.extname(sanitized);
|
|
244
|
-
const nameWithoutExt = this.removeExtension(sanitized);
|
|
245
|
-
const truncatedName = nameWithoutExt.substring(0, maxLength - ext.length);
|
|
246
|
-
sanitized = truncatedName + ext;
|
|
247
|
-
}
|
|
248
|
-
return sanitized || 'unnamed';
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* 獲取唯一檔案路徑(如果檔案已存在,添加數字後綴)
|
|
252
|
-
*/
|
|
253
|
-
static async getUniqueFilePath(filePath, existsChecker) {
|
|
254
|
-
if (!(await existsChecker(filePath))) {
|
|
255
|
-
return filePath;
|
|
256
|
-
}
|
|
257
|
-
const parsed = this.parse(filePath);
|
|
258
|
-
let counter = 1;
|
|
259
|
-
while (true) {
|
|
260
|
-
const uniquePath = this.format({
|
|
261
|
-
...parsed,
|
|
262
|
-
name: `${parsed.name}(${counter})`,
|
|
263
|
-
base: undefined,
|
|
264
|
-
});
|
|
265
|
-
if (!(await existsChecker(uniquePath))) {
|
|
266
|
-
return uniquePath;
|
|
267
|
-
}
|
|
268
|
-
counter++;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
//# sourceMappingURL=path-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../../src/infrastructure/storage/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B;;;GAGG;AACH,MAAM,OAAO,SAAS;IACpB;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,QAAgB;QAC/B,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,QAAkB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,QAAkB;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAY,EAAE,EAAU;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,QAAgB;QAChC,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,QAAgB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAgB,EAAE,GAAY;QAC5C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ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AAc,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;YAC1E,SAAS,GAAG,aAAa,GAAG,GAAG,CAAC;QAClC,CAAC;QAED,OAAO,SAAS,IAAI,SAAS,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAC5B,QAAgB,EAChB,aAAiD;QAEjD,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;YACrC,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;gBAC7B,GAAG,MAAM;gBACT,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,GAAG;gBAClC,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;YAEH,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;gBACvC,OAAO,UAAU,CAAC;YACpB,CAAC;YAED,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Swift 複雜度分析器
|
|
3
|
-
* 提供循環複雜度和認知複雜度分析功能
|
|
4
|
-
*/
|
|
5
|
-
import type { ComplexityMetrics } from '../../../infrastructure/parser/analysis-types.js';
|
|
6
|
-
/**
|
|
7
|
-
* Swift 複雜度分析器
|
|
8
|
-
*/
|
|
9
|
-
export declare class ComplexityAnalyzer {
|
|
10
|
-
/**
|
|
11
|
-
* 分析程式碼複雜度
|
|
12
|
-
* @param code 原始程式碼
|
|
13
|
-
* @returns 複雜度指標
|
|
14
|
-
*/
|
|
15
|
-
analyze(code: string): Promise<ComplexityMetrics>;
|
|
16
|
-
/**
|
|
17
|
-
* 提取所有函式
|
|
18
|
-
*/
|
|
19
|
-
private extractFunctions;
|
|
20
|
-
/**
|
|
21
|
-
* 找到配對的右大括號
|
|
22
|
-
*/
|
|
23
|
-
private findMatchingBrace;
|
|
24
|
-
/**
|
|
25
|
-
* 計算循環複雜度(McCabe)
|
|
26
|
-
*/
|
|
27
|
-
private calculateCyclomaticComplexity;
|
|
28
|
-
/**
|
|
29
|
-
* 計算認知複雜度
|
|
30
|
-
*/
|
|
31
|
-
private calculateCognitiveComplexity;
|
|
32
|
-
/**
|
|
33
|
-
* 評估複雜度等級
|
|
34
|
-
*/
|
|
35
|
-
private evaluateComplexity;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 預設導出分析函式
|
|
39
|
-
*/
|
|
40
|
-
export default function analyzeComplexity(code: string): Promise<ComplexityMetrics>;
|
|
41
|
-
//# sourceMappingURL=complexity-analyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"complexity-analyzer.d.ts","sourceRoot":"","sources":["../../../../src/plugins/swift/analyzers/complexity-analyzer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AAW1F;;GAEG;AACH,qBAAa,kBAAkB;IAC7B;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA2DvD;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiCxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmCzB;;OAEG;IACH,OAAO,CAAC,6BAA6B;IA4BrC;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAuCpC;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAY3B;AAED;;GAEG;AACH,wBAA8B,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAGxF"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Swift 複雜度分析器
|
|
3
|
-
* 提供循環複雜度和認知複雜度分析功能
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Swift 複雜度分析器
|
|
7
|
-
*/
|
|
8
|
-
export class ComplexityAnalyzer {
|
|
9
|
-
/**
|
|
10
|
-
* 分析程式碼複雜度
|
|
11
|
-
* @param code 原始程式碼
|
|
12
|
-
* @returns 複雜度指標
|
|
13
|
-
*/
|
|
14
|
-
async analyze(code) {
|
|
15
|
-
if (!code || code.trim().length === 0) {
|
|
16
|
-
return {
|
|
17
|
-
cyclomaticComplexity: 1,
|
|
18
|
-
cognitiveComplexity: 0,
|
|
19
|
-
evaluation: 'simple',
|
|
20
|
-
functionCount: 0,
|
|
21
|
-
averageComplexity: 0,
|
|
22
|
-
maxComplexity: 0
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const functions = this.extractFunctions(code);
|
|
26
|
-
if (functions.length === 0) {
|
|
27
|
-
return {
|
|
28
|
-
cyclomaticComplexity: 1,
|
|
29
|
-
cognitiveComplexity: 0,
|
|
30
|
-
evaluation: 'simple',
|
|
31
|
-
functionCount: 0,
|
|
32
|
-
averageComplexity: 0,
|
|
33
|
-
maxComplexity: 0
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
// 計算每個函式的複雜度
|
|
37
|
-
const functionComplexities = functions.map(fn => ({
|
|
38
|
-
name: fn.name,
|
|
39
|
-
cyclomaticComplexity: this.calculateCyclomaticComplexity(fn.body),
|
|
40
|
-
cognitiveComplexity: this.calculateCognitiveComplexity(fn.body)
|
|
41
|
-
}));
|
|
42
|
-
// 聚合統計
|
|
43
|
-
const totalCyclomatic = functionComplexities.reduce((sum, fn) => sum + fn.cyclomaticComplexity, 0);
|
|
44
|
-
const totalCognitive = functionComplexities.reduce((sum, fn) => sum + fn.cognitiveComplexity, 0);
|
|
45
|
-
const maxComplexity = Math.max(...functionComplexities.map(fn => fn.cyclomaticComplexity));
|
|
46
|
-
const maxComplexityFunction = functionComplexities.find(fn => fn.cyclomaticComplexity === maxComplexity);
|
|
47
|
-
return {
|
|
48
|
-
cyclomaticComplexity: totalCyclomatic,
|
|
49
|
-
cognitiveComplexity: totalCognitive,
|
|
50
|
-
evaluation: this.evaluateComplexity(maxComplexity),
|
|
51
|
-
functionCount: functions.length,
|
|
52
|
-
averageComplexity: totalCyclomatic / functions.length,
|
|
53
|
-
maxComplexity,
|
|
54
|
-
maxComplexityFunction: maxComplexityFunction?.name
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* 提取所有函式
|
|
59
|
-
*/
|
|
60
|
-
extractFunctions(code) {
|
|
61
|
-
const functions = [];
|
|
62
|
-
// Swift 函式模式:func name(...) { ... }
|
|
63
|
-
const funcRegex = /func\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*\([^)]*\)\s*(?:throws\s+)?(?:->\s*[^{]+)?\s*\{/g;
|
|
64
|
-
let match;
|
|
65
|
-
while ((match = funcRegex.exec(code)) !== null) {
|
|
66
|
-
const funcName = match[1];
|
|
67
|
-
const startPos = match.index + match[0].length - 1;
|
|
68
|
-
const endPos = this.findMatchingBrace(code, startPos);
|
|
69
|
-
if (endPos !== -1) {
|
|
70
|
-
const body = code.substring(startPos + 1, endPos);
|
|
71
|
-
functions.push({ name: funcName, body });
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// SwiftUI body property
|
|
75
|
-
const bodyRegex = /var\s+body:\s*some\s+View\s*\{/g;
|
|
76
|
-
while ((match = bodyRegex.exec(code)) !== null) {
|
|
77
|
-
const startPos = match.index + match[0].length - 1;
|
|
78
|
-
const endPos = this.findMatchingBrace(code, startPos);
|
|
79
|
-
if (endPos !== -1) {
|
|
80
|
-
const body = code.substring(startPos + 1, endPos);
|
|
81
|
-
functions.push({ name: 'body', body });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return functions;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* 找到配對的右大括號
|
|
88
|
-
*/
|
|
89
|
-
findMatchingBrace(content, startPos) {
|
|
90
|
-
let braceCount = 1;
|
|
91
|
-
let inString = false;
|
|
92
|
-
let stringChar = '';
|
|
93
|
-
for (let i = startPos + 1; i < content.length; i++) {
|
|
94
|
-
const char = content[i];
|
|
95
|
-
const prevChar = content[i - 1];
|
|
96
|
-
// 處理字串
|
|
97
|
-
if ((char === '"' || char === '\'') && prevChar !== '\\') {
|
|
98
|
-
if (!inString) {
|
|
99
|
-
inString = true;
|
|
100
|
-
stringChar = char;
|
|
101
|
-
}
|
|
102
|
-
else if (char === stringChar) {
|
|
103
|
-
inString = false;
|
|
104
|
-
}
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
if (!inString) {
|
|
108
|
-
if (char === '{') {
|
|
109
|
-
braceCount++;
|
|
110
|
-
}
|
|
111
|
-
else if (char === '}') {
|
|
112
|
-
braceCount--;
|
|
113
|
-
if (braceCount === 0) {
|
|
114
|
-
return i;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return -1;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* 計算循環複雜度(McCabe)
|
|
123
|
-
*/
|
|
124
|
-
calculateCyclomaticComplexity(code) {
|
|
125
|
-
let complexity = 1; // 基礎路徑
|
|
126
|
-
// Swift 條件分支
|
|
127
|
-
const patterns = [
|
|
128
|
-
/\bif\b/g, // if
|
|
129
|
-
/\bguard\b/g, // guard
|
|
130
|
-
/\belse\s+if\b/g, // else if
|
|
131
|
-
/\bwhile\b/g, // while
|
|
132
|
-
/\bfor\b/g, // for
|
|
133
|
-
/\brepeat\b/g, // repeat
|
|
134
|
-
/\bcase\b/g, // switch case
|
|
135
|
-
/\bcatch\b/g, // catch
|
|
136
|
-
/\?\?/g, // nil coalescing
|
|
137
|
-
/\&\&/g, // logical AND
|
|
138
|
-
/\|\|/g // logical OR
|
|
139
|
-
];
|
|
140
|
-
for (const pattern of patterns) {
|
|
141
|
-
const matches = code.match(pattern);
|
|
142
|
-
if (matches) {
|
|
143
|
-
complexity += matches.length;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return complexity;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* 計算認知複雜度
|
|
150
|
-
*/
|
|
151
|
-
calculateCognitiveComplexity(code) {
|
|
152
|
-
let complexity = 0;
|
|
153
|
-
const lines = code.split('\n');
|
|
154
|
-
let nestingLevel = 0;
|
|
155
|
-
let braceCount = 0;
|
|
156
|
-
for (const line of lines) {
|
|
157
|
-
const trimmed = line.trim();
|
|
158
|
-
// 計算大括號層級
|
|
159
|
-
for (const char of trimmed) {
|
|
160
|
-
if (char === '{') {
|
|
161
|
-
braceCount++;
|
|
162
|
-
}
|
|
163
|
-
else if (char === '}') {
|
|
164
|
-
braceCount--;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
nestingLevel = Math.max(0, braceCount);
|
|
168
|
-
// 增加複雜度的控制結構
|
|
169
|
-
if (/\b(if|guard|while|for|switch|catch)\b/.test(trimmed)) {
|
|
170
|
-
complexity += 1 + nestingLevel;
|
|
171
|
-
}
|
|
172
|
-
// 邏輯運算符
|
|
173
|
-
if (/(\&\&|\|\|)/.test(trimmed)) {
|
|
174
|
-
complexity += 1;
|
|
175
|
-
}
|
|
176
|
-
// 嵌套三元運算符
|
|
177
|
-
if (/\?.*:/.test(trimmed)) {
|
|
178
|
-
complexity += 1;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return complexity;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* 評估複雜度等級
|
|
185
|
-
*/
|
|
186
|
-
evaluateComplexity(complexity) {
|
|
187
|
-
if (complexity <= 5) {
|
|
188
|
-
return 'simple';
|
|
189
|
-
}
|
|
190
|
-
if (complexity <= 10) {
|
|
191
|
-
return 'moderate';
|
|
192
|
-
}
|
|
193
|
-
if (complexity <= 20) {
|
|
194
|
-
return 'complex';
|
|
195
|
-
}
|
|
196
|
-
return 'very-complex';
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* 預設導出分析函式
|
|
201
|
-
*/
|
|
202
|
-
export default async function analyzeComplexity(code) {
|
|
203
|
-
const analyzer = new ComplexityAnalyzer();
|
|
204
|
-
return analyzer.analyze(code);
|
|
205
|
-
}
|
|
206
|
-
//# sourceMappingURL=complexity-analyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"complexity-analyzer.js","sourceRoot":"","sources":["../../../../src/plugins/swift/analyzers/complexity-analyzer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC7B;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,IAAY;QACxB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,OAAO;gBACL,oBAAoB,EAAE,CAAC;gBACvB,mBAAmB,EAAE,CAAC;gBACtB,UAAU,EAAE,QAAQ;gBACpB,aAAa,EAAE,CAAC;gBAChB,iBAAiB,EAAE,CAAC;gBACpB,aAAa,EAAE,CAAC;aACjB,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAE9C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO;gBACL,oBAAoB,EAAE,CAAC;gBACvB,mBAAmB,EAAE,CAAC;gBACtB,UAAU,EAAE,QAAQ;gBACpB,aAAa,EAAE,CAAC;gBAChB,iBAAiB,EAAE,CAAC;gBACpB,aAAa,EAAE,CAAC;aACjB,CAAC;QACJ,CAAC;QAED,aAAa;QACb,MAAM,oBAAoB,GAAG,SAAS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