Avoid Backslash to continue command

Software AgilityCode Readability

Why you should care

With line-oriented text, the backslash is used at the end of a line to indicate that the trailing newline character is to be ignored. In other words, with the backslash, the following line belongs on the same line as the line prior. As in they are both on the same line as a “continuation”.

Unfortunately, this equivalent to adding multiple instructions on the same line which results in causing readability issues and a harder code to understand as well as possible bugs in the code.

Business Impacts

Utilizing backslash can make the code less readable and less understandable when having commands continued on the next line. It adds risk and reduces productivity.

Cost
5362

How we detect

This code insight suggests to avoid utilizing the blackslash in order continue the command on the next line.
5362

About CAST and Highlight’s Code Insights

Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.

See featuresHow it works