Thanks to visit codestin.com
Credit goes to docs.rs

Crate mete

Crate mete 

Source
Expand description

Mete: Structural metrics engine for code quality analysis.

Data-oriented design: flat arrays, single-pass traversal, no intermediate events.

§Architecture

  • data: SoA data structures for results
  • metrics: Pure metric computation functions
  • lang: Language specifications and tree-sitter integration
  • walk: Single-pass AST walker
  • dup: Cross-file duplicate detection
  • output: Result formatting

§Example

use mete::{analyze_file, Language};
use std::path::PathBuf;

let result = analyze_file(PathBuf::from("src/main.rs"), Language::Rust)?;
println!("MI: {}, CC: {}", result.mi, result.cc_max);

Re-exports§

pub use data::FileResults;
pub use data::FunctionData;
pub use data::FunctionResults;
pub use data::SingleFileResult;
pub use data::StringInterner;
pub use dup::DuplicateGroup;
pub use dup::DuplicateIndex;
pub use dup::FunctionLocation;
pub use lang::BranchKind;
pub use lang::Language;
pub use lang::LanguageSpec;
pub use metrics::maintainability_index;
pub use metrics::maintainability_index_from_averages;
pub use metrics::CcLevel;
pub use metrics::CognitiveLevel;
pub use metrics::DepthLevel;
pub use metrics::MiLevel;
pub use walk::WalkError;
pub use walk::Walker;

Modules§

data
Data-oriented structures using Struct of Arrays (SoA) layout.
dup
Cross-file duplicate detection using structural fingerprints.
lang
Language specifications for tree-sitter parsing.
metrics
Pure metric computation functions.
output
Output formatting for analysis results.
walk
Single-pass tree-sitter AST walker.

Functions§

analyze_directory
Analyze a directory with glob pattern.
analyze_file
Analyze a single file.
analyze_file_auto
Analyze a single file, auto-detecting language from extension.
analyze_files
Analyze multiple files in parallel.
build_duplicate_index
Build cross-file duplicate index from function results.
collect_results
Collect results into SoA structures.
is_skippable