Skip to content

Commit

Permalink
fixup! add json output for code metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
nasifimtiazohi committed Jul 29, 2021
1 parent 73a1cf5 commit 6b62648
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions depdive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ impl DependencyAnalyzer {
pub struct DependencyGraphAnalyzer;

impl DependencyGraphAnalyzer {
pub fn get_code_metrics_from_path(path: &Path, only_direct: bool) -> Result<String> {
pub fn get_code_metrics_in_json_from_path(path: &Path, only_direct: bool) -> Result<String> {
let graph = MetadataCommand::new().current_dir(path).build_graph()?;
Self::get_code_metrics(&graph, only_direct)
}

fn get_code_metrics(graph: &PackageGraph, only_direct: bool) -> Result<String> {
fn get_code_metrics_in_json(graph: &PackageGraph, only_direct: bool) -> Result<String> {
let code_reports = code::CodeAnalyzer::new();
let reports = code_reports.analyze_code(graph, only_direct)?;
let json_output = serde_json::to_string(&reports)?;
Expand Down

0 comments on commit 6b62648

Please sign in to comment.