DEV Community

Matt Kenefick
Matt Kenefick

Posted on

3 1

Commands to check your technical debt in Laravel

The core command here is:

grep -nr -e '@urgent' -e '@todo' -e '@fixme'  resources app

    -e Designates a pattern to find
    -n Shows the line number
    -r Recursively through directories

    List as many directories in sequence to iterate through
Enter fullscreen mode Exit fullscreen mode

I've added it to composer as a script called "debt":

"debt": [
    "grep -nr -e '@urgent' -e '@todo' -e '@fixme'  resources app"
],
Enter fullscreen mode Exit fullscreen mode

Then you can run something like:

composer debt


app/Utility/Film.php:39:     * @todo Swap out with a regex
app/Utility/Media.php:161:     * @todo we have to make sure we kill the webp as well
app/Utility/Media.php:189:     * @todo move this to a utility class like we did for Utility/Media
app/Utility/Media.php:592:        // @flag @urgent the `getCommonColors` function is slow
Enter fullscreen mode Exit fullscreen mode

You could also use it in package.json like:

"scripts": {
    "debt": "grep -nr -e '@urgent' -e '@todo' -e '@fixme'  resources app"
}

...

    npm run debt
Enter fullscreen mode Exit fullscreen mode

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more