Apply in-source suppressions through an issue's related locations
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with the suppression engine's matching logic, which currently checks only the issue's own location against the annotated construct, and with SecretChecker, which reports ballerina:13 and ballerina:14. The work depends on #154 adding related locations to issues, and the spec proposal in ballerina-spec#1496 needs updating first. Done means a @scan:Suppress on a declaration matches issues at its related locations, while the innermost-construct rule, unmatched diagnostics and requireReason/requireRuleId behave as before.
索引モデルが issue の本文から書いたものです。
説明
Problem
@scan:Suppress only matches a finding whose own location is inside the annotated construct. ballerina:13 and ballerina:14 report a value where it is used, not where it is declared, so a suppression on the declaration is reported as unmatched and the findings stay:
@scan:Suppress {rules: ["ballerina:14"], reason: "Fixed test fixture value"}
string fixture = "fixed-secret"; // warning: suppression of 'ballerina:14' did not match any issue
connect(password = fixture); // ballerina:14 is still reported here
login(secret = fixture); // and here
The same happens for a configurable's literal default, which is reported as ballerina:13 at every use:
@scan:Suppress {rules: ["ballerina:13"], reason: "Local development default"}
configurable string dbConfig = "fallback-secret";
connect(password = dbConfig); // still reported
Users have to suppress each use separately, even though the value has only one place where it can be fixed.
Proposed Solution
Apply a suppression to an issue when the annotated construct covers either:
- the issue's location, as today; or
- any of the issue's related locations, which #154 adds for
ballerina:13andballerina:14.
@scan:Suppress {rules: ["ballerina:14"], reason: "Fixed test fixture value"}
string fixture = "fixed-secret";
connect(password = fixture); // suppressed through the related location
What stays the same: the innermost-construct rule, the unmatched-suppression diagnostics, and requireReason / requireRuleId. An annotation on a declaration that suppresses uses elsewhere counts as matched, and the suppressed issues appear in the JSON and SARIF reports as they do today.
Dependencies
- #154: this issue needs the related locations that #154 adds to issues.
- Spec: in-source suppression was specified in ballerina-platform/ballerina-spec#1496 as applying to issues "within the construct it is attached to". Applying it through related locations extends that, so the proposal needs updating before this is implemented.
Alternatives
- Suppress inside the secret rules: have
SecretCheckerlook for@scan:Suppresson the declarations it traces through. This duplicates the suppression engine's matching, diagnostics and report entries, and only these two rules would get it. - Keep the current behavior and document it: suppress at each use site.
Version
0.13.0
- 主要言語
- Java
- スター
- 15
- フォーク
- 12
- 平均マージ
- 2日 19時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ballerina-platform/static-code-analysis-tool のほかの issue
-
Platform plugin output is written to standard output and breaks redirected JSON/SARIF results対応中かも @TharmiganK が 1 日前に担当しました。 オープンArea/CLI Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ballerina-platform/static-code-analysis-tool#167 ·
メンテナーはふだん 1 日以内に返信
-
Module file paths in the JSON report are only file names対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンArea/Reports Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ballerina-platform/static-code-analysis-tool#152 ·
メンテナーはふだん 1 日以内に返信
-
Area/CLI Type/Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ballerina-platform/static-code-analysis-tool#140 ·
メンテナーはふだん 1 日以内に返信
-
Area/Rules Type/Bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
ballerina-platform/static-code-analysis-tool#179 ·
メンテナーはふだん 1 日以内に返信
-
ballerina:13 reports boolean strings, auth scheme names and qualified secret names対応中かも @TharmiganK が 1 日前に担当しました。 オープンArea/Rules Type/Bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
ballerina-platform/static-code-analysis-tool#178 ·
メンテナーはふだん 1 日以内に返信
ballerina-platform/static-code-analysis-tool の issue をすべて見る
似ている issue
-
account bug communication lecture
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
line/centraldogma#1397 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
cryptomator/hub#515 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vert-x3/vertx-mail-client#268 ·
-
desktop edt not responding
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100