ts-analyzer 1.2.1 โ†’ 1.3.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.
@@ -0,0 +1,44 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Trigger on tags starting with 'v', e.g., v1.3.0
7
+
8
+ jobs:
9
+ build-and-release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write # Needed for creating a release
13
+
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Setup Node.js
19
+ uses: actions/setup-node@v4
20
+ with:
21
+ node-version: '20'
22
+ registry-url: 'https://registry.npmjs.org'
23
+
24
+ - name: Install dependencies
25
+ run: npm ci
26
+
27
+ - name: Run tests
28
+ run: npm test
29
+
30
+ - name: Build project
31
+ run: npm run build
32
+
33
+ - name: Publish to NPM
34
+ run: npm publish
35
+ env:
36
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37
+
38
+ - name: Create GitHub Release
39
+ uses: softprops/action-gh-release@v2
40
+ with:
41
+ generate_release_notes: true
42
+ files: |
43
+ README.md
44
+ LICENSE
package/README.md CHANGED
@@ -1,377 +1,44 @@
1
1
  # ts-analyzer
2
2
 
3
- A comprehensive TypeScript codebase analyzer that provides detailed metrics on type safety, code complexity, and quality. Get actionable insights to improve your TypeScript projects.
4
-
5
- ![NPM Version](https://img.shields.io/npm/v/ts-analyzer)
6
- ![License](https://img.shields.io/npm/l/ts-analyzer)
7
-
8
- > **Note**: This is the new and improved version of the previous `react-loc-analyzer` package, with enhanced TypeScript safety analysis, code complexity metrics, and better reports.
3
+ ts-analyzer is a static analysis tool for checking TypeScript code quality, focusing on type safety and structural complexity.
9
4
 
10
5
  ## Features
11
6
 
12
- - ๐Ÿงช **TypeScript Safety Analysis** with detailed type coverage metrics
13
- - ๐Ÿ“Š **Code Complexity Evaluation** for better maintainability
14
- - ๐Ÿ“ **Detailed Code Statistics** with file type breakdown
15
- - ๐Ÿ“ **Actionable Quality Recommendations** based on analysis
16
- - ๐ŸŽฏ **Framework-Agnostic** works with any TypeScript project (React, Vue, Angular, Node.js)
17
- - ๐ŸŽจ **Beautiful Formatted Output** with colored terminal support
18
- - โšก **Fast Performance** with asynchronous file processing
19
- - โš™๏ธ **Highly Configurable** with customizable options
20
-
21
- ## Installation
7
+ - TypeScript safety metrics (type coverage, any usage, assertions).
8
+ - Cyclomatic complexity and nesting depth analysis.
9
+ - Detection of anti-patterns like magic numbers, callback hell, and god files.
10
+ - Formatted output in Text, JSON, and HTML.
22
11
 
23
- You can use it directly with npx (no installation required):
12
+ ## Quick Start
24
13
 
25
14
  ```bash
26
15
  npx ts-analyzer
27
16
  ```
28
17
 
29
- Or install it globally:
30
-
31
- ```bash
32
- npm install -g ts-analyzer
33
- ```
34
-
35
18
  ## Usage
36
19
 
37
- ### Basic Usage
38
-
39
- Analyze the current directory:
40
- ```bash
41
- npx ts-analyzer
42
- ```
43
-
44
20
  Analyze a specific directory:
45
21
  ```bash
46
- npx ts-analyzer /path/to/your/typescript/project
22
+ ts-analyzer /path/to/project
47
23
  ```
48
24
 
49
- ### Options
50
-
51
- ```bash
52
- npx ts-analyzer [directory] [options]
53
-
54
- Options:
55
- -V, --version output version number
56
- -e, --exclude <patterns> additional patterns to exclude (comma-separated)
57
- -i, --include <extensions> additional file extensions to include (comma-separated)
58
- --no-color disable colored output
59
- --no-safety disable TypeScript safety analysis
60
- --no-complexity disable code complexity analysis
61
- -f, --format <type> output format (text or json)
62
- -h, --help display help for command
63
- ```
25
+ Available options:
26
+ - `-f, --format <type>`: `text`, `json`, or `html`.
27
+ - `-e, --exclude <patterns>`: Comma-separated ignore patterns.
28
+ - `--no-safety`: Skip type-safety analysis.
29
+ - `--no-complexity`: Skip complexity analysis.
64
30
 
65
- ### Examples
31
+ ## Development
66
32
 
67
- Analyze with additional exclude patterns:
33
+ Run tests:
68
34
  ```bash
69
- npx ts-analyzer --exclude .cache,public,static
35
+ npm test
70
36
  ```
71
37
 
72
- Include additional file extensions:
38
+ Generate coverage:
73
39
  ```bash
74
- npx ts-analyzer --include .vue,.svelte
75
- ```
76
-
77
- Disable TypeScript safety analysis:
78
- ```bash
79
- npx ts-analyzer --no-safety
80
- ```
81
-
82
- ## Output
83
-
84
- The analyzer can output results in two formats: `text` (default) and `json`.
85
-
86
- ### Text Output (Default)
87
-
88
- The text output provides five main sections:
89
-
90
- ### 1. Project Summary
91
- Shows overall statistics including:
92
- - Total Files
93
- - Total Lines
94
- - Code Lines
95
- - Comment Lines
96
- - Empty Lines
97
-
98
- ### 2. Files by Type
99
- Detailed breakdown for each file extension:
100
- - Number of files
101
- - Total lines
102
- - Code lines
103
- - Comment lines
104
- - Empty lines
105
- - Percentage of codebase
106
-
107
- ### 3. TypeScript Safety Analysis
108
- Comprehensive TypeScript safety metrics:
109
- - TypeScript Files Count
110
- - Type Coverage Percentage
111
- - Any Type Usage Count
112
- - Type Assertions Count
113
- - Type Safety Score
114
- - Type Safety Rating
115
-
116
- ### 4. Code Complexity Analysis
117
- Detailed complexity metrics:
118
- - Function Count
119
- - Cyclomatic Complexity
120
- - Nesting Depth
121
- - Function Size
122
- - Overall Complexity Rating
123
-
124
- ### 5. Code Quality Recommendations
125
- Actionable suggestions to improve your code quality.
126
-
127
- ## Example Output
128
-
129
- ```
130
- Project Summary:
131
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
132
- โ”‚ Metric โ”‚ Value โ”‚
133
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
134
- โ”‚ Total Files โ”‚ 156 โ”‚
135
- โ”‚ Total Lines โ”‚ 15,234 โ”‚
136
- โ”‚ Code Lines โ”‚ 12,845 โ”‚
137
- โ”‚ Comment Lines โ”‚ 1,523 โ”‚
138
- โ”‚ Empty Lines โ”‚ 866 โ”‚
139
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
140
-
141
- Files by Type:
142
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
143
- โ”‚ Extension โ”‚ Files โ”‚ Total Lines โ”‚ Code Lines โ”‚ % of Codebase โ”‚
144
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
145
- โ”‚ .ts โ”‚ 87 โ”‚ 8,456 โ”‚ 7,234 โ”‚ 56.3% โ”‚
146
- โ”‚ .tsx โ”‚ 45 โ”‚ 4,234 โ”‚ 3,845 โ”‚ 29.9% โ”‚
147
- โ”‚ .js โ”‚ 23 โ”‚ 2,456 โ”‚ 1,923 โ”‚ 15.0% โ”‚
148
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
149
-
150
- TypeScript Safety:
151
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
152
- โ”‚ metric โ”‚ value โ”‚
153
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
154
- โ”‚ TypeScript Files โ”‚ 132 (84.6% of codebase)โ”‚
155
- โ”‚ Type Coverage โ”‚ 92.3% (Good) โ”‚
156
- โ”‚ Any Type Usage โ”‚ 12 โ”‚
157
- โ”‚ Type Assertions โ”‚ 5 โ”‚
158
- โ”‚ Non-Null Assertions โ”‚ 0 โ”‚
159
- โ”‚ Type Safety Score โ”‚ 85/100 (Good โœ“) โ”‚
160
- โ”‚ Type Safety Rating โ”‚ Low โ”‚
161
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
162
-
163
- Code Complexity:
164
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
165
- โ”‚ metric โ”‚ value โ”‚
166
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
167
- โ”‚ Analyzed Files โ”‚ 110 โ”‚
168
- โ”‚ Total Functions โ”‚ 345 โ”‚
169
- โ”‚ Avg Cyclomatic Complexity โ”‚ 3.2 โ”‚
170
- โ”‚ Max Cyclomatic Complexity โ”‚ 12 โ”‚
171
- โ”‚ Avg Nesting Depth โ”‚ 2.1 โ”‚
172
- โ”‚ Max Nesting Depth โ”‚ 6 โ”‚
173
- โ”‚ Avg Function Size โ”‚ 12.5 lines โ”‚
174
- โ”‚ Complex Files โ”‚ 3 โ”‚
175
- โ”‚ Overall Complexity โ”‚ Simple โœ“ โ”‚
176
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
177
-
178
- ๐Ÿ“ Code Quality Recommendations:
179
- โ€ข Reduce usage of 'any' type (found 12 instances) by using more specific types
180
- โ€ข Consider refactoring functions with high complexity (max: 12) to improve maintainability
40
+ npm run test:coverage
181
41
  ```
182
42
 
183
- ## TypeScript Safety Analysis
184
-
185
- ### How TypeScript Safety Analysis Works
186
-
187
- The TypeScript safety analyzer evaluates your TypeScript code quality by calculating several metrics. Here's how it works:
188
-
189
- ```
190
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
191
- โ”‚ TypeScript Files โ”‚
192
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
193
- โ”‚
194
- โ–ผ
195
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
196
- โ”‚ AST Analysis โ”‚โ”€โ”€โ”€>โ”‚ Node Classification โ”‚
197
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
198
- โ”‚ โ”‚
199
- โ–ผ โ–ผ
200
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
201
- โ”‚ Explicitly Typed โ”‚ โ”‚ Implicitly Typed โ”‚
202
- โ”‚ Nodes โ”‚ โ”‚ Nodes โ”‚
203
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
204
- โ”‚ โ”‚
205
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
206
- โ”‚
207
- โ–ผ
208
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
209
- โ”‚ Type Coverage โ”‚<โ”€โ”€โ”€โ”‚ tsconfig.json โ”‚
210
- โ”‚ Calculation โ”‚ โ”‚ Analysis โ”‚
211
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
212
- โ”‚
213
- โ–ผ
214
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
215
- โ”‚ "any" & Assertion โ”‚
216
- โ”‚ Penalty Calculation โ”‚
217
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
218
- โ”‚
219
- โ–ผ
220
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
221
- โ”‚ Final Type Safety โ”‚
222
- โ”‚ Score & Rating โ”‚
223
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
224
- ```
225
-
226
- ### Type Coverage Calculation
227
-
228
- Type coverage measures what percentage of your code has proper type information, either through explicit type annotations or TypeScript's type inference.
229
-
230
- ```typescript
231
- // Example TypeScript code with various levels of typing
232
-
233
- // Explicitly typed (counts as typed)
234
- const userName: string = "John";
235
-
236
- // Implicitly typed through inference (counts as typed)
237
- const userAge = 30; // TypeScript infers 'number'
238
-
239
- // Object with explicit interface (counts as typed)
240
- interface User {
241
- id: number;
242
- name: string;
243
- active: boolean;
244
- }
245
- const user: User = { id: 1, name: "Alice", active: true };
246
-
247
- // Function with explicit type annotations (counts as typed)
248
- function calculateTotal(prices: number[]): number {
249
- return prices.reduce((sum, price) => sum + price, 0);
250
- }
251
-
252
- // Any type usage (counts as typed, but with penalty)
253
- const userData: any = fetchUserData();
254
-
255
- // No type annotation or clear inference (counts as untyped)
256
- let someData;
257
-
258
- // Type assertion (counts as typed, but with penalty)
259
- const userInput = document.getElementById("user-input") as HTMLInputElement;
260
- ```
261
-
262
- ### Type Safety Score Formula
263
-
264
- The type safety score (0-100) is calculated using the following formula:
265
-
266
- ```
267
- Type Safety Score = Coverage Score - Any Type Penalty - Type Assertion Penalty
268
- ```
269
-
270
- Where:
271
- - **Coverage Score** = Type Coverage Percentage ร— 0.6 (60% weight)
272
- - **Any Type Penalty** = (Any Type Count / Total Nodes) ร— 100 ร— 0.2 (20% weight)
273
- - **Type Assertion Penalty** = (Type Assertions / Total Nodes) ร— 100 ร— 0.2 (20% weight)
274
-
275
- ### TypeScript Configuration Impact
276
-
277
- The analyzer checks your `tsconfig.json` for strict type checking options and awards bonus points:
278
-
279
- | Configuration Option | Points |
280
- |----------------------|--------|
281
- | `strict: true` | 5 |
282
- | `noImplicitAny: true`| 3 |
283
- | `strictNullChecks: true` | 3 |
284
- | `noImplicitReturns: true` | 2 |
285
-
286
- ### Rating Scale
287
-
288
- | Type Safety Score | Rating | Description |
289
- |-------------------|--------|-------------|
290
- | โ‰ฅ 80 | Good | Your TypeScript code is well-typed and maintains high type safety |
291
- | 50-79 | Moderate | Your code has reasonable type safety but could be improved |
292
- | < 50 | Poor | Your code has significant type safety issues that should be addressed |
293
-
294
- ### Type Coverage Benchmarks
295
-
296
- | Type Coverage | Rating | Description |
297
- |---------------|--------|-------------|
298
- | โ‰ฅ 95% | Excellent | Top-tier type safety, comparable to well-maintained libraries |
299
- | 85-94% | Good | Strong type safety, suitable for production applications |
300
- | 70-84% | Moderate | Acceptable type safety, but has room for improvement |
301
- | < 70% | Needs Improvement | Type coverage is too low for reliable code |
302
-
303
- ## Code Complexity Analysis
304
-
305
- ### How Code Complexity Analysis Works
306
-
307
- The complexity analyzer evaluates several aspects of your code structure to determine maintainability:
308
-
309
- 1. **Cyclomatic Complexity**: Measures the number of independent paths through code
310
- 2. **Nesting Depth**: Measures how deeply code blocks are nested
311
- 3. **Function Size**: Measures average lines of code per function
312
- 4. **Parameter Count**: Analyzes how many parameters functions receive
313
-
314
- ### Complexity Rating Scale
315
-
316
- | Complexity Score | Rating | Description |
317
- |------------------|--------|-------------|
318
- | < 30 | Simple | Your code is clean and easily maintainable |
319
- | 30-60 | Moderate | Your code has reasonable complexity but watch for complex areas |
320
- | > 60 | Complex | Your code may be difficult to maintain and test |
321
-
322
- ## Why This Is Better Than react-loc-analyzer
323
-
324
- The `ts-analyzer` is a significant improvement over the previous `react-loc-analyzer`:
325
-
326
- 1. **TypeScript Specialization**: Built specifically for analyzing TypeScript codebases with deep type safety insights
327
- 2. **Framework Agnostic**: Works with any TypeScript project, not just React
328
- 3. **Advanced Metrics**: Provides sophisticated type coverage and code complexity metrics
329
- 4. **Actionable Insights**: Generates specific recommendations to improve your code quality
330
- 5. **Modern Implementation**: Fully written in TypeScript with strong typing throughout
331
- 6. **Better Performance**: Optimized for faster analysis of large TypeScript projects
332
-
333
- ## Configuration File
334
-
335
- You can configure `ts-analyzer` using a `ts-analyzer.config.json` file in the root of your project. This allows you to persist your settings without passing them as CLI arguments every time.
336
-
337
- ```json
338
- {
339
- "safety": true,
340
- "complexity": true,
341
- "format": "text",
342
- "exclude": ["node_modules", "dist", ".next"],
343
- "include": [".js", ".ts", ".tsx"]
344
- }
345
- ```
346
-
347
- CLI arguments will always take precedence over the configuration file.
348
-
349
- ## Default Configuration
350
-
351
- ### Included File Extensions
352
- - `.js`, `.jsx`, `.ts`, `.tsx`
353
- - `.css`, `.scss`, `.sass`
354
- - `.html`, `.json`
355
-
356
- ### Default Ignore Patterns
357
- - `node_modules`
358
- - `build`
359
- - `dist`
360
- - `.git`
361
- - `coverage`
362
- - `.next`
363
- - `out`
364
-
365
- ## Contributing
366
-
367
- Contributions are welcome! Please feel free to submit a Pull Request.
368
-
369
- 1. Fork the repository
370
- 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
371
- 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
372
- 4. Push to the branch (`git push origin feature/AmazingFeature`)
373
- 5. Open a Pull Request
374
-
375
43
  ## License
376
-
377
- MIT License - see the [LICENSE](LICENSE) file for details
44
+ MIT
package/bin/cli.ts CHANGED
@@ -7,6 +7,8 @@ import fs from 'fs';
7
7
  import path from 'path';
8
8
  import { analyzeProject } from '../src/index.js';
9
9
  import { formatTable } from '../src/table-formatter.js';
10
+ import { generateHtmlReport } from '../src/html-formatter.js';
11
+ import { writeFileSync } from 'fs';
10
12
 
11
13
  const program = new Command();
12
14
 
@@ -44,9 +46,10 @@ program
44
46
 
45
47
  const format = options.format !== 'text' ? options.format : (configOptions.format || 'text');
46
48
  const isJson = format === 'json';
47
- const useColors = options.color !== false && configOptions.color !== false && !isJson;
49
+ const isHtml = format === 'html';
50
+ const useColors = options.color !== false && configOptions.color !== false && !isJson && !isHtml;
48
51
 
49
- const spinner = isJson ? null : ora('Analyzing TypeScript project...').start();
52
+ const spinner = (isJson || isHtml) ? null : ora('Analyzing TypeScript project...').start();
50
53
 
51
54
  try {
52
55
  let extraExcludes: string[] = [];
@@ -79,6 +82,14 @@ program
79
82
  process.exit(0);
80
83
  }
81
84
 
85
+ if (isHtml) {
86
+ const htmlOutput = generateHtmlReport(stats);
87
+ const htmlReportPath = path.resolve(process.cwd(), 'ts-analyzer-report.html');
88
+ writeFileSync(htmlReportPath, htmlOutput);
89
+ console.log(`HTML report generated at: ${htmlReportPath}`);
90
+ process.exit(0);
91
+ }
92
+
82
93
  spinner?.succeed('Analysis complete!');
83
94
 
84
95
  // Print summary table
@@ -187,6 +198,23 @@ program
187
198
  { metric: 'Complex Files', value: stats.formatNumber(stats.codeComplexity.complexFiles) },
188
199
  { metric: 'Overall Complexity', value: complexityIndicator }
189
200
  ]);
201
+
202
+ console.log('\n' + (useColors ? chalk.bold.magenta('Anti-Patterns & Code Smells:') : 'Anti-Patterns & Code Smells:'));
203
+ const hasSmells = stats.codeComplexity.codeSmells.callbackHell > 0 ||
204
+ stats.codeComplexity.codeSmells.godFiles > 0 ||
205
+ stats.codeComplexity.codeSmells.excessiveParameters > 0 ||
206
+ stats.codeComplexity.codeSmells.magicNumbers > 0;
207
+
208
+ if (hasSmells) {
209
+ formatTable([
210
+ { metric: 'Callback Hell (Depth > 3)', value: stats.formatNumber(stats.codeComplexity.codeSmells.callbackHell) },
211
+ { metric: 'God Files (> 500 lines)', value: stats.formatNumber(stats.codeComplexity.codeSmells.godFiles) },
212
+ { metric: 'Excessive Params (> 4)', value: stats.formatNumber(stats.codeComplexity.codeSmells.excessiveParameters) },
213
+ { metric: 'Magic Numbers', value: stats.formatNumber(stats.codeComplexity.codeSmells.magicNumbers) }
214
+ ]);
215
+ } else {
216
+ console.log(useColors ? chalk.green('โœ“ No major code smells detected.') : 'โœ“ No major code smells detected.');
217
+ }
190
218
  }
191
219
 
192
220
  // Add code quality recommendations
package/dist/bin/cli.js CHANGED
@@ -7,6 +7,8 @@ import fs from 'fs';
7
7
  import path from 'path';
8
8
  import { analyzeProject } from '../src/index.js';
9
9
  import { formatTable } from '../src/table-formatter.js';
10
+ import { generateHtmlReport } from '../src/html-formatter.js';
11
+ import { writeFileSync } from 'fs';
10
12
  const program = new Command();
11
13
  program
12
14
  .name('ts-analyzer')
@@ -33,8 +35,9 @@ program
33
35
  }
34
36
  const format = options.format !== 'text' ? options.format : (configOptions.format || 'text');
35
37
  const isJson = format === 'json';
36
- const useColors = options.color !== false && configOptions.color !== false && !isJson;
37
- const spinner = isJson ? null : ora('Analyzing TypeScript project...').start();
38
+ const isHtml = format === 'html';
39
+ const useColors = options.color !== false && configOptions.color !== false && !isJson && !isHtml;
40
+ const spinner = (isJson || isHtml) ? null : ora('Analyzing TypeScript project...').start();
38
41
  try {
39
42
  let extraExcludes = [];
40
43
  if (configOptions.exclude)
@@ -64,6 +67,13 @@ program
64
67
  }, 2));
65
68
  process.exit(0);
66
69
  }
70
+ if (isHtml) {
71
+ const htmlOutput = generateHtmlReport(stats);
72
+ const htmlReportPath = path.resolve(process.cwd(), 'ts-analyzer-report.html');
73
+ writeFileSync(htmlReportPath, htmlOutput);
74
+ console.log(`HTML report generated at: ${htmlReportPath}`);
75
+ process.exit(0);
76
+ }
67
77
  spinner?.succeed('Analysis complete!');
68
78
  // Print summary table
69
79
  console.log('\n' + (useColors ? chalk.bold.green('Project Summary:') : 'Project Summary:'));
@@ -169,6 +179,22 @@ program
169
179
  { metric: 'Complex Files', value: stats.formatNumber(stats.codeComplexity.complexFiles) },
170
180
  { metric: 'Overall Complexity', value: complexityIndicator }
171
181
  ]);
182
+ console.log('\n' + (useColors ? chalk.bold.magenta('Anti-Patterns & Code Smells:') : 'Anti-Patterns & Code Smells:'));
183
+ const hasSmells = stats.codeComplexity.codeSmells.callbackHell > 0 ||
184
+ stats.codeComplexity.codeSmells.godFiles > 0 ||
185
+ stats.codeComplexity.codeSmells.excessiveParameters > 0 ||
186
+ stats.codeComplexity.codeSmells.magicNumbers > 0;
187
+ if (hasSmells) {
188
+ formatTable([
189
+ { metric: 'Callback Hell (Depth > 3)', value: stats.formatNumber(stats.codeComplexity.codeSmells.callbackHell) },
190
+ { metric: 'God Files (> 500 lines)', value: stats.formatNumber(stats.codeComplexity.codeSmells.godFiles) },
191
+ { metric: 'Excessive Params (> 4)', value: stats.formatNumber(stats.codeComplexity.codeSmells.excessiveParameters) },
192
+ { metric: 'Magic Numbers', value: stats.formatNumber(stats.codeComplexity.codeSmells.magicNumbers) }
193
+ ]);
194
+ }
195
+ else {
196
+ console.log(useColors ? chalk.green('โœ“ No major code smells detected.') : 'โœ“ No major code smells detected.');
197
+ }
172
198
  }
173
199
  // Add code quality recommendations
174
200
  if (stats.typescriptSafety || stats.codeComplexity) {
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";AACA,aAAa;AACb,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,OAAO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AAC,mFAAmF,CAAC;wBACnG,CAAC,CAAC,mFAAmF,CAAC,CAAC;gBAC/F,CAAC;gBAED,IAAI,KAAK,CAAC,cAAc,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;oBACxC,eAAe,CAAC,IAAI,CAAC,SAAS;wBAC1B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,gCAAgC,KAAK,CAAC,cAAc,CAAC,YAAY,sCAAsC,CAAC;wBACvH,CAAC,CAAC,gCAAgC,KAAK,CAAC,cAAc,CAAC,YAAY,sCAAsC,CAAC,CAAC;gBACnH,CAAC;YACL,CAAC;YAED,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC7B,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC5C,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,GAAG,CAAC,SAAS;oBACjB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,2DAA2D,CAAC;oBAC1E,CAAC,CAAC,2DAA2D,CAAC,CAAC;YACvE,CAAC;QACL,CAAC;IAEL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACjC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QACpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC,CAAC,CAAC;AAEP,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -8,6 +8,12 @@ export interface FileComplexityMetrics {
8
8
  functionCount: number;
9
9
  complexityScore: number;
10
10
  complexityRating: string;
11
+ codeSmells: {
12
+ magicNumbers: number;
13
+ callbackHell: number;
14
+ godFiles: number;
15
+ excessiveParameters: number;
16
+ };
11
17
  }
12
18
  export interface CodeComplexityMetrics {
13
19
  analyzedFiles: number;
@@ -19,6 +25,12 @@ export interface CodeComplexityMetrics {
19
25
  totalFunctions: number;
20
26
  complexFiles: number;
21
27
  overallComplexity: string;
28
+ codeSmells: {
29
+ magicNumbers: number;
30
+ callbackHell: number;
31
+ godFiles: number;
32
+ excessiveParameters: number;
33
+ };
22
34
  }
23
35
  export declare function analyzeFileComplexity(filePath: string): Promise<FileComplexityMetrics>;
24
36
  export declare function calculateProjectComplexity(projectPath: string, fileList: string[]): Promise<CodeComplexityMetrics>;