| Test-Perl-Metrics-Simple documentation | view source | Contained in the Test-Perl-Metrics-Simple distribution. |
Test::Perl::Metrics::Simple - Use Perl::Metrics::Simple in test programs
Test one file:
use Test::Perl::Metrics::Simple; use Test::More tests => 1; metrics_ok($file);
Or test all files in one or more directories:
use Test::Perl::Metrics::Simple; all_metrics_ok($dir_1, $dir_2, $dir_N);
Or test all files in a distribution:
use Test::Perl::Metrics::Simple; all_metrics_ok();
Recommended usage for CPAN distributions:
use strict;
use warnings;
use File::Spec;
use Test::More;
if(not $ENV{'TEST_AUTHOR'}){
my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.';
plan(skip_all => $msg);
}
eval{require Test::Perl::Metrics::Simple;};
if($@){
my $msg = 'Test::Perl::Metrics::Simple required to criticise code';
plan(skip_all => $msg);
}
Test::Perl::Metrics::Simple->import(-complexity => 30);
all_metrics_ok();
This is VERSION 0.1
Test::Perl::Metrics::Simple is a module that tests Cyclomatic complexity of the code.
The value is set to Test::Perl::Metrics::Simple.
Cyclomatic complexity of the specified file is tested.
Cyclomatic complexity of all the codes that exist in the specified directory is checked.
Seiki Koga <koga@shanon.co.jp>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Test-Perl-Metrics-Simple documentation | view source | Contained in the Test-Perl-Metrics-Simple distribution. |