Rule Definition
Built-in remote addresses cause problems when the target is moved. Avoid hardcoded network resources (e.g., IP addresses, URLs, etc.)
Remediation
It is recommended to make resources configurable.
Violation Code Sample
a = '127.0.0.1'
//Or
a = 'fe80:0000:0000:0000:0204:61ff:fe9d:f156/0'
Fixed Code Sample
const config = {
host: process.env.HOST,
post: process.env.PORT
}
Reference
ASCRM 1.0, Automated Source Code Reliability Measure, Object Management Group.
Related Technologies
Technical Criterion
CWE-1051 - Initialization with Hard-Coded Network Resource Configuration Data
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.