Class::Sniff

Look for class composition code smells
Download

Class::Sniff Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Curtis Poe
  • Publisher web site:
  • http://search.cpan.org/~ovid/

Class::Sniff Tags


Class::Sniff Description

Look for class composition code smells The interface is rather ad-hoc at the moment and is likely to change. After creating a new instance, calling the report method is your best option. You can then visually examine it to look for potential problems: my $sniff = Class::Sniff->new({class => 'Some::Class'}); print $sniff->report;Class::Sniff is a Perl module that attempts to help programmers find 'code smells' in the object-oriented code. If it reports something, it does not mean that your code is wrong. It just means that you might want to look at your code a little bit more closely to see if you have any problems.At the present time, we assume Perl's default left-most, depth-first search order. We may alter this in the future (and there's a work-around with the paths method. More on this later).SYNOPSIS use Class::Sniff; my $sniff = Class::Sniff->new({class => 'Some::class'}); my $num_methods = $sniff->methods; my $num_classes = $sniff->classes; my @methods = $sniff->methods; my @classes = $sniff->classes; my $graph = $sniff->graph; # Graph::Easy my $graphviz = $graph->as_graphviz(); open my $DOT, '|dot -Tpng -o graph.png' or die("Cannot open pipe to dot: $!"); print $DOT $graphviz; print $sniff->to_string; my @unreachable = $sniff->unreachable; foreach my $method (@unreachable) { print "$method\n"; } Requirements: · Perl


Class::Sniff Related Software