Groovy Documentation

groovy.org.codenarc.rule.security
[Groovy] Class InsecureRandomRule

java.lang.Object
  org.codenarc.rule.AbstractAstVisitorRule
      groovy.org.codenarc.rule.security.InsecureRandomRule

class InsecureRandomRule
extends AbstractAstVisitorRule

Reports usages of java.util.Random, which can produce very predictable results. If two instances of Random are created with the same seed and sequence of method calls, they will generate the exact same results. Use java.security.SecureRandom instead, which provides a cryptographically strong random number generator. SecureRandom uses PRNG, which means they are using a deterministic algorithm to produce a pseudo-random number from a true random seed. SecureRandom produces non-deterministic output. By default, this rule does not apply to test files.

Authors:
Hamlet D'Arcy


Property Summary
Class astVisitorClass

String doNotApplyToFilesMatching

String name

int priority

 

Property Detail

astVisitorClass

Class astVisitorClass


doNotApplyToFilesMatching

String doNotApplyToFilesMatching


name

String name


priority

int priority


 

Groovy Documentation