#128 · Programming Language Tools Developer Tool

PHP Inspector

Inspect PHP code for maintainability, readability, complexity, documentation, security risks, and common code smells with transparent scoring.

Developer Input

Local browser processing
lines
Ad space

How to use this developer tool

  1. Paste PHP source.
  2. Select inspection depth.
  3. Set the long-method threshold.
  4. Enable security, complexity, and duplication checks.
  5. Review the score and top issues.

What this developer tool does

It calculates line and declaration metrics, estimates nesting and complexity, flags code smells, and combines category scores into an overall rating.

Metrics → smell rules → security rules → category scores → weighted overall score → prioritized recommendations.

Metrics are estimates. They are useful for triage and comparison but do not replace dedicated static-analysis platforms or human code review.

Example

Input: a deeply nested function using eval.

Output: security, nesting, parameter-count, and maintainability findings.

Tips for better output

  • Focus on the highest-risk and highest-complexity functions first.
  • Use scores comparatively across revisions.
  • Do not optimize solely to improve a numeric score.

FAQ

How can I measure PHP code complexity online?

Run the inspector to estimate nesting, branching, function size, and parameter counts.

How do I find code smells in a PHP file?

The inspector flags long methods, deep nesting, too many parameters, magic numbers, globals, empty catches, and related patterns.

How can I calculate PHP maintainability score?

The tool combines maintainability, readability, complexity, security, and documentation subscores with published weights.

How do I detect long methods and deep nesting in PHP?

Set the long-method threshold and enable complexity analysis.

How can I inspect PHP code for security risks?

Enable security analysis to flag risky execution, serialization, input, hashing, SQL, and file-path patterns.

Score weights

ModulePurpose
Maintainability30%
Readability20%
Complexity20%
Security20%
Documentation10%

Browse more developer tools

Calldeveloper category hub