void (final @NotNull PyExpressionStatement node) { if (ContainerUtil.exists(PyInspectionExtension.EP_NAME.getExtensionList(), extension -> extension.ignoreNoEffectStatement(node))) { return; } final PyExpression expression = node.getExpression(); if (PsiTreeUtil.hasErrorElements(expression)) return; if (hasEffect(expression)) return; // https://twitter.com/gvanrossum/status/112670605505077248 if (expression instanceof PyStringLiteralExpression) { return; } final PyTryPart tryPart = PsiTreeUtil.getParentOfType(node, PyTryPart.class); if (tryPart != null) { final PyStatementList statementList = tryPart.getStatementList(); if (statementList.getStatements().length == 1 && statementList.getStatements()[0] == node) { return; } } List<LocalQuickFix> quickFixes = new SmartList<>(getQuickFixesFromExtensions(node)); if (!(expression instanceof PyReferenceExpression reference) || reference.isQualified()) { quickFixes.add(new StatementEffectIntroduceVariableQuickFix()); } registerProblem(expression, PyPsiBundle.message("INSP.statement.effect.statement.seems.to.have.no.effect"), quickFixes.toArray(LocalQuickFix.EMPTY_ARRAY)); }