Skip to content

Commit ed23938

Browse files
[FEATURE]: release VitalityVertex
1 parent 45312f5 commit ed23938

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "code-health-meter",
3-
"version": "1.9.0",
3+
"version": "2.0.0",
44
"description": "",
55
"main": "src/index.js",
66
"type": "module",

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const codeComplexityAnalysisResult = await CodeComplexityAuditor.startAudit(
7878
CodeComplexityUtils
7979
.writeCodeComplexityAuditToFile({
8080
codeComplexityOptions: {
81-
outputDir,
81+
outputDir: `${outputDir}/code-complexity-audit`,
8282
fileFormat: format, // html or json
8383
},
8484
codeComplexityAnalysisResult,
@@ -97,7 +97,7 @@ const codeCouplingAnalysisResult = await CodeCouplingAuditor.startAudit(srcDir);
9797
CodeCouplingUtils
9898
.writeCodeCouplingAuditToFile({
9999
codeCouplingOptions: {
100-
outputDir,
100+
outputDir: `${outputDir}/code-coupling-audit`,
101101
fileFormat: format, // html or json
102102
},
103103
codeCouplingAnalysisResult,
@@ -109,6 +109,6 @@ CodeCouplingUtils
109109
*/
110110
CodeDuplicationAuditor.startAudit(
111111
srcDir,
112-
outputDir,
112+
`${outputDir}/code-duplication-audit`,
113113
format
114114
);

src/kernel/duplication/CodeDuplicationAuditor.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { execSync } from 'child_process';
2-
import fs from 'fs-extra';
32
import AppLogger from '../../commons/AppLogger.js';
43

54
const defaultOptions = {
@@ -16,6 +15,7 @@ const defaultOptions = {
1615
'**/target/**',
1716
'**/dist/**',
1817
'**/__mocks__/*',
18+
'**/mocks/*',
1919
'**/.husky/**',
2020
'**/.vscode/.*',
2121
'**/.idea/**',
@@ -65,21 +65,10 @@ const startAudit = async (directory, outputDir, fileFormat) => {
6565
AppLogger.info(`[CodeDuplicationAuditor - inspectDirectory] jscpd script: ${codeDuplicationCommand}`);
6666

6767
// generate report
68-
execSync(codeDuplicationCommand);
69-
70-
// rename html folder
71-
const temporaryHtmlReportPath = `${outputDir}/html`;
72-
const finalHtmlReportPath = `${outputDir}/code-duplication`;
73-
const temporaryJsonReportFilePath = `${outputDir}/jscpd-report.json`;
74-
const finalJsonReportFilePath = `${outputDir}/CodeDuplicationReport.json`;
75-
76-
if(fs.existsSync(temporaryHtmlReportPath)) {
77-
fs.renameSync(temporaryHtmlReportPath, finalHtmlReportPath);
78-
}
79-
80-
// rename json folder
81-
if(fs.existsSync(temporaryJsonReportFilePath)) {
82-
fs.renameSync(temporaryJsonReportFilePath, finalJsonReportFilePath);
68+
try{
69+
execSync(codeDuplicationCommand);
70+
}catch (error){
71+
AppLogger.info(`[CodeDuplicationAuditor - inspectDirectory] execSync error: ${error.message}`);
8372
}
8473

8574
return true;

0 commit comments

Comments
 (0)