@sun-asterisk/impact-analyzer 1.0.3 → 1.0.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.
|
@@ -35,9 +35,14 @@ export class ReportGenerator {
|
|
|
35
35
|
// Summary
|
|
36
36
|
console.log('📊 SUMMARY:');
|
|
37
37
|
console.log(` Files Changed: ${changes.changedFiles.length}`);
|
|
38
|
-
console.log(` Symbols Modified: ${changes.changedSymbols.length}`);
|
|
39
38
|
console.log(` Impact Score: ${impact.impactScore}`);
|
|
40
39
|
console.log(` Severity: ${this.getSeverityEmoji(impact.severity)} ${impact.severity.toUpperCase()}`);
|
|
40
|
+
if (impact.affectedEndpoints.length > 0) {
|
|
41
|
+
console.log(` Affected Endpoints: ${impact.affectedEndpoints.length}`);
|
|
42
|
+
}
|
|
43
|
+
if (impact.databaseImpact.length > 0) {
|
|
44
|
+
console.log(` Database Tables: ${impact.databaseImpact.length}`);
|
|
45
|
+
}
|
|
41
46
|
console.log('');
|
|
42
47
|
|
|
43
48
|
// Endpoints
|
|
@@ -106,7 +111,8 @@ export class ReportGenerator {
|
|
|
106
111
|
timestamp: new Date().toISOString(),
|
|
107
112
|
summary: {
|
|
108
113
|
filesChanged: changes.changedFiles.length,
|
|
109
|
-
|
|
114
|
+
affectedEndpoints: impact.affectedEndpoints.length,
|
|
115
|
+
databaseTables: impact.databaseImpact.length,
|
|
110
116
|
impactScore: impact.impactScore,
|
|
111
117
|
severity: impact.severity,
|
|
112
118
|
},
|
|
@@ -124,7 +130,8 @@ export class ReportGenerator {
|
|
|
124
130
|
| Metric | Value |
|
|
125
131
|
|--------|-------|
|
|
126
132
|
| Files Changed | ${changes.changedFiles.length} |
|
|
127
|
-
|
|
|
133
|
+
| Affected Endpoints | ${impact.affectedEndpoints.length} |
|
|
134
|
+
| Database Tables | ${impact.databaseImpact.length} |
|
|
128
135
|
| Impact Score | **${impact.impactScore}** |
|
|
129
136
|
| Severity | ${this.getSeverityEmoji(impact.severity)} **${impact.severity.toUpperCase()}** |
|
|
130
137
|
|
|
@@ -704,6 +704,7 @@ export class MethodCallGraph {
|
|
|
704
704
|
affectedBy: changedMethod,
|
|
705
705
|
callChain: callChain,
|
|
706
706
|
layers: this.getCallChainLayers(callChain),
|
|
707
|
+
impactLevel: this.calculateImpactLevel(callChain),
|
|
707
708
|
});
|
|
708
709
|
}
|
|
709
710
|
}
|
|
@@ -721,6 +722,7 @@ export class MethodCallGraph {
|
|
|
721
722
|
affectedBy: changedMethod,
|
|
722
723
|
callChain: [changedMethod],
|
|
723
724
|
layers: [startLayer],
|
|
725
|
+
impactLevel: 'high', // Direct endpoint change is always high impact
|
|
724
726
|
});
|
|
725
727
|
}
|
|
726
728
|
|
|
@@ -793,6 +795,7 @@ export class MethodCallGraph {
|
|
|
793
795
|
layers: [this.getMethodLayer(changedMethod), 'Command', this.getMethodLayer(endpointMethod)],
|
|
794
796
|
viaCommand: commandName,
|
|
795
797
|
endpointMethod: endpointMethod,
|
|
798
|
+
impactLevel: this.calculateImpactLevel([changedMethod, `Command: '${commandName}'`, endpointMethod]),
|
|
796
799
|
});
|
|
797
800
|
}
|
|
798
801
|
}
|
|
@@ -924,4 +927,21 @@ export class MethodCallGraph {
|
|
|
924
927
|
.reduce((sum, callers) => sum + callers.length, 0),
|
|
925
928
|
};
|
|
926
929
|
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Calculate impact level based on call chain length
|
|
933
|
+
* Shorter chain = higher impact (closer to endpoint)
|
|
934
|
+
*/
|
|
935
|
+
calculateImpactLevel(callChain) {
|
|
936
|
+
const chainLength = callChain.length;
|
|
937
|
+
|
|
938
|
+
// Direct endpoint change or very short chain
|
|
939
|
+
if (chainLength <= 1) return 'high';
|
|
940
|
+
|
|
941
|
+
// Short chain (2-3 hops)
|
|
942
|
+
if (chainLength <= 3) return 'medium';
|
|
943
|
+
|
|
944
|
+
// Longer chain
|
|
945
|
+
return 'low';
|
|
946
|
+
}
|
|
927
947
|
}
|