Missing spaces can increase costs
- following operators are not surrounder with at least one space: =, += , -=, == , < , > , != , <> , <= , >= , in , not in , is , is not, and , or , not.
- following elements are not followed by at least one space : comma, semicolon, colon (except slice operator)
Why you should care
- Always surround these binary operators with a single space on either side: assignment ( = ), augmented assignment ( += , -= etc.), comparisons ( == , < , > , != , <> , <= , >= , in , not in , is , is not ), Booleans ( and , or , not ).
Additional for Highlight :
- Always put a whitespace immediately after :
- colon (except when using as slice operator)
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.