Forrest logo
back to the psalm tool

psalm:tldr:e771b

psalm: Analyze a project and display statistics.
$ psalm --stats
try on your machine

The command "psalm --stats" is used to get statistical information or metrics about the analysis performed by the Psalm tool.

Psalm is a static analysis tool for PHP code that analyzes your codebase and identifies potential errors, bugs, and security vulnerabilities. It uses a combination of static analysis, type inference, and Psalm-specific annotations to provide accurate results.

When you run the "psalm" command, it performs the analysis on your PHP codebase and provides output with identified issues and errors. However, adding the "--stats" flag to the command allows you to obtain statistical information about the analysis.

The "--stats" flag will return a summary of various statistics and metrics about your codebase. These may include:

  1. Total files analyzed: The number of PHP files that were analyzed by Psalm.
  2. Total errors: The number of errors identified during the analysis, such as syntax errors, missing type annotations, or incompatible type usage.
  3. Total issues: The combined number of errors, warnings, and other potential issues detected in your code.
  4. Total inferences: The number of type inferences made by Psalm.
  5. Total functions/methods analyzed: The count of functions and methods analyzed.

These statistics provide insights into the overall quality of your codebase and can help you identify areas that require attention or potential problems. By analyzing these metrics, you can gain a better understanding of the state of your PHP code and take appropriate actions to improve its quality and maintainability.

Remember to include the necessary configuration file for Psalm (usually "psalm.xml" or "psalm.xml.dist") and ensure that the required dependencies are installed before running the "psalm" command.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the psalm tool