Skip to content

AvoidUsingHardCodedIP false positive for a version string #1527

@volodya-lombrozo

Description

@volodya-lombrozo

I have the following code:

@Override
public ConditionEvaluationResult evaluateExecutionCondition(final ExtensionContext ctx) {
    final ConditionEvaluationResult result;
    if (new Phino().available("0.0.0.43")) {
        result = ConditionEvaluationResult.enabled("Phino is available");
    } else {
        result = ConditionEvaluationResult.disabled("Phino is not available");
    }
    return result;
}

I get the following error:

[INFO] PMD: src/test/java/org/eolang/hone/DisabledWithoutPhinoCondition.java[15-15]: Do not hard code the IP address '0.0.0.43' (AvoidUsingHardCodedIP)

As you can see, 0.0.0.43 is a version number, not an IP.

Expected behaviour:

qulice doesn't complain on custom strings, even if they look like IP addresses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions