Tag: maintainability

Mandatory method not called after object creation

Mandatory methods must be called after object creation.

AWS object presence check

Manually performing an object existence check is inefficient when a built-in operation is available.

Missing timeout check on ExecutorService.awaitTermination

Missing timeout checks on awaitTermination might make the code harder to debug.

Inefficient usage of Transaction library from AWS Labs

The AWS Labs Transactions Library is a client-side solution and less efficient compared to DynamoDB native transactions.

Use of a deprecated method

This code uses deprecated methods, which suggests that it has not been recently reviewed or maintained.

Error-prone AWS IAM policy creation

Manually creating text-based IAM policies is error-prone.

Missing statement to record cause of InvocationTargetException

Missing statements to record the underlying cause of InvocationTargetException.

Misconfigured Concurrency

Misconfigured CompletableFuture.get or Future.get.

Do not catch and throw exception

Do not catch and throw the same exception.

Override of reserved variable names in a Lambda function

Overriding environment variables that are reserved by AWS Lambda might lead to unexpected behavior.

Not calling finalize causes skipped cleanup steps

Always call super.finalize explicitly.

Backward compatibility breaks with error message parsing

Maintain your code's backward compatibility by checking the status code instead of parsing the error message.

Use an enum to specify an AWS Region

To minimize the risk of error, use an enum instead of a string to specify an AWS Region.

Improperly formatted string arguments

Format strings appropriately for their argument types. For example, use %d, not %s, for integers.

Improper service shutdown

Sudden service shutdown might prevent a graceful termination of threads.

Stack trace not included in re-thrown exception

When re-throwing an exception, make sure to include the stack trace.

Null pointer dereference

Dereferencing a null pointer can lead to unexpected null pointer exceptions.

Low maintainability with old Android features

Code uses older Android features.

Missing handling of specifically-thrown exceptions

Catching generic exceptions might hide issues when specific exceptions are thrown.

Syntax error in file

Some files contain syntax errors.

Client constructor deprecation

Client constructors are now deprecated in favor of using builders to create the client.

Simplifiable code

Simplifiable code might be harder to read or maintain.

Code clone

Similar code fragments were detected in the same file.

Missing check on method output

Missing checks might cause silent failures that are harder to debug.

Low maintainability with low class cohesion

Classes with low class cohesion contain unrelated operations which make them difficult to understand and less likely to be used.

Infinite loop

Use loop control flow to ensure that loops are exited, even if exceptional behaviors are encountered.

State machine execution ARN is not logged

Log the ARN identifying the state machine execution for better debuggability.

Use Stream::anyMatch instead of Stream::findFirst or Stream::findAny

Using Stream::anyMatch is more readable and convenient than using a chain of Stream::filter, Stream::findFirst or Stream::findAny and Optional::isPresent.