Search in sources :

Example 1 with LiteralLike

use of org.sonar.uast.helpers.LiteralLike in project sonar-go by SonarSource.

the class NoHardcodedCredentialsCheck method visitNode.

@Override
public void visitNode(UastNode node) {
    AssignmentLike assignment = AssignmentLike.from(node);
    if (assignment != null) {
        LiteralLike assignmentValue = LiteralLike.from(assignment.value());
        if (assignmentValue != null && !removeQuotes(assignmentValue.value()).isEmpty()) {
            testPattern(assignment.target(), targetPattern);
            testPattern(assignment.value(), valuePattern);
        }
    }
}
Also used : AssignmentLike(org.sonar.uast.helpers.AssignmentLike) LiteralLike(org.sonar.uast.helpers.LiteralLike)

Aggregations

AssignmentLike (org.sonar.uast.helpers.AssignmentLike)1 LiteralLike (org.sonar.uast.helpers.LiteralLike)1