Apply in-source suppressions through an issue's related locations
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 18/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 15
- Fork
- 12
- Merge medio
- 2g 10h
- PR unite (30g)
- 17
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ballerina-platform/static-code-analysis-tool
-
Area/Reports Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ballerina-platform/static-code-analysis-tool#152 ·
I maintainer di solito rispondono entro 1 giorno
-
Area/CLI Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ballerina-platform/static-code-analysis-tool#140 ·
I maintainer di solito rispondono entro 1 giorno
-
Support `bal scan --version`ApertaArea/CLI Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ballerina-platform/static-code-analysis-tool#139 ·
I maintainer di solito rispondono entro 1 giorno
-
Ballerina Scan Tool v0.11.1 Release ReadinessForse già presa @CharanaManawathilake l’ha presa 2 giorni fa. ApertaType/Task
ballerina-platform/static-code-analysis-tool#159 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Area/Core Type/New Feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ballerina-platform/static-code-analysis-tool#154 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ballerina-platform/static-code-analysis-tool
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
NationalSecurityAgency/ghidra#10149 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
yegor256/antlr2ebnf-maven-plugin#155 ·
I maintainer di solito rispondono entro 1 giorno
-
account bug exercise lecture programming user interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ls1intum/Artemis#14512 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
kind:bug priority:major
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
swiftlang/swift-java#955 ·
I maintainer di solito rispondono entro 1 giorno