Perl::...:McCabe(3pm)

πŸŽ€ Perl::...:McCabe(3pm) β€” the whole vibe πŸŽ€

okay so this is the manual page for Perl::...:McCabe(3pm), and bestie, it's literally all about counting how tangled your code is. no cap. let's get into it ✨


✨ NAME ✨

Perl::Critic::Utils::McCabe β€” functions that calculate the McCabe score of source code. that's it, that's the whole name, slay πŸ’…


🌸 DESCRIPTION 🌸

So this module gives you approximations of McCabe scores. Lowkey iconic. What's a McCabe score tho? It's a number that describes how many possible paths you can take through a set of code β€” like, the more ways your code can go, the bigger the number, and the bigger the vibe-check-on-your-complexity gets πŸ‘€

The functions in here approximate the McCabe score by summing the number of conditional statements and operators within a set of code. literally just counting the branching bits and adding them up, periodt.

There's some discussion about the McCabe number and other complexity metrics over at <http://en.wikipedia.org/wiki/Cyclomatic_complexity> if you wanna go read it, iykyk πŸ¦‹


πŸ’– INTERFACE SUPPORT πŸ’–

This is considered to be a public module. Which means if anybody ever wants to change its interface, they gotta go through a deprecation cycle first. no surprise-breaking-changes energy here, we respect the process 🫢


πŸŽ€ IMPORTABLE SUBS πŸŽ€

  • calculate_mccabe_of_sub( $sub ) β€” calculates an approximation of the McCabe number of the code inside a PPI::Statement::Sub. give it a sub, get a number πŸ’œ
  • calculate_mccabe_of_main( $doc ) β€” calculates an approximation of the McCabe number of all the code in a PPI::Statement::Document that is not contained in a subroutine. main character energy only, subs get left out πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> β€” thank you for your service, king 🌈


Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. πŸ“œ


fr fr, that's the whole page. no missing flags, no deleted caveats, we ate and left no crumbs πŸ’…πŸ“

okay bye bestie!! this page dropped with perl v5.42.0 on 2024-10-23 β€” go forth and measure your complexity, mwah πŸ§šπŸ’–

πŸ“¦ where this page comes from