Query module StatementNoEffect

name
Statement has no effect
description
A statement has no effect
kind
problem
tags
maintainability useless-code external/cwe/cwe-561
problem.severity
recommendation
sub-severity
high
precision
high
id
py/ineffectual-statement

Imports

Predicates

assertRaises
in_notebook

Expression (statement) in a jupyter/ipython notebook

in_raises_test

Holds if expression e is in a with block that tests for exceptions being raised.

is_notebook
maybe_side_effecting_attribute
no_effect
side_effecting_attribute
side_effecting_binary

Side effecting binary operators are rare, so we assume they are not side-effecting unless we know otherwise.

side_effecting_descriptor_type
understood_attribute