🌐 npm install solidity-code-metrics
The number-crunching enginge behind 📊tintinweb.solidity-metrics.
#> node ./src/cli.js <path to solidity file(s)>
const {SolidityMetricsContainer} = require('solidity-metrics');
let options = {
basePath:"",
inputFileGlobExclusions:undefined,
inputFileGlob: undefined,
inputFileGlobLimit: undefined,
debug:false,
repoInfo: {
branch: undefined,
commit: undefined,
remote: undefined
}
}
let metrics = new SolidityMetricsContainer("metricsContainerName", options);
// analyze files
metrics.analyze(path_to_solidity_file);
// ...
metrics.analyze(path_to_solidity_file_N);
// output
console.log(metrics.totals());
metrics.generateReportMarkdown().then(text => console.log(text));
// or let text = await metrics.generateReportMarkdown();