Spawned from False positive on commented URLs (which as far as I can tell only applies to comment docblocks).
It is often extremely useful to record URLs of relevant software engineering tips alongside code using inline comments //
Sometime these URLs are longer than 80 chars, and trigger this:
WARNING | Line exceeds 80 characters; contains 87 characters
Example: the following URL (about type casting in PHP) is longer than 80 chars and triggers the above.
// http://stackoverflow.com/questions/1147109/type-casting-for-user-defined-objects
My Coder review output on this educational tutorial module is currently fairly littered with the above WARNING, because I make frequent use in the code of such reference links, and they turn out to often be longer than 80 chars. I do not want to have to remove this useful and in some cases crucial information just to pass the Coder tests.
Please relax the rule to identify URLs via the http:// and https:// prefixes and permit URLs longer than 80 chars.
Such reference URLs do not always belong in a @link @endlink or a @see, they belong correctly in the code (usually under relevant code) not in doc blocks.
Comments
Comment #1
klausiYou should use "@see ", then Coder Sniffer will not complain. See https://www.drupal.org/node/1354#see
Comment #2
webel CreditAttribution: webel commented@klausi
Thanks for your feedback, but you don't seem to have understood my point at all, I am reopening this.
I am talking about inline comments in code, usually under code, referring to aspects of code.
There are not links for the docblock, and certainly not for @see (or for @link.)
Such links are used as reference within the code to information about the implementation and do not belong in the docblock.
Comment #3
webel CreditAttribution: webel commentedComment #5
klausiCommitted a fix to always allow text that does not contain spaces (like URLs) to exceed 80 characters.
Comment #7
webel CreditAttribution: webel commentedthanks, i appreciate this fix.