Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Module Announcement: Perl-Critic-1.01

by BrowserUk (Pope)
on Jan 26, 2007 at 11:37 UTC ( #596696=note: print w/ replies, xml ) Need Help??


in reply to Module Announcement: Perl-Critic-1.01

Hmm. I selected a file from my test dir at random:

#! perl -slw use strict; use Devel::Timer; sub firstNprimes { my $n = shift; open my $primes, '<:raw', 'data\primes.all' or die $!; my @primes = split ' ', do{ local $/ = \( $n * 10 ); <$primes> }; close $primes; return \@primes; } BEGIN{ <STDIN>; } my $T = new Devel::Timer; my $ref = firstNprimes( $ARGV[ 0 ] ); $T->mark( $ARGV[ 0 ] ); { local $\; $T->report; } printf 'Check mem'; <STDIN>; __END__ C:\Perl\test\data>..\junk4 Devel::Timer Report -- Total time: 0.3176 secs Interval Time Percent ---------------------------------------------- 02 -> 03 0.3169 99.78% 100,000 -> 1,000,000 01 -> 02 0.0007 0.21% 201 -> 100,000 00 -> 01 0.0000 0.01% INIT -> 201

And and gave it to your demo page. (It'd be nice if the results where prefixd with a MIME/text header so that my browser wouldn't wrap everything.) I got:

Code before strictures are enabled at line 1, column 1. See page 429 o +f PBP. RCS keywords $Id$ not found at line 1, column 1. See page 441 of PBP. RCS keywords $Revision$, $HeadURL$, $Date$ not found at line 1, column + 1. See page 441 of PBP. RCS keywords $Revision$, $Source$, $Date$ not found at line 1, column +1. See page 441 of PBP. No "VERSION" variable found at line 1, column 1. See page 404 of PBP. Code before warnings are enabled at line 1, column 1. See page 431 of +PBP. perltidy had errors!! at line 1, column 1. See page 33 of PBP. Code not contained in explicit package at line 1, column 1. Violates e +ncapsulation. Code not contained in explicit package at line 2, column 33. Violates +encapsulation. Useless interpolation of literal string at line 2, column 38. See page + 51 of PBP. Code not contained in explicit package at line 2, column 51. Violates +encapsulation. Useless interpolation of literal string at line 2, column 60. See page + 51 of PBP. Code not contained in explicit package at line 7, column 1. Violates e +ncapsulation. Mixed-case subroutine name at line 9, column 1. See page 44 of PBP. Code not contained in explicit package at line 9, column 1. Violates e +ncapsulation. Code not contained in explicit package at line 10, column 5. Violates +encapsulation. Code not contained in explicit package at line 11, column 5. Violates +encapsulation. "die" used instead of "croak" at line 11, column 52. See page 283 of P +BP. Magic punctuation variable used at line 11, column 56. See page 79 of +PBP. Code not contained in explicit package at line 12, column 5. Violates +encapsulation. Quotes used with an empty string at line 12, column 24. See page 53 of + PBP. Code not contained in explicit package at line 12, column 33. Violates + encapsulation. Magic punctuation variable used at line 12, column 39. See page 79 of +PBP. Code not contained in explicit package at line 12, column 47. Violates + encapsulation. Code not contained in explicit package at line 12, column 58. Violates + encapsulation. Code not contained in explicit package at line 13, column 5. Violates +encapsulation. Code not contained in explicit package at line 14, column 5. Violates +encapsulation. Code not contained in explicit package at line 17, column 1. Violates +encapsulation. Code not contained in explicit package at line 17, column 8. Violates +encapsulation. Code not contained in explicit package at line 18, column 1. Violates +encapsulation. Code not contained in explicit package at line 20, column 1. Violates +encapsulation. Code not contained in explicit package at line 20, column 25. Violates + encapsulation. Code not contained in explicit package at line 20, column 32. Violates + encapsulation. Code not contained in explicit package at line 21, column 1. Violates +encapsulation. Code not contained in explicit package at line 21, column 11. Violates + encapsulation. Code not contained in explicit package at line 21, column 18. Violates + encapsulation. Code not contained in explicit package at line 23, column 2. Violates +encapsulation. "local" variable not initialized at line 23, column 3. See page 78 of +PBP. Code not contained in explicit package at line 23, column 3. Violates +encapsulation. Magic punctuation variable used at line 23, column 9. See page 79 of P +BP. Code not contained in explicit package at line 23, column 13. Violates + encapsulation. Code not contained in explicit package at line 25, column 1. Violates +encapsulation. Module does not end with "1;" at line 25, column 21. Must end with a r +ecognizable true value. Code not contained in explicit package at line 25, column 21. Violates + encapsulation. Code not contained in explicit package at line 27, column 1. Violates +encapsulation.

Have you ever heard the parable of the Boy That Cried Wolf? There may be one or two useful messages in there somwhere, but they are so drowned by useless and incorrect noise, that I cannot see them. I cannot even make the line numbers tally?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Module Announcement: Perl-Critic-1.01
Select or Download Code
Re^2: Module Announcement: Perl-Critic-1.01
by holli (Monsignor) on Jan 26, 2007 at 12:10 UTC
    Yeah. Looks like 18 months of development for the trashcan. But that's just me.

    Update: Me too used the web interface which is apparently broken. Using the version from CPAN gives better results. Apologies.


    holli, /regexed monk/

      I just cleared out the cache and restarted apache. Not sure what was wrong. Seems to work better now. I'm glad you guys spotted that.

      -Jeff
Re^2: Module Announcement: Perl-Critic-1.01
by jthalhammer (Friar) on Jan 26, 2007 at 13:34 UTC

    How odd. It appears that the report you got was created on Jan 19 and pertains to some other file that was previously uploaded. Somehow, the web-service dished up the wrong analysis. I'll have to dig into it. Thanks for exposing that!

    When I analyze your code with 'perlcritic' directly, the results seem much more sensible, and a lot less noisy.

    -Jeff

      I just tried again, and got

      I knew I wouldn't like it, but I at least expected to have to justify my arguments. But this?

      This is just another example of the PC madness, like http://news.bbc.co.uk/1/hi/england/north_yorkshire/6296637.stm and many, many other examples that is gripping our world and turning it into a mirthless, freedomless place of bland, grey uniformity.

      Thanks theDamian. You've gone from being the wild child of Perl, envied and awed by the many; to being the pillar of salt that the PHBs will forever use to enforce mediocrity, uniformity and the lowest common denominator upon the once hip and innovative and freedom loving world of Perl. Like the reformed smoker, or the born again religious, when you converted, you made sure that the PHBs will enforce your will upon the rest of us too.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Dead on the mark, BrowserUk, and the link you provided is very appropriate:
        "I must admit the lady wasn't too persistent and I realised she was only doing what she's been told to do."

        A Morrisons spokesman said: "This is done with the best of intentions and we would hope it is taken in good humour by those obviously over the age of 21, as we do not wish to cause offence and no disrespect is intended.

        "We take our responsibility with regard to selling alcohol very seriously and all our stores operate the Task 21 scheme, which addresses the difficulties staff face in being able to determine if a customer is legally old enough to buy alcohol.

        "To further limit any element of doubt, staff at the Acomb store are required to ask anyone buying alcohol to confirm that they are over 21."

        Continue to force people to do things contrary to their understanding of what is best in a given context, only because there are rules that say so, and you end up with them not being able to trust their inner guidance any more.

        Perl is so much about context and expression, which comes along with ambiguities, that rule enforcing ultimately leads you to fighting your tool.

        If by some odd chance I have to live under the sway of Perl::Critic (or PBP, for that matter), I'll continue to say mkdir $dir, 0755 and not convert the flags to decimal, and I'll say opendir (D, $dir) or die "foo: $!\n" despite grouping parens for builtins being deprecated, because that way I can work best, fast, and I can read my code. Any other perler also can; the aforementioned expressions will only seem wrong to those which know PBP and don't know TIMTOWDI.

        I'll continue to use perl "to get your job done, before your boss fires you" (which you sometimes is me, sometimes is you). I guess I will have gob enough to argue with any PHB, and the code fixing a la Damian will be paid for, as well...

        --shmem

        _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                      /\_¯/(q    /
        ----------------------------  \__(m.====·.(_("always off the crowd"))."·
        ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://596696]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-08-21 08:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (128 votes), past polls