perlcritic man page

J

John Dollar

Is it just me, or is the man page for perlcritic messed up?

I ask because it's very confusing when it comes to severity.

First, it states for the "-severity N" option:

Severity values are integers ranging from 1 (least severe) to 5 (most
severe). The default is 5.

(which makes you figure it defaults to the MOST SEVERE.)

Then later on, for "-severity NAME":

SEVERITY NAME ...is equivalent to... SEVERITY NUMBER
--------------------------------------------------------
-severity gentle -severity 5
-severity stern -severity 4
-severity harsh -severity 3
-severity cruel -severity 2
-severity brutal -severity 1

Which is 100% the opposite.

Then for the "-gentle | -stern | -harsh | -cruel | -brutal" options:

These are named shortcuts for setting the "-severity" option. For
example, "-cruel" is equivalent to "-severity 4".

Umm...no...according to the table above, 4 is "-stern", not "-cruel".

And, of course, the real answer is that the table for "-severity NAME" is the
*ONLY* place that it is correct. However, it DOES default to 5, which is the
LEAST severe.

So, either this is written in some new version of the English language I've
never seen where words change their meanings paragraph to paragraph, or it's
completely confusing/wrong/needs fixing/etc./etc.
 
Joined
Apr 27, 2007
Messages
1
Reaction score
0
Severity levels in perlcritic

In the early versions, perlcritic only supported the numeric severity levels. But many people said it was hard to remember if "1" was the most critical or least critical setting. So I added the named severity levels to make it a little easier. I didn't realize it at the time, but I had overloaded the meaning of "severity". I agree that it still isn't intuitive, so please allow me to try and explain...

Each violation has a numeric severity level assigned to it (ranging from 1 to 5). Violations with larger numbers are considered more important than those with smaller numbers.

Now when you use a numeric argument with the -severity option, think of it as the minimum level of importance. So "-severity 5" reports only the most important violations.

But when you use a named argument with the -severity option, think of it as the intensity of criticism. So "-severity gentle" also reports only the most important violations.

Essentially, the named and numeric severity levels have an inverse effect. The stronger names equate to smaller numbers, and weaker names equate to larger numbers. But most folks associate greater size with greater strength, so this arrangement can definitely be confusing.

You are absolutely correct about the error in the docs. It should read:

"-cruel" is equivalent to "-severity 2"​

Thaks for spotting that. I'll fix it in the next release.

So let me know if that helps clear things up, and I'll try to beef up the documentation as well. If you have suggestions on how to improve the interface, you're totally welcome to send your ideas to the perlcritic team at "dev at perlcritic dot tigris dot org". And thanks for your helpful feedback.

Cheers.

-Jeff
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top