tech-debt-score 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -38,8 +38,16 @@ export interface AnalysisConfig {
|
|
|
38
38
|
* Default configuration values
|
|
39
39
|
*/
|
|
40
40
|
export const DEFAULT_CONFIG: Omit<AnalysisConfig, 'rootPath'> = {
|
|
41
|
-
patterns: ['
|
|
42
|
-
ignore: [
|
|
41
|
+
patterns: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
42
|
+
ignore: [
|
|
43
|
+
'**/node_modules/**',
|
|
44
|
+
'**/dist/**',
|
|
45
|
+
'**/build/**',
|
|
46
|
+
'**/coverage/**',
|
|
47
|
+
'**/.git/**',
|
|
48
|
+
'**/.next/**',
|
|
49
|
+
'**/out/**',
|
|
50
|
+
],
|
|
43
51
|
weights: {
|
|
44
52
|
complexity: 0.30,
|
|
45
53
|
size: 0.25,
|
|
@@ -55,23 +55,9 @@ export async function analyzeCommand(rootPath: string, jsonOutputPath?: string):
|
|
|
55
55
|
);
|
|
56
56
|
|
|
57
57
|
// Build configuration
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
// - If 'src' folder exists, use 'src/**/*.ts'
|
|
62
|
-
// - Otherwise, scan all files in root '**/*.ts'
|
|
63
|
-
const isCwd = resolve(rootPath) === process.cwd();
|
|
64
|
-
const hasSrcFolder = existsSync(resolve(rootPath, 'src'));
|
|
65
|
-
|
|
66
|
-
let defaultPatterns: string[];
|
|
67
|
-
|
|
68
|
-
if (!isCwd) {
|
|
69
|
-
defaultPatterns = ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'];
|
|
70
|
-
} else if (hasSrcFolder) {
|
|
71
|
-
defaultPatterns = DEFAULT_CONFIG.patterns; // ['src/**/*.ts', 'src/**/*.js']
|
|
72
|
-
} else {
|
|
73
|
-
defaultPatterns = ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'];
|
|
74
|
-
}
|
|
58
|
+
// Use broad patterns by default and rely on ignore list for exclusions.
|
|
59
|
+
// This makes the tool structure-agnostic (works for src/, lib/, or root files).
|
|
60
|
+
const defaultPatterns = ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'];
|
|
75
61
|
|
|
76
62
|
const config: AnalysisConfig = {
|
|
77
63
|
rootPath,
|
|
@@ -79,6 +65,11 @@ export async function analyzeCommand(rootPath: string, jsonOutputPath?: string):
|
|
|
79
65
|
patterns: defaultPatterns,
|
|
80
66
|
};
|
|
81
67
|
|
|
68
|
+
// Log scan start for transparency
|
|
69
|
+
if (config.patterns.length > 0) {
|
|
70
|
+
console.log(`📂 Scanning for patterns: ${config.patterns.join(', ')}`);
|
|
71
|
+
}
|
|
72
|
+
|
|
82
73
|
// Execute analysis
|
|
83
74
|
await analysisService.analyze(config);
|
|
84
75
|
|