Joys and rants of a Python programmer | Pow! Wham, bam, kapow!



Cyclomatic complexity in emacs

Seeing the Cyclomatic complexity in VIM video got me slightly envious. As I am a long time GNU Emacs user I have decided to get back at those VIM people. Emacs can do everything that VIM can, only better after all ;) So I present you pycomplexity — an Emacs mode that can do the same thing that vim-complexity does:
pieces of code highlighted according to cyclomatic complexity

pieces of code highlighted according to cyclomatic complexity

At the moment the mode is “Works on my machine” certified. But it’s open source, so contributions are welcome. Big thanks go to Markus Triska the author of the linum.el and Gary Bernhardt for writing the complexity code calculator. Oh as for the more part: emacs_complexity_2 Coming up next – documenting how to set up pyflakes-enabled flymake: emacs_complexity_3 Competition spurs innovation after all ;)
  • Digg
  • Reddit
  • Delicious
  • StumbleUpon
  • Share/Bookmark

RSS Feed

4 Comments for Cyclomatic complexity in emacs

Marius Gedminas | November 27, 2009 at 20:15


matt harrison | November 28, 2009 at 00:01

Nice, I need to look at your code to use column highlighting for coverage results….

Geoffrey Grosenbach | December 24, 2009 at 00:34

I modified this to run the Ruby flog tool on my Ruby code and display the score in the margin. Super useful, thanks!

Andy | February 27, 2010 at 23:39

Where did the github repo go?

Leave a comment!

<< Testing your translations for bugs

Cleaning up postgresql database >>

Find it!

Theme Design by