Skip to main content

handle_complexity_command

Function handle_complexity_command 

Source
pub fn handle_complexity_command(
    path: &Path,
    extensions: Option<&[String]>,
    exclude: Option<&[String]>,
    threshold: Option<u32>,
    sort: bool,
) -> Result<(), Box<dyn Error>>
Expand description

Handle the complexity command

Analyzes code complexity metrics including cyclomatic and cognitive complexity.

§Arguments

  • path - The directory to analyze
  • extensions - Optional file extensions to filter by
  • exclude - Optional directories to exclude
  • threshold - Minimum complexity threshold to report (optional)
  • sort - Whether to sort results by complexity

§Examples

use codesearch::commands::analysis::handle_complexity_command;
use std::path::Path;

handle_complexity_command(Path::new("src"), None, None, Some(10), true).unwrap();