Programming Tools: Code Complexity Metrics
A number of commercial tools are out there, as well as some open-source ones. None seem to give you the ability to define your own metrics, however, or to use extended versions of existing metrics. Also, of the open-source tools I found, most were outdated or no longer maintained. The one exception is the Eclipse Metrics Plugin.
For the rest of us, I decided to write an open-source program to produce metrics that end users can compute and modify. The program is written in Python and currently is limited to analyzing Python--thus the name PyMetrics--but the principles can be extended to any language. By writing the code in Python, you should be able to understand the program better than if I had written it in almost any other language. The major advantage of this approach is the output format. It lets you work with the raw numbers to produce your own reports and metrics.
The PyMetrics project is hosted on SourceForge.net, and the files can be downloaded from the project page. Please note that due to the short time I had to produce the program, it is not as polished as I would have liked. The things I would have liked to do include but are not limited to:
Showing what are considered industry standard metric values as a point of comparison for your metrics.
Simplifying some of the modules, including tokenize and the main module, PyMetrics.
Providing better modularization to allow others to extend this program more easily.
Defining a set of test suites.
As always, offering better documentation.
Metrics are numbers representing the complexity of a given program. Although some accepted standard measures exist, you need to decide what works for you and the acceptable thresholds.
Getting Started with DevOps - Including New Data on IT Performance from Puppet Labs 2015 State of DevOps Report
August 27, 2015
12:00 PM CDT
DevOps represents a profound change from the way most IT departments have traditionally worked: from siloed teams and high-anxiety releases to everyone collaborating on uneventful and more frequent releases of higher-quality code. It doesn't matter how large or small an organization is, or even whether it's historically slow moving or risk averse — there are ways to adopt DevOps sanely, and get measurable results in just weeks.
Free to Linux Journal readers.Register Now!
|Secure Server Deployments in Hostile Territory, Part II||Jul 29, 2015|
|Hacking a Safe with Bash||Jul 28, 2015|
|KDE Reveals Plasma Mobile||Jul 28, 2015|
|Huge Package Overhaul for Debian and Ubuntu||Jul 23, 2015|
|diff -u: What's New in Kernel Development||Jul 22, 2015|
|Shashlik - a Tasty New Android Simulator||Jul 21, 2015|
- Secure Server Deployments in Hostile Territory, Part II
- Hacking a Safe with Bash
- Huge Package Overhaul for Debian and Ubuntu
- KDE Reveals Plasma Mobile
- The Controversy Behind Canonical's Intellectual Property Policy
- Home Automation with Raspberry Pi
- Shashlik - a Tasty New Android Simulator
- Embed Linux in Monitoring and Control Systems
- diff -u: What's New in Kernel Development
- General Relativity in Python