Skip to content

Commit

Permalink
Hide fixable issues when running with taint analysis
Browse files Browse the repository at this point in the history
Fixes #3722
  • Loading branch information
muglug committed Jul 1, 2020
1 parent 17558a5 commit cceacde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Psalm/IssueBuffer.php
Expand Up @@ -222,7 +222,7 @@ public static function add(CodeIssue $e, bool $is_fixable = false)
$emitted_key = $issue_type . '-' . $e->getShortLocation() . ':' . $e->getLocation()->getColumn();

if ($reporting_level === Config::REPORT_INFO) {
if (!self::alreadyEmitted($emitted_key)) {
if ($issue_type === 'TaintedInput' || !self::alreadyEmitted($emitted_key)) {
self::$issues_data[$e->getFilePath()][] = $e->toIssueData(Config::REPORT_INFO);
}

Expand All @@ -244,7 +244,7 @@ public static function add(CodeIssue $e, bool $is_fixable = false)
);
}

if (!self::alreadyEmitted($emitted_key)) {
if ($issue_type === 'TaintedInput' || !self::alreadyEmitted($emitted_key)) {
++self::$error_count;
self::$issues_data[$e->getFilePath()][] = $e->toIssueData(Config::REPORT_ERROR);
}
Expand Down Expand Up @@ -599,7 +599,7 @@ function (IssueData $d1, IssueData $d2) : int {
}
}

if (self::$fixable_issue_counts && $show_suggestions) {
if (self::$fixable_issue_counts && $show_suggestions && !$codebase->taint) {
echo str_repeat('-', 30) . "\n";

$total_count = \array_sum(self::$fixable_issue_counts);
Expand Down

0 comments on commit cceacde

Please sign in to comment.