Method verifyKeystoreContent
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private static void verifyKeystoreContent(final KeyStore keystore) throws KeystoreException {
try {
int numberOfCertificates = 0;
final Enumeration<String> aliases = keystore.aliases();
while (aliases.hasMoreElements()) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method verifyKeystoreContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void verifyKeystoreContent(final KeyStore keystore) throws KeystoreException {
try {
int numberOfCertificates = 0;
final Enumeration<String> aliases = keystore.aliases();
while (aliases.hasMoreElements()) {
Method validateKeystoreParameter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static void validateKeystoreParameter(Object keystore) throws InvalidKeystoreReferenceException {
if (keystore == null) {
throw new InvalidKeystoreReferenceException((Object) null);
}
if (keystore instanceof KeyStore) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method wrapKeystoreException
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static KeystoreException wrapKeystoreException(final Exception e) {
if (e != null) {
final String msg = e.toString();
if (msg.contains("javax.crypto.BadPaddingException")) {
return new InvalidKeystorePasswordException();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method streamKeystore
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static InputStream streamKeystore(final Object keystore) throws InvalidKeystoreReferenceException {
validateKeystoreParameter(keystore);
try {
if (keystore instanceof InputStream) {
return (InputStream) keystore;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return new WrappedKeystore((KeyStore) keystore);
Avoid too many return
statements within this method. Open
return (InputStream) keystore;