Skip to content

Commit 788a4e4

Browse files
committed
fix: report generation
1 parent 79c1004 commit 788a4e4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This library provides any JS library the ability to analyze the Cyclomatic Compl
2020

2121
# How to Use
2222

23-
CyclomaticJS has one named export: `calculateComplexity`
23+
CyclomaticJS has two export: `calculateComplexity` and `generateComplexityReport`
2424

2525
This function takes a `filename` and calculates the logical complexity of a file's contents.
2626

src/report-generator.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ export async function generateComplexityReport(directory) {
4141
report: await calculateComplexity(file)
4242
}))
4343
)
44-
console.log(JSON.stringify(analyzedFiles, undefined, 2))
44+
await writeFile(
45+
'complexity-report.json',
46+
JSON.stringify(analyzedFiles, undefined, 2)
47+
)
4548
}

0 commit comments

Comments
 (0)