Suggested fixes by iCR, OpenRefactory, Inc. #367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OpenRefactory introduces fixers, that automatically fix safety, security, reliability and compliance issues. We ran OpenRefactory's Intelligent Code Repair (iCR) analysis engine on your code. We are reporting a few sample fixes that were generated.
The goal of the this fix is to resolve Zero Division Check, Unexpected Control Flow and Weak Library Usage problem.
Zero Division Check Fixes:
In file:
Duration.java, class:Duration, method:append, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.In file:
CommitLog.java, class:CommitLog, method:getActiveSegmentCompressionRatios, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.In file:
SizeTieredCompactionStrategy.java, class:SizeTieredCompactionStrategy,method:getEstimatedCompactionsByTasks, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.In file:
Upgrader.java, class:Upgrader, method:Upgrader, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.In file:
MajorLeveledCompactionWriter.java, class:MajorLeveledCompactionWriter, method:MajorLeveledCompactionWriter, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.In file:
MaxSSTableSizeWriter.java, class:MaxSSTableSizeWriter, method:MaxSSTableSizeWriter, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.In file:
StorageProxy.java, class:StorageProxy, method:estimateResultsPerRange, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.The fix addresses CWE 369
Unexpected Control Flow Fixes:
In file:
AbstractTypeVersionComparator.java, class:AbstractTypeVersionComparator, method:compareCompositeTypeshas a semicolon at an unusual place . iCR suggested changes in 1 files to resolve the problem.Weak Library Usage Fixes:
In file:
UUIDGen.java, class:UUIDGen, method:hashuses Random object but it may not be truly random. It should be replaced with SecureRandom. . iCR suggested changes in 1 files to resolve the problem.