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.
Manually performing an object existence check is inefficient when a built-in operation is available.
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.
This code uses deprecated methods, which suggests that it has not been recently reviewed or maintained.
Use S3Objects.withPrefix()
instead of manually paginating results.
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.
Enable long polling for efficiency.
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.
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.
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.
Sudden service shutdown might prevent a graceful termination of threads.
Set an explicit AWS Region to avoid cold start delays in AWS client initialization.
Performance of this code can be enhanced by using alternative APIs.
Code uses older Android features.
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.
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.
Classes with low class cohesion contain unrelated operations which make them difficult to understand and less likely to be used.
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.
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
.
Not checking which items have failed can lead to loss of data.