<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/new-php-package-sloppy-static-analysis-for-debt-ai-agents-leave-vqeuhqfkv" -->

---
title: New PHP Package Sloppy: Static Analysis for Debt AI...
description: A walkthrough of Sloppy, a new Laravel static analysis package that acts as a code reviewer, flagging issues like N+1 query problems and high cyclomatic...
canonical: https://daily.dev/posts/new-php-package-sloppy-static-analysis-for-debt-ai-agents-leave-vqeuhqfkv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: New PHP Package Sloppy: Static Analysis for Debt AI Agents Leave | daily.dev
og:description: A walkthrough of Sloppy, a new Laravel static analysis package that acts as a code reviewer, flagging issues like N+1 query problems and high cyclomatic...
og:url: https://daily.dev/posts/new-php-package-sloppy-static-analysis-for-debt-ai-agents-leave-vqeuhqfkv
og:image: https://api.daily.dev/og/posts/vQEUHQfKV.png
og:image:alt: New PHP Package Sloppy: Static Analysis for Debt AI Agents Leave
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# New PHP Package Sloppy: Static Analysis for Debt AI Agents Leave

**[Laravel Daily](https://daily.dev/sources/laraveldaily)** · 7 min read · 1 upvotes · 0 comments

## Summary

A walkthrough of Sloppy, a new Laravel static analysis package that acts as a code reviewer, flagging issues like N+1 query problems and high cyclomatic complexity ('god methods'). The demo runs Sloppy against an AI-generated Filament admin panel, finds a query-inside-loop issue in a chart data method, then uses Claude Code (Opus model) to fix it by collapsing 35 queries into one. The video also covers Sloppy's diff, review, and baseline commands for tracking resolved findings and preparing code for review, especially useful when reviewing AI agent-generated code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=x9ucQIX3F18>

## Questions this post answers

### What is the Sloppy package for Laravel and what does it do?

Sloppy is a Laravel package that acts as a local static code reviewer, run via the php artisan sloppy command. It flags issues such as queries inside loops (N+1 problems) and high cyclomatic complexity ('god methods'), assigns a score out of 100 with confidence levels, and includes commands like sloppy diff, sloppy review head, and sloppy baseline to track resolved findings and prepare code for review, notably for AI agent generated changes.

_Developers vetting AI-generated Laravel code can follow tools like this as they emerge on daily.dev._

### How can query-inside-loop N+1 problems in Laravel be fixed when found by a code analysis tool?

One approach is to fetch all needed data in a single query before the loop starts, replacing per-iteration queries with pre-aggregated data. In a real example, a chart method issuing 35 separate queries (5 statuses times 7 dates) was reduced to one raw SQL query using group by date and status, then mapped into the same date and collection structure the loop originally built.

_Laravel developers optimizing database-heavy code can track query performance techniques on daily.dev._

## Similar posts on daily.dev

- [The AI slop problem threatening open source maintainers](https://daily.dev/posts/the-ai-slop-problem-threatening-open-source-maintainers-unezbi42s) · All Things Open · 0 upvotes · 0 comments
- [Laravel Auditor Audits Your App With Your Own AI Agent](https://daily.dev/posts/laravel-auditor-audits-your-app-with-your-own-ai-agent-u9kucbtdl) · Laravel News · 10 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel), [#claude-code](https://daily.dev/tags/claude-code), [#code-review](https://daily.dev/tags/code-review)

[View this post on daily.dev](https://daily.dev/posts/new-php-package-sloppy-static-analysis-for-debt-ai-agents-leave-vqeuhqfkv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"New PHP Package Sloppy: Static Analysis for Debt AI Agents Leave","url":"https://daily.dev/posts/new-php-package-sloppy-static-analysis-for-debt-ai-agents-leave-vqeuhqfkv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/new-php-package-sloppy-static-analysis-for-debt-ai-agents-leave-vqeuhqfkv"},"datePublished":"2026-09-28T05:01:37.601Z","dateModified":"2026-09-28T05:01:57.866Z","description":"A walkthrough of Sloppy, a new Laravel static analysis package that acts as a code reviewer, flagging issues like N+1 query problems and high cyclomatic...","image":"https://i.ytimg.com/vi/x9ucQIX3F18/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/x9ucQIX3F18/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Laravel Daily","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Laravel Daily","logo":"https://media.daily.dev/image/upload/s--vzdgNGfl--/f_auto/v1725044498/logos/laraveldaily","url":"https://daily.dev/sources/laraveldaily"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/new-php-package-sloppy-static-analysis-for-debt-ai-agents-leave-vqeuhqfkv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php,laravel,claude-code,code-review","timeRequired":"PT7M","video":{"@type":"VideoObject","name":"New PHP Package Sloppy: Static Analysis for Debt AI Agents Leave","description":"A walkthrough of Sloppy, a new Laravel static analysis package that acts as a code reviewer, flagging issues like N+1 query problems and high cyclomatic...","thumbnailUrl":"https://i.ytimg.com/vi/x9ucQIX3F18/sddefault.jpg","uploadDate":"2026-09-28T05:01:37.601Z","duration":"PT7M","url":"https://api.daily.dev/r/vQEUHQfKV","embedUrl":"https://www.youtube.com/embed/x9ucQIX3F18"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Laravel Daily","item":"https://daily.dev/sources/laraveldaily"},{"@type":"ListItem","position":3,"name":"New PHP Package Sloppy: Static Analysis for Debt AI Agents Leave"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/new-php-package-sloppy-static-analysis-for-debt-ai-agents-leave-vqeuhqfkv#faq","mainEntity":[{"@type":"Question","name":"What is the Sloppy package for Laravel and what does it do?","acceptedAnswer":{"@type":"Answer","text":"Sloppy is a Laravel package that acts as a local static code reviewer, run via the php artisan sloppy command. It flags issues such as queries inside loops (N+1 problems) and high cyclomatic complexity ('god methods'), assigns a score out of 100 with confidence levels, and includes commands like sloppy diff, sloppy review head, and sloppy baseline to track resolved findings and prepare code for review, notably for AI agent generated changes. Developers vetting AI-generated Laravel code can follow tools like this as they emerge on daily.dev."}},{"@type":"Question","name":"How can query-inside-loop N+1 problems in Laravel be fixed when found by a code analysis tool?","acceptedAnswer":{"@type":"Answer","text":"One approach is to fetch all needed data in a single query before the loop starts, replacing per-iteration queries with pre-aggregated data. In a real example, a chart method issuing 35 separate queries (5 statuses times 7 dates) was reduced to one raw SQL query using group by date and status, then mapped into the same date and collection structure the loop originally built. Laravel developers optimizing database-heavy code can track query performance techniques on daily.dev."}}]}
```

