Code Quality detectors
Mandatory methods must be called after object creation.
Setting withCallProcessRecordsEvenForEmptyRecordList to TRUE during Kinesis Client Library (KCL) initialization will treat empty records differently.
Use setRegion and setEndpoint methods to make calls to Regional Amazon STS endpoints.
Manually performing an object existence check is inefficient when a built-in operation is available.
Checks if the catch block handles a broad swath of exceptions.
Missing timeout check on CountDownLatch.await can cause synchronization errors.
Preserve Thread Interruption Status Rule.
Missing timeout checks on awaitTermination might make the code harder to debug.
Custom manual retries of calls to AWS SDK APIs are inefficient.
Accessing the cache response metadata without performing a null check might cause a null dereference error.
The AWS Labs Transactions Library is a client-side solution and less efficient compared to DynamoDB native transactions.
Throwing too many exceptions can cause performance issues.
This code uses deprecated methods, which suggests that it has not been recently reviewed or maintained.
Use S3Objects.withPrefix() instead of manually paginating results.
Rule to detect bit shifting.
Missing statements to record the underlying cause of InvocationTargetException.
Misconfigured CompletableFuture.get or Future.get.
Custom polling can be inefficient and prone to error. Consider using AWS waiters instead.
Neglecting to close opened resources in the finally block in Java violates resource management principles, risking resource leaks and performance issues.
Enable long polling for efficiency.
Objects that parse or handle XML in XML document can lead to XML External Entity (XXE) attacks when misconfigured.
When using AWS AccountId it is advisable to use String datatype instead of numeric types to avoid leading zero truncation.
Do not catch and throw the same exception.
Find usages of not recommended classes for AWS Credentials and suggest replacing them with something else.
Specify the length of the input byte array when creating a JSON parser to avoid a deserialization problem.
Prefer RegionUtils over Regions and S3Regions enums for easy support of new AWS regions.
Recommends type-casting the exception into unchecked exception and throwing it.
Getting a substring outside the range of a string can cause an index-out-of-bounds exception.
Maintain your code's backward compatibility by checking the status code instead of parsing the error message.
Iterating on Map entries is more efficient than iterating on the keys and asking for their respective values.
Outputs of AWS DynamoDB's GetItem method are not null checked.
Detects the usage of multiple date time pattern.
Synchronous publication of AWS Lambda metrics is inefficient.
Improper use of thread-unsafe classes in multi-threaded programs can cause the programs to be unstable.
When a variable is assigned a value after checking if it's not null (for example, x != null insead of x == null), it might be inadvertently overwritten.
Check and suggest to catch all uncaught AWS API exceptions.
Provide the full URL for the Amazon SQS queue.
To minimize the risk of error, use an enum instead of a string to specify an AWS Region.
Format strings appropriately for their argument types. For example, use %d, not %s, for integers.
Writing throw keyword in finally block disrupts logical execution of code, instead write it under catch block.
Compile regex pattern only once and reuse for all iterations when processing loops or streams.
Missing null check when retrieving the owner of an Amazon S3 object can result in a null dereference error.
Set an explicit AWS Region to avoid cold start delays in AWS client initialization.
Invoking String comparison method with null String can lead to NullPointerException.
Performance of this code can be enhanced by using alternative APIs.
Code uses older Android features.
Using queryPage followed by getResults to retrieve a single page of results is inefficient.
The API hasItems returns true if the service returned a value for the Items property.
A Varargs position error was detected
Use withHashKeyValues to set one or more hash key values of a DynamoDB query
Some files contain syntax errors.
Client constructors are now deprecated in favor of using builders to create the client.
Using Stream::min or Stream::max is more efficient than sorting and getting the first element in a stream.
Simplifiable code might be harder to read or maintain.
use GetKeys API of DynamodbStreamRecord directly
Suggest using auto-pagination instead of manual pagination.
Use equals(), not ==, when checking if two strings are equal.
The chain of API calls can be replaced with a single, more efficient API call.
Improper use of locals prevent internationalization.
Similar code fragments were detected in the same file.
Missing checks might cause silent failures that are harder to debug.
The API GetRecordsRequest.withLimit(limit) returns the number of records that is specified by the limit parameter.
Classes with low class cohesion contain unrelated operations which make them difficult to understand and less likely to be used.
Json object refactoring rule.
Oversynchronization with ConcurrentHashMap or ConcurrentLinkedQueue can reduce program performance.
Use loop control flow to ensure that loops are exited, even if exceptional behaviors are encountered.
Batch operations are more efficient than looping to process several items at the same time.
A missing null check might cause a null dereference error.
When you change Amazon SQS message visibility, check for MessageNotInFlight exceptions.
Log the ARN identifying the state machine execution for better debuggability.
Using Stream::anyMatch is more readable and convenient than using a chain of Stream::filter, Stream::findFirst or Stream::findAny and Optional::isPresent.
Terminate case statements in a switch block properly.
Not checking which items have failed can lead to loss of data.
An improper buffer read operation might lead to a BufferUnderflowException.