Skip to content

JorgeAtPaladin/solidity-metrics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get in touch with Consensys Diligence
[ 🌐 📩 🔥 ]

Solidity Code Metrics

🌐 npm install solidity-code-metrics

The number-crunching enginge behind 📊tintinweb.solidity-metrics.

vscode-solidity-metrics3

Example

CLI

#> node ./src/cli.js <path to solidity file(s)>

Library

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();

Packages

No packages published

Languages

  • JavaScript 85.0%
  • CSS 11.9%
  • HTML 3.1%