Naming convention for scan rule constants in library packages
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Read the suggested convention options in the issue and check Ballerina's annotation rules for whether a constant mapping can be accessed in an annotation. Compare the namespace, completion, documentation, and import tradeoffs for each option; the issue is done when a convention is agreed on for rule constants across library packages.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Current Limitation
-
A
@scan:Suppressannotation names rules by ID, such asballerina:2orballerina/http:1, which does not say what is suppressed. -
ballerina/scanis adding a constant for each core rule, named after the finding it suppresses, so the annotation reads as what is suppressed and why:@scan:Suppress {rules: [scan:UNUSED_FUNCTION_PARAMETER], reason: "Required by the listener interface"} -
Packages that provide scan rules through an analyzer, such as the standard libraries, should provide constants for their rules too. Unlike
ballerina/scan, whose API is only about scanning, a library's rule constants share its namespace with the rest of its API. Without a convention:- a rule constant can clash with, or be mistaken for, an existing API constant of the library;
- completion and the API docs mix rule constants with the API;
- each library names them differently.
-
A plain prefix such as
SCAN_solves those, but breaks the finding-based reading:http:SCAN_UNSECURED_RESOURCEreads as "scan unsecured resource" rather than "suppress the unsecured resource finding".
Suggested Improvement
Agree on a convention for rule constants in library packages, so that they read as the finding, stay apart from the library's API, and look the same in every library. Options to discuss (rule names are illustrative):
- No prefix, named after the finding:
http:UNSECURED_RESOURCE. Reads best; relies on the name not clashing with the API and on the docs marking it as a rule. - A suffix:
http:UNSECURED_RESOURCE_RULE. - A constant mapping of rules:
http:SCAN_RULES.UNSECURED_RESOURCE. Groups the rules under one name; needs checking that member access on a constant mapping is accepted in the annotation. - A separate module of the library, such as
ballerina/http.rules: keeps the rules out of the main API, but needs an extra import in every file that suppresses a rule.
Version
0.13.0-SNAPSHOT
- Lingua principale
- Java
- Stelle
- 15
- Fork
- 12
- Merge medio
- 2g 2h
- PR unite (30g)
- 11
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/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:13 and ballerina:14 skip positional arguments to secret-named parametersForse già presa @TharmiganK l’ha presa oggi. ApertaArea/Rules Type/Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
ballerina-platform/static-code-analysis-tool#144 ·
I maintainer di solito rispondono entro 1 giorno
-
Area/CLI Type/Improvement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
ballerina-platform/static-code-analysis-tool#138 ·
I maintainer di solito rispondono entro 1 giorno
-
Resolve `--target-dir` against the current directory and reject report flags for single filesApertaArea/CLI Type/Improvement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 63/100
ballerina-platform/static-code-analysis-tool#137 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ballerina-platform/static-code-analysis-tool
Issue simili
-
breaking change bug needs human review not ready priority medium size S
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
martin-francois/symphony-trello#1193 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
status: waiting-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
spring-projects/spring-framework#37614 ·
I maintainer di solito rispondono entro 1 giorno