ARCAD Debuts RPG Code Checker
October 3, 2018 Alex Woodie
If you write RPG, or know somebody who does, then you realize that mistakes can and will happen. However, beyond the obvious syntax errors, which should be detected immediately by the code editor, are instances where the code is sloppy or just poorly written. Those are the instances where ARCAD Software hopes to help with its new CodeChecker offering.
ARCAD-CodeChecker, as the product is officially called, does just that: Detect poor quality RPG code before it makes it into production. If you’ve coded a bug into the program, made a design error, or taken 1,000 lines to write something that should have taken just 10 lines, it may not be automatically flagged by the code editor, but it’s something that ARCAD Software says can detected with CodeChecker.
ARCAD says the new offering will use a variety of metrics to measure the quality of free-form RPG (other languages will come later). It does this, ARCAD says, by using techniques such as cyclomatic complexity which is a testing regimen devised in 1976 by Thomas McCabe Sr. to detect the linear path that each independent chunk of code takes through a program, against a backdrop of a generic control flow graph.
Another technique used to spot bad code is to calculate the percentage of comment lines that are in the code, which could be an indication of unneeded complexity. The vendor says users can add or create other rules and metrics to detect bad code as needed, and it can all be integrated with a developer operations tool, like ARCAD’s DevOps suite, to ensure the code checks are run on a consistent basis.
If the code is good, then the CodeChecker will log an “OK” flag. However, if there are problems with the code, then CodeChecker will use one of three flags: notice, warning, and fatal, ARCAD tells IT Jungle. (Editor’s note: You definitely don’t want to be the RPG code-slinger known for writing “fatal” flaws.)
It’s all about utilizing DevOps processes to get cleaner code, according to Michel Mouchon, ARCAD CTO. “DevOps is all about delivering small code increments more frequently, to shorten the user feedback loop, and detect errors as early as possible in the cycle,” he in a press release. “The rule is to ‘shift left’: the earlier a software error is detected, the lower the cost of the error.”
The focus on early detection applies not just to bugs and design errors, but also to general quality defects, Mouchon. “It explains why we attempt to automate all tasks after coding through to deployment, including continuous regression test,” he continues. “With ARCAD-CodeChecker, we are going one step further by automatically detecting poor quality code before it is even submitted for peer review.”
CodeChecker is part of ARCAD’s DevOps Suite, and only supports IBM i languages at the moment. Eventually, it will support RPG IV (non free-form), as well as Control Language (CL) and Structured Query Language (SQL) for IBM i. The product will maintain repositories and libraries to track the data quality rules set up by the user, ARCAD says.
Like most ARCAD products, CodeChecker can be plugged into Rational Developer for IBM i (RDi) so it can be accessed by developers without leaving their favorite integrated development environment (IDE). CodeChecker also works with version control systems, such as Jenkins, to automatically check the quality of code before the build phase begins. The software also integrates with standard Git repositories, such as GitHub, GitLab and BitBucket, which ARCAD says can increase the efficiency of the ‘pull request’ or ‘merge request.’
“This way,” the company says, “automated code quality checking becomes part of the standard workflow. Using ARCAD-CodeChecker, developers reduce time spent in a peer review by one-third on average. Poor quality code is rejected even before a ‘commit’ operation.”
While there’s nothing new about bad code, today’s fast-paced DevOps environment has the potential to magnify the problems posed by bad code. By nipping any problems in the bud at the code intervals defined by DevOps, IBM i shops can keep their development projects on track, according to Mouchon.
“Careless coding increases the risk of side-effects that cause costly downtime in production,” he states. “By detecting poor quality code before it even reaches the build stage, we prevent the escalation of ‘technical debt’. Automated quality control this early in the development cycle actually secures application availability and reduces IT costs overall. This is why we see ARCAD-CodeChecker as a strategic piece of any DevOps implementation on IBM i.”