Query module ReturnValueIgnored

name
Method result ignored
description
If most of the calls to a method use the return value of that method, the calls that do not check the return value may be mistakes.
kind
problem
problem.severity
warning
precision
low
id
java/return-value-ignored
tags
reliability correctness external/cwe/cwe-252 statistical non-attributable

Imports

Chaining
java

Provides all default Java QL imports.

Predicates

chainedUses
checkedMethodCall
isCardinalityClauseMethod
isMockingMethod

Checks if a method is a used for setting up / verifying mocks. These are not usually “real” method calls, and so are not interesting for the purposes of this query.

isMustBeQualifierMockingMethod

Some mocking methods must always be used as a qualifier.

isReceiverClauseMethod
isStubberMethod
methodStats
relevantMethodCall