Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Java MetricsNew to Visual Studio Code? Get it now.
Java Metrics

Java Metrics

Thandag

|
1 install
| (0) | Free
Analyze Java source files and calculate metrics like cyclomatic complexity, Halstead, LCOM3, and lines of code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Java Metrics

This extension analyzes Java source files and calculates software metrics to help you understand code complexity and maintainability.


Features

  • Cyclomatic Complexity
  • Halstead Metrics (Length, Volume, Difficulty, etc.)
  • LCOM3 (Lack of Cohesion in Methods)
  • Lines of Code

Usage

  1. Open a Java file or project in your workspace.
  2. Navigate to the Metrics container on the left (ruler symbol) and click Calculate Metrics.
  3. A new tree representation is created from your project and displayed in the project-structure view.
  4. Expand and navigate the tree as usual by clicking on the arrows.
  5. Select an entry in the tree to display the corresponding metrics.
    • Metrics are shown at the bottom of your VS Code window in the Metrics tab.
  6. After changing your code, re-run the command to update the metrics.

Requirements

  • Only one Java project may be in your workspace.
  • If there is more than one, most metrics will still work as intended. However, metrics regarding the whole project may be incorrect.

Extension Settings

  • Java-metrics: enabled Metrics
    Select which metrics you want to be calculated and displayed from the list of available metrics.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft