Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/DivideByZero.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// https://sig-product-docs.synopsys.com/bundle/coverity-docs/page/checker-ref/checkers/D/divide_by_zero.html

class DivideByZero {
void testDiv(int a, int b)
{
if (a!=0) {
//Do something
}
int y = b / a;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR Comment From coverity

Coverity Issue - Division or modulo by zero

Medium CWE-369
In expression "b / a", division by expression "a" which may be zero results in an exception.

The program will raise an exception.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR Comment From coverity

Coverity Issue - DLS: Dead local store

Low CWE-563
Dead store to y.

}
}
Loading