PhpMetrics analyzes PHP source code and turns its metrics into browsable HTML and machine-readable reports. Install it, generate a report, then use its charts to find code worth reviewing—not as a verdict that a project is good or bad.
Generate a PhpMetrics report
The official quick start documents installation through Composer, Docker, Phar, Debian/Ubuntu packages, Homebrew, and PhpArch. For a project-local Composer installation, run:
composer require phpmetrics/phpmetrics --dev
php ./vendor/bin/phpmetrics --report-html=myreport <folder-to-analyze>
Replace <folder-to-analyze> with the PHP source directory you want to analyze. When the command finishes, open myreport/index.html in a browser. See the official project homepage and quick start for current installation options and instructions; distribution details can change.
The documentation also describes global Composer installation; with that approach, ensure Composer’s vendor bin directory is on your PATH. Its Docker example mounts the current directory as /project.
Recommended Free Tools
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Choose code and report outputs with configuration
PhpMetrics accepts JSON, YAML, or INI configuration. A configuration can select source directories to include, exclude paths, set HTML, CSV, JSON, and violations output locations, and group classes using a regular expression. Plugins, including Git and JUnit analysis, can also be enabled.
The quick-start example shows CI searches configured with failIfFound: true, including a class-complexity threshold of ccn: ">=10". A threshold is a project policy, not a universal quality boundary: tune it to the codebase and check for false positives before making it fail a build. The quick-start documentation provides configuration examples.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Read the report in context
The report guide describes four main areas: a package metrics table, a bubble visualization, custom charts, and an abstractness/instability view. In the bubble chart, each circle represents a file: its size encodes cyclomatic complexity, while its color encodes Maintainability Index (MI). Hover over a circle for details. The guide characterizes green as appearing correct, yellow as caution, and red as an anomaly; these colors are cues for triage, not proof of a defect. A large red circle may deserve attention, but the code itself needs review.
Start from a specific question rather than trying to reduce the report to one score:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
- Branching-heavy code: inspect cyclomatic complexity (CCN) and the largest bubbles, then review the function’s control flow and tests.
- Possible mixed responsibilities: look at lack of cohesion of methods (LCOM) and examine whether the class’s methods actually serve separate purposes.
- Dependency direction: inspect afferent and efferent coupling alongside instability, then interpret those relationships against the intended architecture.
- Trends, exports, or build checks: use the supported report formats or configure searches and thresholds for CI.
These signals describe different properties; a complex function, a weakly cohesive class, and a dependency concern are not interchangeable diagnoses. The report guide explains the visualizations.
What the metrics can—and cannot—tell you
PhpMetrics reports several families of measures. Their value is in directing attention and making properties easier to inspect; a score alone does not establish readability, design quality, or ease of future changes. The project’s metrics documentation describes the definitions and formulas.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Cyclomatic complexity (CCN)
CCN describes control-structure complexity in a function or procedure. The documentation explains it through flow-graph edges, nodes, and connected parts, or by counting decision points. A high value can flag branching-heavy code for review, but it does not capture every aspect of clarity or design.
Maintainability Index (MI)
MI is formula-derived and associated with Halstead volume, lines of code, cyclomatic complexity, and comment weight. PhpMetrics uses it for bubble color. Interpret it in light of the formula and the tool’s implementation; it is not a direct measure of developer productivity or a guarantee that a change will be easy.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
An older project interpretation page gives an MI scale of 0–118 and labels below 64 low, 65–84 medium, and above 85 high. That historical guidance leaves 64 and the exact boundary convention unclear, and the current metrics page does not repeat those bands. Treat them, if encountered, as an older rule of thumb—not a universal or current quality standard. See the legacy interpretation page.
Lack of cohesion of methods (LCOM)
LCOM is used to examine how closely a class’s methods relate. The project’s example produces LCOM 2 for a class with two separate attribute-use flows and describes LCOM=1 as ideal in that example. That is the documentation’s explanatory convention; LCOM has variants, so do not treat that example as a universal interpretation without checking the metric definition being used.
Coupling and instability
Afferent coupling (Ca) and efferent coupling (Ce) describe incoming and outgoing dependencies. The documented instability formula is Ce / (Ce + Ca). These measures can help expose dependency direction and possible change sensitivity, but their significance depends on the architecture and the role of the package or class.
Halstead, size, and structure
PhpMetrics lists Halstead vocabulary, length, volume, difficulty, effort, level, bugs, time, and operator/operand counts. These are formula-derived measures: a Halstead “bugs” estimate is not a count of defects found in the source. Other available measures include lines of code, method counts, inheritance depth, and Card/Agresti complexity measures. They describe aspects of size and structure; none is a standalone quality grade.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Use findings as a review queue, not a scorecard
A useful report narrows the search space. Select a conspicuous file or class, inspect the underlying code, and ask whether its complexity, cohesion, or dependencies create a real maintenance risk in that project. Confirm concerns against behavior, tests, and architectural intent before changing code or setting a CI gate. PhpMetrics visualizes and reports metrics; interpretation and engineering judgment remain necessary.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

