Skip to main content

Module coupling

Module coupling 

Source
Expand description

Coupling command - Cross-module coupling analysis

Analyzes coupling between two source modules by tracking cross-module function calls. Computes a coupling score (0.0-1.0) and provides a verdict.

Supports all languages with tree-sitter grammars: Python, Go, Rust, TypeScript, JavaScript, Java, C, C++, Ruby, C#, PHP, Scala, Elixir, Lua, Luau, and OCaml.

§Example Usage

tldr coupling src/auth.py src/user.py
tldr coupling src/gin.go src/context.go --format text
tldr coupling src/lib.rs src/utils.rs --timeout 30

§TIGER Mitigations

  • E02: --timeout flag with default 30 seconds
  • T02: All path validation through validation.rs

Structs§

CouplingArgs
Analyze coupling between source modules.
ModuleInfo
Information extracted from a source module for coupling analysis.

Functions§

compute_coupling_score
Compute coupling score between two modules.
extract_module_info
Extract module information from source code.
find_cross_calls
Find cross-module calls from caller module to callee module.
format_coupling_project_text
Format a project-wide coupling report as human-readable text.
format_coupling_text
Format coupling report as human-readable text.
format_martin_text
Format Martin metrics report as human-readable text.
run
Run the coupling command.