semantic-complexity 0.0.1-cedf2072

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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/dist/ast/index.d.ts +2 -0
  3. package/dist/ast/index.d.ts.map +1 -0
  4. package/dist/ast/index.js +2 -0
  5. package/dist/ast/index.js.map +1 -0
  6. package/dist/ast/parser.d.ts +27 -0
  7. package/dist/ast/parser.d.ts.map +1 -0
  8. package/dist/ast/parser.js +273 -0
  9. package/dist/ast/parser.js.map +1 -0
  10. package/dist/compare.d.ts +31 -0
  11. package/dist/compare.d.ts.map +1 -0
  12. package/dist/compare.js +354 -0
  13. package/dist/compare.js.map +1 -0
  14. package/dist/context/index.d.ts +41 -0
  15. package/dist/context/index.d.ts.map +1 -0
  16. package/dist/context/index.js +253 -0
  17. package/dist/context/index.js.map +1 -0
  18. package/dist/graph/call.d.ts +63 -0
  19. package/dist/graph/call.d.ts.map +1 -0
  20. package/dist/graph/call.js +240 -0
  21. package/dist/graph/call.js.map +1 -0
  22. package/dist/graph/dependency.d.ts +52 -0
  23. package/dist/graph/dependency.d.ts.map +1 -0
  24. package/dist/graph/dependency.js +296 -0
  25. package/dist/graph/dependency.js.map +1 -0
  26. package/dist/graph/index.d.ts +3 -0
  27. package/dist/graph/index.d.ts.map +1 -0
  28. package/dist/graph/index.js +3 -0
  29. package/dist/graph/index.js.map +1 -0
  30. package/dist/index.d.ts +21 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +34 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/metrics/cognitive.d.ts +42 -0
  35. package/dist/metrics/cognitive.d.ts.map +1 -0
  36. package/dist/metrics/cognitive.js +204 -0
  37. package/dist/metrics/cognitive.js.map +1 -0
  38. package/dist/metrics/cyclomatic.d.ts +31 -0
  39. package/dist/metrics/cyclomatic.d.ts.map +1 -0
  40. package/dist/metrics/cyclomatic.js +121 -0
  41. package/dist/metrics/cyclomatic.js.map +1 -0
  42. package/dist/metrics/dimensional.d.ts +32 -0
  43. package/dist/metrics/dimensional.d.ts.map +1 -0
  44. package/dist/metrics/dimensional.js +560 -0
  45. package/dist/metrics/dimensional.js.map +1 -0
  46. package/dist/metrics/index.d.ts +26 -0
  47. package/dist/metrics/index.d.ts.map +1 -0
  48. package/dist/metrics/index.js +120 -0
  49. package/dist/metrics/index.js.map +1 -0
  50. package/dist/types.d.ts +341 -0
  51. package/dist/types.d.ts.map +1 -0
  52. package/dist/types.js +22 -0
  53. package/dist/types.js.map +1 -0
  54. package/package.json +71 -0
@@ -0,0 +1,120 @@
1
+ import ts from 'typescript';
2
+ import { extractFunctionInfo, extractImports, extractExports } from '../ast/parser.js';
3
+ import { calculateCyclomaticComplexity } from './cyclomatic.js';
4
+ import { calculateCognitiveComplexity } from './cognitive.js';
5
+ import { analyzeDimensionalComplexity, DEFAULT_WEIGHTS } from './dimensional.js';
6
+ export { calculateCyclomaticComplexity, analyzeFunctionCyclomatic, analyzeFileCyclomatic, } from './cyclomatic.js';
7
+ export { calculateCognitiveComplexity, analyzeFunctionCognitive, analyzeFileCognitive, } from './cognitive.js';
8
+ export { analyzeStateComplexity, analyzeAsyncComplexity, analyzeCouplingComplexity, analyzeDimensionalComplexity, DEFAULT_WEIGHTS, } from './dimensional.js';
9
+ /**
10
+ * 함수의 순환복잡도와 인지복잡도를 모두 계산
11
+ */
12
+ export function analyzeFunction(functionNode, sourceFile, functionInfo) {
13
+ const cyclomatic = calculateCyclomaticComplexity(functionNode, sourceFile);
14
+ const cognitive = calculateCognitiveComplexity(functionNode, sourceFile, functionInfo.name !== '<anonymous>' ? functionInfo.name : undefined);
15
+ // 상세 정보 병합 (인지복잡도 기준, 더 상세함)
16
+ return {
17
+ function: functionInfo,
18
+ cyclomatic: cyclomatic.complexity,
19
+ cognitive: cognitive.complexity,
20
+ details: cognitive.details,
21
+ };
22
+ }
23
+ /**
24
+ * 함수의 확장된 복잡도 분석 (차원 복잡도 포함)
25
+ */
26
+ export function analyzeFunctionExtended(functionNode, sourceFile, functionInfo, weights = DEFAULT_WEIGHTS) {
27
+ const cyclomatic = calculateCyclomaticComplexity(functionNode, sourceFile);
28
+ const cognitive = calculateCognitiveComplexity(functionNode, sourceFile, functionInfo.name !== '<anonymous>' ? functionInfo.name : undefined);
29
+ // nesting penalty 계산 (인지복잡도 - 순환복잡도 기반 추정)
30
+ const nestingPenalty = cognitive.details
31
+ .filter((d) => d.nestingLevel > 0)
32
+ .reduce((sum, d) => sum + d.nestingLevel, 0);
33
+ // 차원 복잡도 분석
34
+ const dimensional = analyzeDimensionalComplexity(functionNode, sourceFile, cyclomatic.complexity, nestingPenalty, weights);
35
+ return {
36
+ function: functionInfo,
37
+ cyclomatic: cyclomatic.complexity,
38
+ cognitive: cognitive.complexity,
39
+ details: cognitive.details,
40
+ dimensional,
41
+ };
42
+ }
43
+ /**
44
+ * 소스 파일의 모든 함수에 대한 복잡도 분석
45
+ */
46
+ export function analyzeFile(sourceFile) {
47
+ const functions = [];
48
+ function visit(node, className) {
49
+ // 클래스 처리
50
+ if (ts.isClassDeclaration(node) || ts.isClassExpression(node)) {
51
+ const name = node.name?.getText(sourceFile) ?? '<anonymous>';
52
+ node.members.forEach((member) => visit(member, name));
53
+ return;
54
+ }
55
+ // 함수 노드 확인
56
+ const functionInfo = extractFunctionInfo(node, sourceFile, className);
57
+ if (functionInfo) {
58
+ const result = analyzeFunction(node, sourceFile, functionInfo);
59
+ functions.push(result);
60
+ }
61
+ // 최상위 레벨만 순회 (중첩 함수는 상위 함수에서 처리)
62
+ }
63
+ ts.forEachChild(sourceFile, (node) => visit(node));
64
+ // 통계 계산
65
+ const totalCyclomatic = functions.reduce((sum, f) => sum + f.cyclomatic, 0);
66
+ const totalCognitive = functions.reduce((sum, f) => sum + f.cognitive, 0);
67
+ const count = functions.length || 1;
68
+ return {
69
+ filePath: sourceFile.fileName,
70
+ functions,
71
+ imports: extractImports(sourceFile),
72
+ exports: extractExports(sourceFile),
73
+ totalCyclomatic,
74
+ totalCognitive,
75
+ averageCyclomatic: totalCyclomatic / count,
76
+ averageCognitive: totalCognitive / count,
77
+ };
78
+ }
79
+ /**
80
+ * 복잡도 등급 판정
81
+ */
82
+ export function getComplexityGrade(cyclomatic, cognitive) {
83
+ // 인지복잡도 기준 (SonarQube 기준)
84
+ if (cognitive <= 5 && cyclomatic <= 5)
85
+ return 'low';
86
+ if (cognitive <= 10 && cyclomatic <= 10)
87
+ return 'moderate';
88
+ if (cognitive <= 20 && cyclomatic <= 20)
89
+ return 'high';
90
+ return 'very-high';
91
+ }
92
+ /**
93
+ * 복잡도 요약 생성 (MCP용)
94
+ */
95
+ export function generateComplexitySummary(result) {
96
+ const lines = [
97
+ `## 파일: ${result.filePath}`,
98
+ '',
99
+ `총 함수 수: ${result.functions.length}`,
100
+ `평균 순환복잡도: ${result.averageCyclomatic.toFixed(1)}`,
101
+ `평균 인지복잡도: ${result.averageCognitive.toFixed(1)}`,
102
+ '',
103
+ ];
104
+ // 복잡도가 높은 함수 목록
105
+ const highComplexity = result.functions
106
+ .filter((f) => f.cyclomatic > 10 || f.cognitive > 15)
107
+ .sort((a, b) => b.cognitive - a.cognitive);
108
+ if (highComplexity.length > 0) {
109
+ lines.push('### 리팩토링 권장 함수');
110
+ lines.push('');
111
+ for (const func of highComplexity) {
112
+ const grade = getComplexityGrade(func.cyclomatic, func.cognitive);
113
+ const loc = func.function.location;
114
+ lines.push(`- **${func.function.name}** (${loc.startLine}행): ` +
115
+ `순환=${func.cyclomatic}, 인지=${func.cognitive} [${grade}]`);
116
+ }
117
+ }
118
+ return lines.join('\n');
119
+ }
120
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/metrics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAQ5B,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,k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K,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,341 @@
1
+ /**
2
+ * 소스 위치 정보
3
+ */
4
+ export interface SourceLocation {
5
+ filePath: string;
6
+ startLine: number;
7
+ startColumn: number;
8
+ endLine: number;
9
+ endColumn: number;
10
+ }
11
+ /**
12
+ * 함수/메서드 정보
13
+ */
14
+ export interface FunctionInfo {
15
+ name: string;
16
+ kind: 'function' | 'method' | 'arrow' | 'getter' | 'setter' | 'constructor';
17
+ location: SourceLocation;
18
+ isAsync: boolean;
19
+ isGenerator: boolean;
20
+ isExported: boolean;
21
+ parameters: ParameterInfo[];
22
+ returnType?: string;
23
+ className?: string;
24
+ }
25
+ /**
26
+ * 파라미터 정보
27
+ */
28
+ export interface ParameterInfo {
29
+ name: string;
30
+ type?: string;
31
+ isOptional: boolean;
32
+ isRest: boolean;
33
+ hasDefault: boolean;
34
+ }
35
+ /**
36
+ * 복잡도 결과
37
+ */
38
+ export interface ComplexityResult {
39
+ function: FunctionInfo;
40
+ cyclomatic: number;
41
+ cognitive: number;
42
+ details: ComplexityDetail[];
43
+ }
44
+ /**
45
+ * 복잡도 상세 정보
46
+ */
47
+ export interface ComplexityDetail {
48
+ type: ComplexityContributor;
49
+ location: SourceLocation;
50
+ increment: number;
51
+ nestingLevel: number;
52
+ description: string;
53
+ }
54
+ /**
55
+ * 복잡도 기여 요인
56
+ */
57
+ export type ComplexityContributor = 'if' | 'else-if' | 'else' | 'switch' | 'case' | 'for' | 'for-in' | 'for-of' | 'while' | 'do-while' | 'catch' | 'conditional' | 'logical-and' | 'logical-or' | 'nullish-coalescing' | 'optional-chaining' | 'recursion' | 'callback' | 'nested-function';
58
+ /**
59
+ * 파일 분석 결과
60
+ */
61
+ export interface FileAnalysisResult {
62
+ filePath: string;
63
+ functions: ComplexityResult[];
64
+ imports: ImportInfo[];
65
+ exports: ExportInfo[];
66
+ totalCyclomatic: number;
67
+ totalCognitive: number;
68
+ averageCyclomatic: number;
69
+ averageCognitive: number;
70
+ }
71
+ /**
72
+ * Import 정보
73
+ */
74
+ export interface ImportInfo {
75
+ source: string;
76
+ specifiers: ImportSpecifier[];
77
+ isTypeOnly: boolean;
78
+ location: SourceLocation;
79
+ }
80
+ /**
81
+ * Import 세부 정보
82
+ */
83
+ export interface ImportSpecifier {
84
+ name: string;
85
+ alias?: string;
86
+ isDefault: boolean;
87
+ isNamespace: boolean;
88
+ }
89
+ /**
90
+ * Export 정보
91
+ */
92
+ export interface ExportInfo {
93
+ name: string;
94
+ kind: 'function' | 'class' | 'variable' | 'type' | 'interface' | 're-export';
95
+ location: SourceLocation;
96
+ source?: string;
97
+ }
98
+ /**
99
+ * 의존성 그래프 노드
100
+ */
101
+ export interface DependencyNode {
102
+ filePath: string;
103
+ imports: string[];
104
+ importedBy: string[];
105
+ depth: number;
106
+ }
107
+ /**
108
+ * 호출 그래프 노드
109
+ */
110
+ export interface CallNode {
111
+ function: FunctionInfo;
112
+ calls: CallEdge[];
113
+ calledBy: CallEdge[];
114
+ }
115
+ /**
116
+ * 호출 그래프 엣지
117
+ */
118
+ export interface CallEdge {
119
+ from: FunctionInfo;
120
+ to: FunctionInfo;
121
+ location: SourceLocation;
122
+ isConditional: boolean;
123
+ isAsync: boolean;
124
+ }
125
+ /**
126
+ * MCP용 컨텍스트 정보
127
+ */
128
+ export interface AnalysisContext {
129
+ file: FileAnalysisResult;
130
+ dependencies: DependencyNode;
131
+ callGraph: CallNode[];
132
+ relatedFiles: FileAnalysisResult[];
133
+ projectInfo?: ProjectInfo;
134
+ }
135
+ /**
136
+ * 프로젝트 정보
137
+ */
138
+ export interface ProjectInfo {
139
+ name: string;
140
+ root: string;
141
+ packageManager: 'npm' | 'pnpm' | 'yarn' | 'bun';
142
+ framework?: string;
143
+ language: 'typescript' | 'javascript' | 'mixed';
144
+ }
145
+ /**
146
+ * 분석 옵션
147
+ */
148
+ export interface AnalysisOptions {
149
+ /** 순환복잡도 임계값 (기본: 10) */
150
+ cyclomaticThreshold: number;
151
+ /** 인지복잡도 임계값 (기본: 15) */
152
+ cognitiveThreshold: number;
153
+ /** 타입 정보 포함 여부 */
154
+ includeTypes: boolean;
155
+ /** 테스트 파일 제외 여부 */
156
+ excludeTests: boolean;
157
+ /** 분석 제외 패턴 */
158
+ excludePatterns: string[];
159
+ /** 관련 파일 포함 깊이 (의존성 그래프) */
160
+ contextDepth: number;
161
+ }
162
+ /**
163
+ * 기본 분석 옵션
164
+ */
165
+ export declare const DEFAULT_OPTIONS: AnalysisOptions;
166
+ /**
167
+ * 3D: 상태 복잡도 (State Complexity)
168
+ * 상태 공간과 분기의 결합으로 인한 복잡도
169
+ */
170
+ export interface StateComplexity {
171
+ /** enum/union 타입 기반 상태 수 */
172
+ enumStates: number;
173
+ /** 상태 변경 지점 (setter, 재할당) */
174
+ stateMutations: number;
175
+ /** 상태 참조 지점 */
176
+ stateReads: number;
177
+ /** 상태 기반 분기 (상태값에 따른 조건문) */
178
+ stateBranches: number;
179
+ /** 상태 머신 패턴 탐지 */
180
+ stateMachinePatterns: StatePattern[];
181
+ }
182
+ /**
183
+ * 상태 패턴 정보
184
+ */
185
+ export interface StatePattern {
186
+ kind: 'switch-enum' | 'reducer' | 'state-machine' | 'flag-based';
187
+ location: SourceLocation;
188
+ stateCount: number;
189
+ transitionCount: number;
190
+ }
191
+ /**
192
+ * 4D: 비동기/동시성 복잡도 (Async Complexity)
193
+ * 시간 축을 따라 발생하는 복잡도
194
+ */
195
+ export interface AsyncComplexity {
196
+ /** async/await 경계 */
197
+ asyncBoundaries: number;
198
+ /** Promise 체인 깊이 */
199
+ promiseChains: number;
200
+ /** 재시도 패턴 (retry, exponential backoff 등) */
201
+ retryPatterns: number;
202
+ /** 타임아웃/인터벌 처리 */
203
+ timeouts: number;
204
+ /** 콜백 중첩 깊이 */
205
+ callbackDepth: number;
206
+ /** 동시성 패턴 (Promise.all, Promise.race 등) */
207
+ concurrencyPatterns: ConcurrencyPattern[];
208
+ /** 에러 경계 (try-catch in async) */
209
+ asyncErrorBoundaries: number;
210
+ }
211
+ /**
212
+ * 동시성 패턴 정보
213
+ */
214
+ export interface ConcurrencyPattern {
215
+ kind: 'parallel' | 'race' | 'sequential' | 'batch' | 'throttle' | 'debounce';
216
+ location: SourceLocation;
217
+ promiseCount: number;
218
+ }
219
+ /**
220
+ * 5D: 숨은 결합 복잡도 (Hidden Coupling Complexity)
221
+ * 명시적으로 보이지 않는 의존성과 부작용
222
+ */
223
+ export interface CouplingComplexity {
224
+ /** 전역 변수/싱글톤 접근 */
225
+ globalAccess: GlobalAccessInfo[];
226
+ /** 암묵적 I/O (console, DOM, fetch 등) */
227
+ implicitIO: ImplicitIOInfo[];
228
+ /** 부작용 (외부 상태 변경) */
229
+ sideEffects: SideEffectInfo[];
230
+ /** 환경 의존성 (process.env, window 등) */
231
+ envDependency: EnvDependencyInfo[];
232
+ /** 클로저 캡처 */
233
+ closureCaptures: ClosureCaptureInfo[];
234
+ }
235
+ /**
236
+ * 전역 접근 정보
237
+ */
238
+ export interface GlobalAccessInfo {
239
+ name: string;
240
+ kind: 'global' | 'singleton' | 'static' | 'module-scope';
241
+ location: SourceLocation;
242
+ isWrite: boolean;
243
+ }
244
+ /**
245
+ * 암묵적 I/O 정보
246
+ */
247
+ export interface ImplicitIOInfo {
248
+ kind: 'console' | 'dom' | 'fetch' | 'storage' | 'file' | 'network';
249
+ location: SourceLocation;
250
+ api: string;
251
+ }
252
+ /**
253
+ * 부작용 정보
254
+ */
255
+ export interface SideEffectInfo {
256
+ kind: 'mutation' | 'event' | 'subscription' | 'timer';
257
+ location: SourceLocation;
258
+ target: string;
259
+ description: string;
260
+ }
261
+ /**
262
+ * 환경 의존성 정보
263
+ */
264
+ export interface EnvDependencyInfo {
265
+ kind: 'process-env' | 'window' | 'document' | 'navigator' | 'location';
266
+ location: SourceLocation;
267
+ property: string;
268
+ }
269
+ /**
270
+ * 클로저 캡처 정보
271
+ */
272
+ export interface ClosureCaptureInfo {
273
+ variableName: string;
274
+ location: SourceLocation;
275
+ capturedAt: SourceLocation;
276
+ isMutable: boolean;
277
+ }
278
+ /**
279
+ * 차원별 복잡도 가중치
280
+ */
281
+ export interface DimensionalWeights {
282
+ /** 1D 제어 흐름 가중치 */
283
+ control: number;
284
+ /** 2D 중첩 가중치 */
285
+ nesting: number;
286
+ /** 3D 상태 가중치 */
287
+ state: number;
288
+ /** 4D 비동기 가중치 */
289
+ async: number;
290
+ /** 5D 결합 가중치 */
291
+ coupling: number;
292
+ }
293
+ /**
294
+ * 기본 차원 가중치 (연구 기반 초기값)
295
+ */
296
+ export declare const DEFAULT_DIMENSIONAL_WEIGHTS: DimensionalWeights;
297
+ /**
298
+ * 차원 기반 복잡도 결과
299
+ */
300
+ export interface DimensionalComplexity {
301
+ /** 1D: 제어 흐름 복잡도 (순환복잡도 기반) */
302
+ control: number;
303
+ /** 2D: 중첩 복잡도 (인지복잡도의 nesting penalty) */
304
+ nesting: number;
305
+ /** 3D: 상태 복잡도 */
306
+ state: StateComplexity;
307
+ /** 4D: 비동기 복잡도 */
308
+ async: AsyncComplexity;
309
+ /** 5D: 숨은 결합 복잡도 */
310
+ coupling: CouplingComplexity;
311
+ /** 가중 합산 점수 */
312
+ weighted: number;
313
+ /** 사용된 가중치 */
314
+ weights: DimensionalWeights;
315
+ /** 각 차원별 기여도 (0-1) */
316
+ contributions: {
317
+ control: number;
318
+ nesting: number;
319
+ state: number;
320
+ async: number;
321
+ coupling: number;
322
+ };
323
+ /** 주요 복잡도 원인 (상위 3개) */
324
+ hotspots: DimensionalHotspot[];
325
+ }
326
+ /**
327
+ * 복잡도 핫스팟
328
+ */
329
+ export interface DimensionalHotspot {
330
+ dimension: '1D-control' | '2D-nesting' | '3D-state' | '4D-async' | '5D-coupling';
331
+ score: number;
332
+ location: SourceLocation;
333
+ reason: string;
334
+ }
335
+ /**
336
+ * 확장된 복잡도 결과 (차원 포함)
337
+ */
338
+ export interface ExtendedComplexityResult extends ComplexityResult {
339
+ dimensional: Dimensional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분석 옵션
3
+ */
4
+ export const DEFAULT_OPTIONS = {
5
+ cyclomaticThreshold: 10,
6
+ cognitiveThreshold: 15,
7
+ includeTypes: true,
8
+ excludeTests: true,
9
+ excludePatterns: ['node_modules', 'dist', 'build', '.git'],
10
+ contextDepth: 2,
11
+ };
12
+ /**
13
+ * 기본 차원 가중치 (연구 기반 초기값)
14
+ */
15
+ export const DEFAULT_DIMENSIONAL_WEIGHTS = {
16
+ control: 1.0, // 기준
17
+ nesting: 1.5, // 중첩은 1.5배
18
+ state: 2.0, // 상태 결합은 2배
19
+ async: 2.5, // 비동기는 2.5배 (Salesforce 연구 기반)
20
+ coupling: 3.0, // 숨은 결합은 3배 (디버깅 난이도 기반)
21
+ };
22
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAoMA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,mBAAmB,EAAE,EAAE;IACvB,kBAAkB,EAAE,EAAE;IACtB,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC;IAC1D,YAAY,EAAE,CAAC;CAChB,CAAC;AAgJF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAuB;IAC7D,OAAO,EAAE,GAAG,EAAI,KAAK;IACrB,OAAO,EAAE,GAAG,EAAI,WAAW;IAC3B,KAAK,EAAE,GAAG,EAAM,YAAY;IAC5B,KAAK,EAAE,GAAG,EAAM,+BAA+B;IAC/C,QAAQ,EAAE,GAAG,EAAG,yBAAyB;CAC1C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "semantic-complexity",
3
+ "version": "0.0.1-cedf2072",
4
+ "description": "Multi-dimensional code complexity analyzer",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./ast": {
14
+ "types": "./dist/ast/index.d.ts",
15
+ "import": "./dist/ast/index.js"
16
+ },
17
+ "./metrics": {
18
+ "types": "./dist/metrics/index.d.ts",
19
+ "import": "./dist/metrics/index.js"
20
+ },
21
+ "./graph": {
22
+ "types": "./dist/graph/index.d.ts",
23
+ "import": "./dist/graph/index.js"
24
+ },
25
+ "./context": {
26
+ "types": "./dist/context/index.d.ts",
27
+ "import": "./dist/context/index.js"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "keywords": [
34
+ "complexity",
35
+ "cognitive-complexity",
36
+ "cyclomatic-complexity",
37
+ "semantic",
38
+ "ast",
39
+ "static-analysis"
40
+ ],
41
+ "license": "MIT",
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/yscha88/semantic-complexity.git",
48
+ "directory": "packages/core"
49
+ },
50
+ "dependencies": {
51
+ "typescript": "^5.7.2"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^22.10.2",
55
+ "rimraf": "^6.0.1",
56
+ "vitest": "^2.1.8"
57
+ },
58
+ "peerDependencies": {
59
+ "typescript": ">=5.0.0"
60
+ },
61
+ "scripts": {
62
+ "build": "tsc",
63
+ "dev": "tsc --watch",
64
+ "test": "vitest run",
65
+ "test:watch": "vitest",
66
+ "lint": "eslint src",
67
+ "clean": "rimraf dist",
68
+ "compare": "tsx src/compare.ts",
69
+ "guide": "tsx src/compare.ts --guide"
70
+ }
71
+ }