Compute metrics differently according to parsers
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Start with the metrics function in spaces.rs and trace how parsers currently compute and expose metrics. Then inspect the parser implementations, including CppParser, to determine how metrics are selected and where parser-specific behavior belongs. Done means metric parsers can select supported metrics and compute them, while non-metric parsers do not expose metric computation; this broad refactor needs design work and tests across parsers.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Actually metrics are computed equally for each parser through the metrics function contained in spaces.rs file. This approach though doesn't allow to customize parsers.
To overcome the problem above, it would be helpful to split up parsers in two great classes:
- Metric parsers. They contain a
metricfunction that allows only determined metrics to be computed - Non-metric parsers. They do other things, but they do not compute metrics. For now we can consider them like metric parsers but without the methods to compute metrics
Possible structure for the metric parsers
let parser = CppParser::new(...);
// This function sets the list of metrics to be computed for the CppParser.
// Returns an error if the ones specified aren't available for the CppParser
parser.set_metrics(...).unwrap();
// Compute the metrics
parser.compute_metrics().unwrap();
Advantages
- Each parser computes only the metrics related to the structure of its language (i.e. For the HTML language,
loc, but notnombecause there aren't functions or closures in it) - A user can choose the metrics to be computed through the
set_metricsfunction - This new design can be useful for other features other than metrics
Disdvantages
- Refactor lots of code
- Implementing this new kind of design could introduce further issues
- Vorherrschende Sprache
- Rust
- Sterne
- 469
- Forks
- 74
- Ø Merge
- 17 Std. 16 Min.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus mozilla/rust-code-analysis
-
mozcpp: refresh the list of Mozilla annotation macrosEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
mozilla/rust-code-analysis#1267 ·
Maintainer antworten meist innerhalb von 1 Tag
-
mozcpp: parse a string literal followed by a PRI*/SCN* format macroEvtl. vergeben @marco-c hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 15/100
mozilla/rust-code-analysis#1266 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Grammar check tasks compare unrelated files and skip most of the othersEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
mozilla/rust-code-analysis#1261 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
mozilla/rust-code-analysis#1250 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
mozilla/rust-code-analysis#1249 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in mozilla/rust-code-analysis
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
ubugeeei-prod/vize#13586 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
storytold/photocraft#16565 ·
Maintainer antworten meist innerhalb von 1 Tag
-
flaky needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
bherbruck/solvecraft#21315 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
undergroundrap/hatchling#624 ·
Maintainer antworten meist innerhalb von 1 Tag
-
node:url: url.parse and url.resolve report name parse/resolve instead of Node's urlParse/urlResolveOffenarea:stdlib effort:S impact:low parity type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag