phacility/xhprof
XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based user interface.
- Repository: https://github.com/phacility/xhprof
- Commit:
0bbf2a2ac34f495e42aa852293fe0ed821659047 - Generated: 2026-11-13T23:33:02+00:00
- Scorer 0.1.0, scoring prov-4+qual-2+sec-2, report schema v2
Scores
| Pillar | Score | Signal | Confidence | Coverage |
|---|---|---|---|---|
| AI provenance (estimated AI-generated share) | 0 | none-detected | 56% | 100% |
| Code quality | 62 | weak | 90% | 100% |
| Security | 73 | adequate | 85% | 100% |
AI provenance
No AI attribution or AI-consistent velocity signals detected.
- Explicitly attributed share (lower bound): 0.0%
- Unattributed share in AI-consistent velocity bursts: 0.0%
- Estimated AI-generated share: 0.0%
| Month | Lines added | Attributed to AI |
|---|---|---|
| 2011-07 | 20 | 0% |
| 2011-12 | 4 | 0% |
| 2012-02 | 44 | 0% |
| 2012-11 | 1 | 0% |
| 2013-01 | 51 | 0% |
| 2013-03 | 6 | 0% |
| 2013-04 | 4 | 0% |
| 2013-07 | 1 | 0% |
| 2013-10 | 4 | 0% |
| 2014-04 | 2 | 0% |
| 2014-08 | 122 | 0% |
| 2015-02 | 18 | 0% |
AI provenance describes how code was produced; it is not a quality judgment. Unless attribution is explicit, these are signals consistent with AI generation, not proof. Squash/rebase workflows, imported code, and rewritten history reduce accuracy.
Code quality
Code quality is weak: test-to-source ratio 0.01, no CI test run detected; 24% of function code in complex or long functions; 4% duplicated lines. Weakest area: testing.
| Area | Score |
|---|---|
| Complexity (lizard) | 49 |
| Duplication | 79 |
| Code smells (Opengrep) | 100 |
| Tests and CI | 39 |
| Documentation | 65 |
| Type safety | n/a |
| Process (Scorecard review/maintenance) | n/a |
- Functions: 224; mean complexity 3.6, 90th percentile 7; 5 complex and 4 long functions
- Duplicated lines: 4.0% of 4,650 compared
- Tests: 95 test lines for 6,799 source lines (ratio 0.01); CI test commands: none detected; 8% of recent source commits also change tests
- Docs missing or thin: readme, contributing
Most complex functions:
- xhprof_generate_dot_script in xhprof_lib/utils/callgraph_utils.php: complexity 51, 191 lines
- symbol_report in xhprof_lib/display/xhprof.php: complexity 27, 212 lines
- xhprof_aggregate_runs in xhprof_lib/utils/xhprof_lib.php: complexity 22, 82 lines
- xhprof_render_link in xhprof_lib/display/xhprof.php: complexity 17, 51 lines
- (anonymous) in xhprof_html/jquery/jquery.autocomplete.js: complexity 16, 53 lines
Security
Security posture is adequate: 1 high-severity SAST findings. Weakest area: posture.
| Area | Score |
|---|---|
| Secrets (gitleaks, tree + history) | 100 |
| Static analysis (Opengrep) | 76 |
| Vulnerable dependencies (OSV) | n/a |
| CI workflows (zizmor) | n/a |
| Posture (policy, updates, signing, lockfiles) | 0 |
| OpenSSF Scorecard | n/a |
- Posture checks passed: lockfiles; missing: security policy, dependency updates, signed commits
Top findings
| Severity | Finding | Location |
|---|---|---|
| high | opengrep/php.lang.security.exec-use: Executing non-constant commands. This can lead to command injection. [confidence low] |
xhprof_lib/utils/callgraph_utils.php:112 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-selector: User controlled data in a $(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:69 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-selector: User controlled data in a $(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:84 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-selector: User controlled data in a $(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:197 |
| medium | opengrep/javascript.lang.security.audit.detect-non-literal-regexp: RegExp() called with a term function argument, this might allow an attacker to cause a Regular Expression Denial-of-Service (ReDoS) within your application as RegExP blocks the main thread. For this reason, it is recommended to use hardcoded regexes instead. If your regex is run on user-controlled [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:409 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-selector: User controlled data in a $(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:577 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-selector: User controlled data in a $(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:580 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-method: User controlled data in a jQuery's .html(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:648 |
| medium | opengrep/javascript.jquery.security.audit.prohibit-jquery-html: JQuery's html function is susceptible to Cross Site Scripting (XSS) attacks. If you're just passing text, consider text instead. Otherwise, use a function that escapes HTML such as edX's HtmlUtils.setHtml(). [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:648 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-selector: User controlled data in a $(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:700 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-selector: User controlled data in a $(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.autocomplete.js:702 |
| medium | opengrep/javascript.jquery.security.audit.prohibit-jquery-html: JQuery's html function is susceptible to Cross Site Scripting (XSS) attacks. If you're just passing text, consider text instead. Otherwise, use a function that escapes HTML such as edX's HtmlUtils.setHtml(). [confidence low] |
xhprof_html/jquery/jquery.tooltip.js:87 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-method: User controlled data in a jQuery's .appendTo(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.tooltip.js:100 |
| medium | opengrep/javascript.jquery.security.audit.jquery-insecure-selector: User controlled data in a $(...) is an anti-pattern that can lead to XSS vulnerabilities [confidence low] |
xhprof_html/jquery/jquery.tooltip.js:100 |
| medium | opengrep/javascript.jquery.security.audit.prohibit-jquery-html: JQuery's html function is susceptible to Cross Site Scripting (XSS) attacks. If you're just passing text, consider text instead. Otherwise, use a function that escapes HTML such as edX's HtmlUtils.setHtml(). [confidence low] |
xhprof_html/jquery/jquery.tooltip.js:152 |
| medium | opengrep/javascript.jquery.security.audit.prohibit-jquery-html: JQuery's html function is susceptible to Cross Site Scripting (XSS) attacks. If you're just passing text, consider text instead. Otherwise, use a function that escapes HTML such as edX's HtmlUtils.setHtml(). [confidence low] |
xhprof_html/jquery/jquery.tooltip.js:157 |
| medium | opengrep/javascript.jquery.security.audit.prohibit-jquery-html: JQuery's html function is susceptible to Cross Site Scripting (XSS) attacks. If you're just passing text, consider text instead. Otherwise, use a function that escapes HTML such as edX's HtmlUtils.setHtml(). [confidence low] |
xhprof_html/jquery/jquery.tooltip.js:166 |
| medium | opengrep/javascript.jquery.security.audit.prohibit-jquery-html: JQuery's html function is susceptible to Cross Site Scripting (XSS) attacks. If you're just passing text, consider text instead. Otherwise, use a function that escapes HTML such as edX's HtmlUtils.setHtml(). [confidence low] |
xhprof_html/jquery/jquery.tooltip.js:172 |
| medium | opengrep/php.lang.security.unserialize-use: Calling unserialize() with user input in the pattern can lead to arbitrary code execution. Consider using JSON or structured data approaches (e.g. Google Protocol Buffers). [confidence low] |
xhprof_lib/utils/xhprof_runs.php:121 |
Static signals only: the scorer never runs the project's code. Secret findings are pattern matches that were not verified, and secret values are never stored.
Repository profile
- Source lines: 6,799; test lines: 95
| Language | Lines |
|---|---|
| PHP | 3,540 |
| C | 2,097 |
| JavaScript | 1,257 |