Skip to content

Commit

Permalink
fix: report generation
Browse files Browse the repository at this point in the history
  • Loading branch information
offgriddev committed Nov 2, 2023
1 parent 79c1004 commit 788a4e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This library provides any JS library the ability to analyze the Cyclomatic Compl

# How to Use

CyclomaticJS has one named export: `calculateComplexity`
CyclomaticJS has two export: `calculateComplexity` and `generateComplexityReport`

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

Expand Down
5 changes: 4 additions & 1 deletion src/report-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ export async function generateComplexityReport(directory) {
report: await calculateComplexity(file)
}))
)
console.log(JSON.stringify(analyzedFiles, undefined, 2))
await writeFile(
'complexity-report.json',
JSON.stringify(analyzedFiles, undefined, 2)
)
}

0 comments on commit 788a4e4

Please sign in to comment.