phpc.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A server for PHP programmers & friends. Join us for discussions on the PHP programming language, frameworks, packages, tools, open source, tech, life, and more.

Administered by:

Server stats:

834
active users

Jérémy DECOOL

Hey users, how your baseline big ?

How many errors do you ignore in your static analysis ?

@carbontwelve There are several reasons (more or less valid) to do it.

And I would like to know how common it is and get an idea of the baseline sizes.

@jdecool 6014 files, 273 errors ignored, level 8

@jdecool Here are numbers from four projects I work on regularly.

Projects that had SA right from the start:
1. 513 files, 35 ignored
2. 924 files, 97 ignored

Legacy Projects, SA was added later:
3. 830 files, 1475 ignored
4. 4040 files, 1939 ignored

@jdecool it's technically true too :) I don't ignore any using baseline. There are a couple of things I have to ignore on a current project because of how the CMS does things.

@jdecool - I have about 2000 errors in my baseline for about 250,000 lines of code. (Down from about 8000 when I started using phpstan.)

AFAICT, most are caused by two things:

1) I have an error-handler so functions like file_get_contents() will throw exceptions instead of returning false.

2) Every SQL query (Laravel QueryBuilder) gives a return type of mixed, and I don't see a way to tell it what columns/types are returned.

@fisharebest Thanks for your detailed answer

@jdecool too many 🙈
Level 8, 837 errors

@jdecool IMHO there's no "bad" number, the important thing is to get that number gradually down.

In fact, I suggest to use the baseline to raise the level immediately to 7, and start from there, instead of raising the level gradually.

Same for PHPStan upgrades: better to upgrade immediately than to be stuck because you have too many new errors.

@alessandrolai Agree. There's no judgement.

Just want to have an idea of numbers :)