Perl::...geBlock(3pm)
β¨ NAME β¨
Okay bestie, welcome to Perl::...geBlock(3pm) β the manual page you landed on, filed under User Contributed Perl Documentation π and honestly? It's short, it's sweet, it's giving one job. That job is:
TooMuchCode::ProhibitLargeBlock β Find oversized blocks ππ
π DESCRIPTION π
So like. This policy goes looking for large code blocks, specifically these three flavors of block-y situation:
map { ... };
grep { ... };
do { ... };
Not me side-eyeing your do { ... } block that's longer than my screen time report π. The policy scans for exactly these.
By default, a block counts as large when it has more than 10 statements in it. That's the vibe check. If your block is bigger than that, congrats, you're the main character of this policy π«Ά.
But what if 10 isn't your number? What if you have β¨differentβ¨ boundaries? Totally valid, bestie. You can set the parameter block_statement_count_limit and make it whatever you want. Custom limits? We love to see it. π
For example, in your .perlcriticrc file, it looks like this:
[TooMuchCode::ProhibitLargeBlock]
block_statement_count_limit = 20
And boom πΈ β now a block has to have more than 20 statements to get flagged. Lowkey iconic that it's that easy. No cap.
Heads up though: the parameter name is exactly block_statement_count_limit β copy it character for character, don't freestyle it, or Perl::Critic will simply not know what you're talking about π.
And that's the whole page, bestie. That's it. That's the policy. Go forth and keep your blocks smol πβ¨π¦
Source & version vibes: this one's from perl v5.36.0, dated 2023-10-05, living under the Perl::...geBlock(3pm) name. Mwah, bye ππβ
π¦ where this page comes from
- debian trixie: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu noble: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu resolute: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu stonking: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms