expressjs/morgan
HTTP request logger middleware for node.js
- Repository: https://github.com/expressjs/morgan
- Commit:
b1272e70812dbc504321eeb5a43d14b0822c150d - Generated: 2026-11-13T23:07:38+00:00
- Scorer 0.1.0, scoring prov-3+qual-1+sec-1, report schema v2
Scores
| Pillar | Score | Signal | Confidence | Coverage |
|---|---|---|---|---|
| AI provenance (estimated AI-generated share) | 0 | none-detected | 65% | 100% |
| Code quality | 96 | strong | 90% | 100% |
| Security | 85 | strong | 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%
-
LLM judge (claude-opus-5-5, 1 sampled files): mixed, AI likelihood 0.35, confidence 0.55. Reported as a signal, not scored.
| Month | Lines added | Attributed to AI |
|---|---|---|
| 2018-03 | 155 | 0% |
| 2018-07 | 7 | 0% |
| 2018-09 | 112 | 0% |
| 2018-10 | 23 | 0% |
| 2018-11 | 211 | 0% |
| 2019-01 | 1 | 0% |
| 2019-09 | 1 | 0% |
| 2020-02 | 1 | 0% |
| 2025-12 | 38 | 0% |
| 2026-06 | 150 | 0% |
| 2026-08 | 347 | 0% |
| 2026-09 | 42 | 0% |
Evidence
- mixed: Most of index.js matches the long-established, human-written upstream morgan code, with its terse comments, original JSDoc layout and copyright header. The added escapeLogField helper and NO_COLOR constant break that style. The helper's JSDoc uses lowercase types, '@returns' and full-sentence text, with no blank line before the function. Upstream code uses capitalised types, '@return' and a blank line. NO_COLOR has no doc comment. This suggests a recent patch, possibly AI-assisted, on top of human code.
- The escapeLogField JSDoc uses '@returns {string|undefined}' and lowercase types, which differs from the '@return {Function}' and '{String|Function}' convention used elsewhere in the file.
- escapeLogField has a polished, comprehensive escape switch covering / , with a tidy explanatory doc sentence, which is typical of AI-written security patches.
- The NO_COLOR constant has no JSDoc block, unlike the other module-level constants, so it looks like an inconsistent later addition.
- The bulk of the file keeps upstream morgan's idiosyncratic human style, with comments like 'smart deprecation message' and 'swap the stream'.
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 strong: test-to-source ratio 3.61, CI runs tests; 0% of function code in complex or long functions; 0% duplicated lines. Weakest area: process.
| Area | Score |
|---|---|
| Complexity (lizard) | 100 |
| Duplication | 100 |
| Code smells (Opengrep) | 100 |
| Tests and CI | 100 |
| Documentation | 85 |
| Type safety | n/a |
| Process (Scorecard review/maintenance) | 77 |
- Functions: 33; mean complexity 2.9, 90th percentile 6; 0 complex and 0 long functions
- Duplicated lines: 0.0% of 339 compared
- Tests: 2,150 test lines for 596 source lines (ratio 3.61); CI test commands: npm test, npm run test; 50% of recent source commits also change tests
- Docs missing or thin: contributing
Security
Security posture is strong: 1 high-severity workflow issues. Weakest area: scorecard.
| Area | Score |
|---|---|
| Secrets (gitleaks, tree + history) | 97 |
| Static analysis (Opengrep) | 92 |
| Vulnerable dependencies (OSV) | n/a |
| CI workflows (zizmor) | 78 |
| Posture (policy, updates, signing, lockfiles) | 80 |
| OpenSSF Scorecard | 61 |
- Posture checks passed: security policy, dependency updates; missing: signed commits, lockfiles
- OpenSSF Scorecard aggregate: 7.6/10 (published 2026-11-09T21:19:46Z)
Top findings
| Severity | Finding | Location |
|---|---|---|
| high | zizmor/cache-poisoning: runtime artifacts potentially vulnerable to a cache poisoning attack [confidence low] |
.github/workflows/npm-publish.yml:27 |
| medium | opengrep/javascript.lang.security.audit.unsafe-dynamic-method: Using non-static data to retrieve and run functions from the object is dangerous. If the data is user-controlled, it may allow executing arbitrary code. [confidence low] |
index.js:230 |
| medium | zizmor/dependabot-cooldown: insufficient cooldown in Dependabot updates [confidence high] |
.github/dependabot.yml:3 |
| medium | zizmor/dependabot-cooldown: insufficient cooldown in Dependabot updates [confidence high] |
.github/dependabot.yml:8 |
| medium | zizmor/artipacked: credential persistence through GitHub Actions artifacts [confidence low] |
.github/workflows/ci.yml:156 |
| medium | zizmor/artipacked: credential persistence through GitHub Actions artifacts [confidence low] |
.github/workflows/codeql.yml:43 |
| low | gitleaks/private-key: Possible private-key secret in the current tree (test/docs/example file) |
test/fixtures/server.key:1 |
| low | zizmor/adhoc-packages: ad-hoc installation of packages [confidence high] |
.github/workflows/npm-publish.yml:34 |
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: 596; test lines: 2,150
| Language | Lines |
|---|---|
| JavaScript | 2,746 |