Skip to content

Adding this to PPIx::EditorTools? #4

xsawyerx opened this Issue May 3, 2012 · 4 comments

2 participants

xsawyerx commented May 3, 2012

PPIx::EditorTools is a distribution that contains various tools that help editors, such as Padre.

App::EditorTools makes the command line be able to work on it as well.

Basically this could be added to PPIx::EditorTools as a subroutine complexity, and App::EditorTools could contain the App logics for it, and then App::whack (or App::subwhack) could be written to whack complex subroutines using it.

Just a thought.

wickline commented May 4, 2012

hmm... so if you were editing away in Padre or whichever editor, how do you envision using the tool? You'd invoke a command while in a sub, or while a selection contained some subs? And what would you want to get back?

Whack was initially meant to find comparatively complex subs in a larger body of work. The most recent commit adds some visibility into the the raw metrics used to compute relative scores. Would you just want to get the raw metrics back (this sub has x lines of code, y blocks, and nests blocks up to z deep)?

xsawyerx commented May 4, 2012

If it's meant for scanning an entire body of work, that could still work well for Padre. It could scan your file, your directory or what Padre conceives as your "project directory" (it supports such a term).

I'm myself not a Padre developer, nor will I be the one to write a plugin to use it, but recently Gabor Szabo (father of Padre - get it? :) gave a talk about refactoring tools and how he'd want to add more to Padre. This seems like something along that line.

My personal gain is simply having it in PPIx::EditorTools and App::EditorTools so could simply have it installed as part of that toolkit.

This could also help VIM/Emacs/etc. users because App::EditorTools connects to those. I wouldn't mind being able to press ,cc or whatever and have it use your code to jump to the most complex subroutine I have. Now I'm doing it manually but this is precisely what I'm using this code for right now.
(this is probably the moment to say "well done!" :)


in reverse order...


do you mind if I ask what project you're whacking?

I like the idea of facilitating editor integration. Given my supply of extra-employment hacking tuits, it will likely be a while before I'd get around to an EditorTools retooling, but I'm glad you had the idea and I'll keep the issue open for when the tuits attack


I'm trying to whack some $work projects and various scripts. So far it's fun. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.