May the source be with you,
but remember the KISS principle ;-)
Key Softpanorama Topics
|About||Contents||Top Updates||Top Visited|
|Bulletin||Selected Papers||Softpanorama Bookshelf||History|
|News||Books||Recommended Links||Tutorials||Programming Abilities||Etc|
Perl Metrics This program is intended to help perl programmers write better code by becoming more aware of their coding style. In particular, one would like to know the code-to-comment ratio, the average number of lines per subroutine, the longest subroutine, and things like that.
I am now a software tools engineer at Transmeta . When I was doing enginering management at Brightmail , we had a lot of Perl code in-house and I wanted to get a grip on its quality. I wrote this as a quick hack to improve said quality by measuring some of the more obvious features of the code. This is my first pass at measuring some of the things that make software readable and maintainable.
Sample Output===> perl-metrics.pl <=== code_with_comment 2 subroutine_lines 115 blank_lines 52 subroutines 6 comment_lines 37 pure_code 106 total_lines 197 DANGER --> 82 non-subroutine lines code-to-comment ratio 2.7 avg lines per subroutine 16.7 longest subroutine: count_things (53 lines) Share and enjoy!
M Squared Technologies - Resource Standard Software Source Code Metrics For C, C++ and Java
Libre Software Engineering - Tools - Other
Metrics collection tools for C and C++ Source CodeThis page offers access to a collection of static code analysis tools that compute various metrics defined on C and C++ source code. The metrics are primarily size and complexity of various types (lines of code, Halstead, McCabe, etc.).
You will need a C or C++ compiler to build most of these tools. For tools that use shell or perl scripts, you will need the appropriate interpreter to run them; these interpreters are on all unix systems.
The source files for each tool are available here. The files have been packed into Unix-style tar files, which in turn have been compressed with the GNU utility gzip.
PC users must have long file names (i.e., a win32 system) to unpack them. Note that the GNU utilities are available for the PC, and include both gunzip (uncompressing utility) and tar (unpacking utility).
The tools, in alphabetical order, are the following:
About building and using the tools:
I sucessfully built all of them using gcc/g++ on a sun running SunOS 4.1.3. The authors of packages `c_count', `csize', `metre', and sloccount went to considerable trouble to write portable code and flexible Makefiles.
The `hp_mas' package also includes well-documented Makefiles.
For `cyclo' and `metrics', no such effort was made, and consequently I had to monkey with some makefiles. Packages `ccount', `clc', `lc', and `spr' are relatively simple and should not present many problems.
I have not used all of the tools extensively, so unfortunately I can't make any helpful statements about reliability or ease of use.
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : C++ Humor : ARE YOU A BBS ADDICT? : Object oriented programmers of all nations : C Humor : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor: Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : The Most Comprehensive Collection of Editor-related Humor : Microsoft plans to buy Catholic Church : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor : Best Russian Programmer Humor : Russian Musical Humor : The Perl Purity Test : Politically Incorrect Humor : GPL-related Humor : OFM Humor : IDS Humor : Real Programmers Humor : Scripting Humor : Web Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor :
The Last but not Least
|You can use PayPal to make a contribution, supporting hosting of this site with different providers to distribute and speed up access. Currently there are two functional mirrors: softpanorama.info (the fastest) and softpanorama.net.|
The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.
Last modified: July, 07, 2013