Query module InconsistentCallOnResult

name
Inconsistent operation on return value
description
If the same operation is usually performed on the result of a method call, any cases where it is not performed may indicate resource leaks or other problems.
kind
problem
problem.severity
warning
precision
low
id
java/inconsistent-call-on-result
tags
reliability correctness external/cwe/cwe-252 statistical non-attributable

Imports

Chaining
java

Provides all default Java QL imports.

Predicates

checkExpr

The method access otherCall - is described by operation, - operates on v, - is different from callToCheck, and - is not a call to an excluded method.

checkedFunctionCall

The result of ma and a call to a method named operation are both assigned to the same variable.

exclude
functionStats
getChainedAccess

Get all accesses to a variable, either directly or by a chain of method calls.

implicitCheckExpr

Holds if operation is implicitly called on v, and v is assigned the result of callToCheck.

okToIgnore
relevantFunctionCall

The method access ma is a call to m where the result is assigned.