Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.541.709 Times

Perl::Metric::Basic 0.31

  Date Added: September 13, 2010  |  Visits: 688

Perl::Metric::Basic

Report Broken Link
Printer Friendly Version


Product Homepage
Download (73 downloads)



Perl::Metric::Basic is a Perl module that can provide basic software metrics. SYNOPSIS # first construct a PPI::Document object to pass in my $document = PPI::Document->load("t/lib/Acme.pm"); # then retrieve metrics on the document my $m = Perl::Metric::Basic->new; my $metric = $m->measure($document); # $metric will consist of something like: # Acme => { # new => { # blank_lines => 1, # comments => 1, # lines => 7, # lines_of_code => 6, # numbers => 0, # numbers_unique => 0, # operators => 3, # operators_unique => 2, # symbols => 5, # symbols_unique => 2, # words => 7, # words_unique => 6 # }, # ... When constructing software one often produces code of vastly differing quality. The Perl::Metric::Basic module leverages the PPI module to provide some interesting software metrics for Perl code, mostly measuring size and maintainability. A metric is some sort of measurement which is intended to help you make a decision about a piece of code. There arent any hard rules about metrics, but the ones provided should allow you to make decisions about modules or subroutines which are outliers. Abnormal measurements in a subroutine are a warning sign that you should reexamine that routine, checking for unusually low quality. This module uses the PPI module, and thus can parse Perl code without evaluating it. If youre interested in software metrics, I highly recommend "Code Complete" (Second Edition) by Steve McConnel (Microsoft Press). METHODS new() The new() method is the constructor: my $m = Perl::Metric::Basic->new; measure() The measure() method measures some metrics and returns a hash reference. Files in Perl can contain more than one package, and it is interesting to seperate metrics by package. The key for the hash reference is the name of the package, and the value is another hash reference. Perl packages are seperated into subroutines, and it is interesting to seperate metrics by subroutine. The key for the second hash reference is the name of the subroutine, and the value is another hash reference containing metrics. There are various metrics applied to the subroutine. The key for the third hash reference is the name of the metric, and the value is the value of the metric. The metrics are: blank_lines The number of blank code lines. comments The number of lines containing comments. lines The total number of lines. lines_of_code The number of lines of code. numbers The total number of numbers used (eg "$z = 42 * 3" would have 2 numbers). numbers_unique The number of unique numbers used (eg "$z = 2*$x + 2*$y" would have 1 unique number). operators The total number of operators used. operators_unique The number of unique operators used. symbols The total number of symbols used (eg "$z = $x*$x + $y*$y" would have 5 symbols). symbols_unique The number of unique symbols used (eg "$z = $x*$x + $y*$y" would have 3 unique symbols). words The total number of words (operators) used. words_unique The number of unique words used..

Requirements: No special requirements
Platforms: Linux
Keyword: Code Libraries Lines Metrics Number Perl Module Perlmetricbasic Ppi Programming Symbols Unique
Users rating: 0/10

License: Freeware Size: 5.12 KB
USER REVIEWS
More Reviews or Write Review


PERL::METRIC::BASIC RELATED
Libraries  -  Acme::EyeDrops 1.51
Acme::EyeDrops is a Perl module for visual programming in Perl. SYNOPSIS use Acme::EyeDrops qw(sightly); print sightly( { Shape => camel, SourceFile => eyesore.pl } ); Acme::EyeDrops converts a Perl program into an equivalent one, but...
102.4 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  Lingua::ID::Nums2Words 0.01
Lingua::ID::Nums2Words is a Perl module to convert number to Indonesian verbage. SYNOPSIS use Lingua::ID::Nums2Words ; print nums2words(123) ; # "seratus dua puluh tiga" print nums2words_simple(123) ; # "satu dua tiga" nums2words...
3.07 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Libraries  -  Myco::Devel 1.22
Myco::Devel is a Perl module for myco Developers Guide. This guide is intended for developers wanting to build applications with myco. You should have a decent grasp of the Perl programming language, or else a solid grasp of another programming...
102.4 KB  
Libraries  -  Number::Bytes::Human 0.07
Number::Bytes::Human is a Perl module that can convert byte count to human readable format. SYNOPSIS use Number::Bytes::Human qw(format_bytes); $size = format_bytes(0); # 0 $size = format_bytes(2*1024); # 2.0K $size =...
9.22 KB  
Libraries  -  Code::Perl 0.03
Code::Perl is a Perl module to produce Perl code from a tree. SYNOPSIS use Code::Perl::Expr qw( :easy ); my $c = derefh(scal(hash), calls(getkey)); print $c->perl; # ($hash)->{getkey()} Code::Perl allows you to build chunks of Perl code...
17.41 KB  
Libraries  -  Number::WithError 0.08
Number::WithError is a Perl module that contains numbers with error propagation and scientific rounding. SYNOPSIS use Number::WithError; my $num = Number::WithError->new(5.647, 0.31); print $num . "n"; # prints 5.65e+00 +/- 3.1e-01 #...
27.65 KB  
Libraries  -  Module::Crypt 0.04
Module::Crypt is a Perl module to encrypt your Perl code and compile it into XS. SYNOPSIS use Module::Crypt; # for a single file: CryptModule( file => Bar.pm, install_base => /path/to/my/lib ); # for multiple files: CryptModule(...
7.17 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB